bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def getJobs(self, selector): predefined = { 'TODO': 'SUBMITTED,WAITING,READY,QUEUED', 'ALL': 'SUBMITTED,WAITING,READY,QUEUED,RUNNING', 'COMPLETE': str.join(',', Job.states)} jobFilter = predefined.get(selector.upper(), selector.upper())
def getJobs(self, selector): predefined = { 'TODO': 'SUBMITTED,WAITING,READY,QUEUED', 'ALL': str.join(',', Job.states)} jobFilter = predefined.get(selector.upper(), selector.upper())
476,500
def siteFilter(jobObj): dest = jobObj.get("dest") if not dest: return False dest = str.join("/", map(lambda x: x.split(":")[0], dest.upper().split("/"))) for site in jobFilter.split(','): regex = re.compile(site) if regex.search(dest) and jobObj.state not in (Job.SUCCESS, Job.FAILED): return True return False
def siteFilter(jobObj): dest = jobObj.get("dest") if not dest: return False dest = str.join("/", map(lambda x: x.split(":")[0], dest.upper().split("/"))) for site in jobFilter.split(','): if re.compile(site).search(dest): return True return False
476,501
def unique(seq): set = {} map(set.__setitem__, seq, []) return set.keys()
def unique(seq): set = {} map(set.__setitem__, seq, []) return set.keys()
476,502
def interrupt(sig, frame): global opts, log, handler opts.abort = True log = utils.ActivityLog('Quitting grid-control! (This can take a few seconds...)') signal.signal(signal.SIGINT, handler)
def interrupt(sig, frame): global opts, log, handler opts.abort = True log = utils.ActivityLog('Quitting grid-control! (This can take a few seconds...)') signal.signal(signal.SIGINT, handler)
476,503
def getMissing(self, nJobs): self.nJobs = nJobs if len(self._jobs) < nJobs: return filter(lambda x: x not in self._jobs, range(nJobs)) return []
def extendJobDB(self, nJobs): self.nJobs = nJobs if len(self._jobs) < nJobs: return filter(lambda x: x not in self._jobs, range(nJobs)) return []
476,504
def selectByID(jobNum, jobObj, arg): try: return jobNum in map(int, arg.split(",")) except: raise UserError('Job identifiers must be integers.')
def selectByID(jobNum, jobObj, arg): try: def checkID(idArg): (start, end) = (idArg.split('-')[0], idArg.split('-')[-1]) if (start == '') or jobNum >= int(start): if (end == '') or jobNum <= int(end): return True return False return reduce(operator.or_, map(checkID, arg.split(","))) except: raise UserError('Job identif...
476,505
def selectByID(jobNum, jobObj, arg): try: return jobNum in map(int, arg.split(",")) except: raise UserError('Job identifiers must be integers.')
def selectByID(jobNum, jobObj, arg): try: return jobNum in map(int, arg.split(",")) except: raise UserError('Job identifiers must be integers.')
476,506
def selectSpecific(specific): selectorType = QM(sepcific.isdigit(), 'id', 'state') if ':' in specific: selectorType = specific.split(':', 1)[0].lower() return selectorMap[selectorType](jobNum, jobObj, specific.split(':', 1)[-1])
def selectSpecific(specific): cmpValue = QM(specific[0] == '~', False, True) specific = specific.lstrip('~') selectorType = QM(specific[0].isdigit(), 'id', 'state') if ':' in specific: selectorType = specific.split(':', 1)[0].lower() return selectorMap[selectorType](jobNum, jobObj, specific.split(':', 1)[-1])
476,507
def selectSpecific(specific): selectorType = QM(sepcific.isdigit(), 'id', 'state') if ':' in specific: selectorType = specific.split(':', 1)[0].lower() return selectorMap[selectorType](jobNum, jobObj, specific.split(':', 1)[-1])
def selectSpecific(specific): selectorType = QM(sepcific.isdigit(), 'id', 'state') if ':' in specific: selectorType = specific.split(':', 1)[0].lower() return selectorMap[selectorType](jobNum, jobObj, specific.split(':', 1)[-1])
476,508
def __init__(self, config, module, monitor): (self.module, self.monitor) = (module, monitor) self.errorDict = module.errorDict self._dbPath = os.path.join(config.workDir, 'jobs') self.disableLog = os.path.join(config.workDir, 'disabled') try: if not os.path.exists(self._dbPath): if config.opts.init: os.mkdir(self._dbPa...
def __init__(self, config, module, monitor): (self.module, self.monitor) = (module, monitor) self.errorDict = module.errorDict self._dbPath = os.path.join(config.workDir, 'jobs') self.disableLog = os.path.join(config.workDir, 'disabled') try: if not os.path.exists(self._dbPath): if config.opts.init: os.mkdir(self._dbPa...
476,509
def resetState(jobs, newState): jobSet = utils.set(jobs) for jobNum in jobs: jobObj = self.jobDB.get(jobNum) if jobObj.state in [ Job.INIT, Job.DISABLED, Job.ABORTED, Job.CANCELLED, Job.DONE, Job.FAILED, Job.SUCCESS ]: self._update(jobObj, jobNum, newState) jobSet.remove(jobNum) jobObj.attempt = 0 if len(jobSet) > 0: o...
def resetState(jobs, newState): jobSet = utils.set(jobs) for jobNum in jobs: jobObj = self.jobDB.get(jobNum) if jobObj.state in [ Job.INIT, Job.DISABLED, Job.ABORTED, Job.CANCELLED, Job.DONE, Job.FAILED, Job.SUCCESS ]: self._update(jobObj, jobNum, newState) jobSet.remove(jobNum) jobObj.attempt = 0 if len(jobSet) > 0: o...
476,510
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr, addAttr): reqMap = { WMS.MEMORY: ("pvmem", lambda m: "%dmb" % m) } params = PBSGE.getSubmitArguments(self, jobNum, sandbox, stdout, stderr, addAttr, reqMap) # Job requirements reqs = dict(self.wms.getRequirements(jobNum)) if reqs.get(WMS.SITES, (None, None))...
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr, addAttr): reqMap = { WMS.MEMORY: ("pvmem", lambda m: "%dmb" % m) } params = PBSGECommon.getSubmitArguments(self, jobNum, sandbox, stdout, stderr, addAttr, reqMap) # Job requirements reqs = dict(self.wms.getRequirements(jobNum)) if reqs.get(WMS.SITES, (None, ...
476,511
def getTaskConfig(self): taskConfig = { # Space limits 'SCRATCH_UL' : self.seSDUpperLimit, 'SCRATCH_LL' : self.seSDLowerLimit, 'LANDINGZONE_UL': self.seLZUpperLimit, 'LANDINGZONE_LL': self.seLZLowerLimit, # Storage element 'SE_MINFILESIZE': self.seMinSize, 'SE_OUTPUT_FILES': str.join(' ', self.seOutputFiles), 'SE_INPUT...
def getTaskConfig(self): taskConfig = { # Space limits 'SCRATCH_UL' : self.seSDUpperLimit, 'SCRATCH_LL' : self.seSDLowerLimit, 'LANDINGZONE_UL': self.seLZUpperLimit, 'LANDINGZONE_LL': self.seLZLowerLimit, # Storage element 'SE_MINFILESIZE': self.seMinSize, 'SE_OUTPUT_FILES': str.join(' ', self.seOutputFiles), 'SE_INPUT...
476,512
def doFilter(blockinfo): name = self._filter if self._filter: name = blockinfo[DataProvider.Dataset] if DataProvider.BlockName in blockinfo and "#" in self._filter: name = "%s#%s" % (name, blockinfo[DataProvider.BlockName]) if name.startswith(self._filter): return True return False
def doFilter(blockinfo): name = self._filter if self._filter: name = blockinfo[DataProvider.Dataset] if DataProvider.BlockName in blockinfo and "#" in self._filter: name = "%s#%s" % (name, blockinfo[DataProvider.BlockName]) if name.startswith(self._filter): return True return False
476,513
def getRequirements(self, jobNum): reqs = Module.getRequirements(self, jobNum) if self.dataSplitter != None: selist = self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList, []) if selist != None: reqs.append((WMS.STORAGE, selist)) return reqs
def getRequirements(self, jobNum): reqs = Module.getRequirements(self, jobNum) if self.dataSplitter != None: selist = self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList, False) if selist != False: reqs.append((WMS.STORAGE, selist)) return reqs
476,514
def listFileInfoThread(self, result): result.extend(api.listFiles(self.datasetPath, retriveList=([], ['retrive_lumi'])[self.selectedLumis]))
def listFileInfoThread(self, result): result.extend(api.listFiles(self.datasetPath, retriveList=([], ['retrive_lumi'])[self.selectedLumis]))
476,515
def parseMap(x, parser): result = {} for entry in x.split('\n'): if "=>" in entry: nick, value = map(str.strip, entry.split('=>')) else: nick, value = (None, entry) result[nick] = filter(lambda x: x, parser(value.strip())) return result
def parseMap(x, parser): result = {} for entry in x.split('\n'): if "=>" in entry: nick, value = map(str.strip, entry.split('=>')) else: nick, value = (None, entry) result[nick] = filter(lambda x: x, parser(value.strip())) return result
476,516
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,517
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,518
def lenSplit(list, maxlen): clen = 0 tmp = [] for item in list: if clen + len(item) < maxlen: tmp.append(item) clen += len(item) else: tmp.append('') yield tmp tmp = [item] clen = len(item) yield tmp
def lenSplit(list, maxlen): clen = 0 tmp = [] for item in list: if clen + len(item) < maxlen: tmp.append(item) clen += len(item) else: tmp.append('') yield tmp tmp = [item] clen = len(item) yield tmp
476,519
def bytes(obj, enc = None): return obj
def bytes(obj, enc=None): return obj
476,520
def __str__(self): return repr(self.value)
def __str__(self): return repr(self.value)
476,521
def __str__(self): return repr(self.value)
def __str__(self): return repr(self.value)
476,522
def __str__(self): return repr(self.value)
def __str__(self): return repr(self.value)
476,523
def __str__(self): return repr(self.value)
def __str__(self): return repr(self.value)
476,524
def setdefaultproxy(proxytype=None,addr=None,port=None,rdns=True,username=None,password=None): """setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets a default proxy which all further socksocket objects will use, unless explicitly changed. """ global _defaultproxy _defaultproxy = (proxytype,ad...
def setdefaultproxy(proxytype=None,addr=None,port=None,rdns=True,username=None,password=None): """setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets a default proxy which all further socksocket objects will use, unless explicitly changed. """ global _defaultproxy _defaultproxy = (proxytype, a...
476,525
def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None): _orgsocket.__init__(self,family,type,proto,_sock) if _defaultproxy != None: self.__proxy = _defaultproxy else: self.__proxy = (None, None, None, None, None, None) self.__proxysockname = None self.__proxypeername = None
def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None): socket.socket.__init__(self, family, type, proto, _sock) if _defaultproxy != None: self.__proxy = _defaultproxy else: self.__proxy = (None, None, None, None, None, None) self.__proxysockname = None self.__proxypeername = None
476,526
def __decode(self, bytes): if 'decode' in dir(bytes): try: bytes = bytes.decode() except Exception: pass return bytes
def __decode(self, bytes): if getattr(bytes, 'decode', False): try: bytes = bytes.decode() except Exception: pass return bytes
476,527
def __encode(self, bytes): if 'encode' in dir(bytes): try: bytes = bytes.encode() except Exception: pass return bytes
def __encode(self, bytes): if getattr(bytes, 'encode', False): try: bytes = bytes.encode() except Exception: pass return bytes
476,528
def __recvall(self, count): """__recvall(count) -> data Receive EXACTLY the number of bytes requested from the socket. Blocks until the required number of bytes have been received. """ data = bytes("") while len(data) < count: d = self.recv(count-len(data)) if not d: raise GeneralProxyError((0,"connection closed unexpe...
def __recvall(self, count): """__recvall(count) -> data Receive EXACTLY the number of bytes requested from the socket. Blocks until the required number of bytes have been received. """ data = bytes("") while len(data) < count: d = self.recv(count - len(data)) if not d: raise GeneralProxyError( (0, "connection closed un...
476,529
def setproxy(self,proxytype=None,addr=None,port=None,rdns=True,username=None,password=None): """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE_SOCKS...
def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None): """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE...
476,530
def setproxy(self,proxytype=None,addr=None,port=None,rdns=True,username=None,password=None): """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE_SOCKS...
def setproxy(self,proxytype=None,addr=None,port=None,rdns=True,username=None,password=None): """setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE_SOCKS...
476,531
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4] != None) and (self.__proxy[5] != None): # The username/password details were supplied to the # s...
476,532
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,533
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,534
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,535
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,536
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,537
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,538
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,539
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,540
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,541
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,542
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
def __negotiatesocks5(self,destaddr,destport): """__negotiatesocks5(self,destaddr,destport) Negotiates a connection through a SOCKS5 server. """ # First we'll send the authentication packages we support. if (self.__proxy[4]!=None) and (self.__proxy[5]!=None): # The username/password details were supplied to the # setpr...
476,543
def getproxypeername(self): """getproxypeername() -> address info Returns the IP and port number of the proxy. """ return _orgsocket.getpeername(self)
def getproxypeername(self): """getproxypeername() -> address info Returns the IP and port number of the proxy. """ return _orgsocket.getpeername(self)
476,544
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self, destaddr, destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it ...
476,545
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
476,546
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
476,547
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
476,548
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
476,549
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
def __negotiatesocks4(self,destaddr,destport): """__negotiatesocks4(self,destaddr,destport) Negotiates a connection through a SOCKS4 server. """ # Check if the destination address provided is an IP address rmtrslv = False try: ipaddr = socket.inet_aton(destaddr) except socket.error: # It's a DNS name. Check where it sh...
476,550
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall(("CONNECT %s:%s HTTP/1.1\r\n" ...
476,551
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
476,552
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
476,553
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
476,554
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
def __negotiatehttp(self,destaddr,destport): """__negotiatehttp(self,destaddr,destport) Negotiates a connection through an HTTP server. """ # If we need to resolve locally, we do this now if self.__proxy[3] == False: addr = socket.gethostbyname(destaddr) else: addr = destaddr self.sendall("CONNECT " + addr + ":" + str(...
476,555
def slider3_sat(out_type, size, offset): s = size/20 start1 = [1, 2*s+3, 2*s+1, size/2-1-3*s, size/2-1, size/2+1] start2 = [1, 2*s-1, 2*s+2, size/2-1-4*s, size/2-1-2*s, size/2-1-s, size/2+1] ''' print >> sys.stderr, start1 print >> sys.stderr, start2 ''' print "p bdd %d %d" % (size+offset,size+2*offset) print "; automa...
def slider3_sat(out_type, size, offset): s = size/20 start1 = [1, 2*s+3, 2*s+1, size/2-1-3*s, size/2-1, size/2] start2 = [1, 2*s-1, 2*s+2, size/2-1-4*s, size/2-1-2*s, size/2-1-s, size/2] ''' print >> sys.stderr, start1 print >> sys.stderr, start2 ''' print "p bdd %d %d" % (size+offset,size+2*offset) print "; automatica...
476,556
def slider3_sat(out_type, size, offset): s = size/20 start1 = [1, 2*s+3, 2*s+1, size/2-1-3*s, size/2-1, size/2+1] start2 = [1, 2*s-1, 2*s+2, size/2-1-4*s, size/2-1-2*s, size/2-1-s, size/2+1] ''' print >> sys.stderr, start1 print >> sys.stderr, start2 ''' print "p bdd %d %d" % (size+offset,size+2*offset) print "; automa...
def slider3_sat(out_type, size, offset): s = size/20 start1 = [1, 2*s+3, 2*s+1, size/2-1-3*s, size/2-1, size/2+1] start2 = [1, 2*s-1, 2*s+2, size/2-1-4*s, size/2-1-2*s, size/2-1-s, size/2+1] ''' print >> sys.stderr, start1 print >> sys.stderr, start2 ''' print "p bdd %d %d" % (size+offset,size+2*offset) print "; automa...
476,557
def __init__(self, target_file, target_dir, materials = None, textures = None): self.target_file = target_file self.target_dir = target_dir self.exported_materials = [] self.exported_textures = [] self.materials = materials if materials != None else bpy.data.textures self.textures = textures if textures != None else bp...
def __init__(self, target_file, target_dir, materials = None, textures = None): self.target_file = target_file self.target_dir = target_dir self.exported_materials = [] self.exported_textures = [] self.materials = materials if materials != None else bpy.data.materials self.textures = textures if textures != None else b...
476,558
def findMaterial(self, name): if name in self.materials: return self.materials[name] else: raise Exception('Failed to find material "%s"' % name)
def findMaterial(self, name): if name in self.materials: return self.materials[name] else: raise Exception('Failed to find material "%s"' % name)
476,559
def dict_merge(*args): vis = {} for vis_dict in args: vis.update(deepcopy(vis_dict)) return vis
def dict_merge(*args): vis = {} for vis_dict in args: vis.update(deepcopy(vis_dict)) return vis
476,560
def execute(self, context): pv = [ 'bpy.context.material.mitsuba_material.%s'%v['attr'] for v in bpy.types.mitsuba_material.get_exportable_properties() ]
def execute(self, context): pv = [ 'bpy.context.material.mitsuba_material.%s'%v['attr'] for v in bpy.types.mitsuba_material.get_exportable_properties() ]
476,561
def execute(self, context): try: if self.properties.scene == '': scene = context.scene else: scene = bpy.data.scenes[self.properties.scene]
def execute(self, context): try: if self.properties.scene == '': scene = context.scene else: scene = bpy.data.scenes[self.properties.scene]
476,562
def exportLamp(self, lamp, idx): ltype = lamp.data.mitsuba_lamp.type name = translate_id(lamp.data.name) if ltype == 'POINT': self.out.write('\t<luminaire id="%s-light" type="point">\n' % name) mult = lamp.data.mitsuba_lamp.intensity self.exportWorldtrafo(lamp.matrix_world) self.out.write('\t\t<rgb name="intensity" val...
def exportLamp(self, lamp, idx): ltype = lamp.data.mitsuba_lamp.type name = translate_id(lamp.data.name) if ltype == 'POINT': self.out.write('\t<luminaire id="%s-light" type="point">\n' % name) mult = lamp.data.mitsuba_lamp.intensity self.exportWorldtrafo(lamp.matrix_world) self.out.write('\t\t<rgb name="intensity" val...
476,563
def test_get_json_attr_types(self): self.assertEqual(DashboardBundle.get_json_attr_types(), {'test_runs': [TestRun]})
def test_get_json_attr_types(self): self.assertEqual(DashboardBundle.get_json_attr_types(), {'test_runs': [TestRun]})
476,564
def test_construction_1(self): hw_context = HardwareContext() self.assertEqual(context.devices, [])
def test_construction_1(self): hw_context = HardwareContext() self.assertEqual(context.devices, [])
476,565
def test_construction_2(self): devices = object() hw_context = HardwareContext(devices) self.assertTrue(context.devices is devices)
def test_construction_2(self): devices = object() hw_context = HardwareContext(devices) self.assertTrue(context.devices is devices)
476,566
def test_construction_3(self): devices = object() hw_context = HardwareContext(devices=devices) self.assertTrue(context.devices is devices)
def test_construction_3(self): devices = object() hw_context = HardwareContext(devices=devices) self.assertTrue(context.devices is devices)
476,567
def test_get_json_attr_types(self): self.assertEqual(HardwareContext.get_json_attr_types(), {'devices': [HardwareDevice]})
def test_get_json_attr_types(self): self.assertEqual(HardwareContext.get_json_attr_types(), {'devices': [HardwareDevice]})
476,568
def test_device_types(self): self.assertEqual(HardwareDevice.DEVICE_CPU, "device.cpu") self.assertEqual(HardwareDevice.DEVICE_MEM, "device.mem") self.assertEqual(HardwareDevice.DEVICE_USB, "device.usb") self.assertEqual(HardwareDevice.DEVICE_PCI, "device.pci") self.assertEqual(HardwareDevice.DEVICE_BOARD, "device.board...
def test_device_types(self): self.assertEqual(HardwareDevice.DEVICE_CPU, "device.cpu") self.assertEqual(HardwareDevice.DEVICE_MEM, "device.mem") self.assertEqual(HardwareDevice.DEVICE_USB, "device.usb") self.assertEqual(HardwareDevice.DEVICE_PCI, "device.pci") self.assertEqual(HardwareDevice.DEVICE_BOARD, "device.board...
476,569
def test_get_json_attr_types(self): self.assertEqual(SoftwareContext.get_json_attr_types(), {'packages': [SoftwarePackage], 'sw_image': SoftwareImage})
def test_get_json_attr_types(self): self.assertEqual(SoftwareContext.get_json_attr_types(), {'packages': [SoftwarePackage], 'sw_image': SoftwareImage})
476,570
def test_get_json_attr_types(self): self.assertRaises(NotImplementedError, SoftwareImage.get_json_attr_types)
def test_get_json_attr_types(self): self.assertRaises(NotImplementedError, SoftwareImage.get_json_attr_types)
476,571
def test_get_json_attr_types(self): self.assertRaises(NotImplementedError, SoftwarePackage.get_json_attr_types)
def test_get_json_attr_types(self): self.assertRaises(NotImplementedError, SoftwarePackage.get_json_attr_types)
476,572
def test_get_stats(self): test_run = TestRun() for result, count in [ [TestResult.RESULT_PASS, 3], [TestResult.RESULT_FAIL, 5], [TestResult.RESULT_SKIP, 2], [TestResult.RESULT_UNKNOWN, 1]]: for i in range(count): test_run.test_results.append(TestResult(None, result)) stats = test_run.get_stats() self.assertEqual(stats,...
def test_get_stats(self): test_run = TestRun() for result, count in [ [TestResult.RESULT_PASS, 3], [TestResult.RESULT_FAIL, 5], [TestResult.RESULT_SKIP, 2], [TestResult.RESULT_UNKNOWN, 1]]: for i in range(count): test_run.test_results.append(TestResult(None, result)) stats = test_run.get_stats() self.assertEqual(stats,...
476,573
def _set_test_id(self, test_id): if test_id is not None and not self._TEST_ID_PATTERN.match(test_id): raise ValueError("Test id must be None or a string with reverse domain name") self._test_id = test_id
def _set_test_id(self, test_id): if test_id is not None and not self._TEST_ID_PATTERN.match(test_id): raise ValueError("Test id must be None or a string with reverse " "domain name") self._test_id = test_id
476,574
def __repr__(self): """ Produce more-less human readable encoding of all fields.
def __repr__(self): """ Produce more-less human readable encoding of all fields.
476,575
def __repr__(self): """ Produce more-less human readable encoding of all fields.
def __repr__(self): """ Produce more-less human readable encoding of all fields.
476,576
def _set_timestamp(self, timestamp): if timestamp is not None and not isinstance(timestamp, datetime.datetime): raise TypeError("Timestamp must be None or datetime.datetime() instance") self._timestamp = timestamp
def _set_timestamp(self, timestamp): if timestamp is not None and not isinstance(timestamp, datetime.datetime): raise TypeError("Timestamp must be None or datetime.datetime() " "instance") self._timestamp = timestamp
476,577
def _set_duration(self, duration): if duration is not None and not isinstance(duration, datetime.timedelta): raise TypeError("duration must be None or datetime.timedelta() instance") if duration is not None and duration.days < 0: raise ValueError("duration cannot be negative") self._duration = duration
def _set_duration(self, duration): if duration is not None and not isinstance(duration, datetime.timedelta): raise TypeError("duration must be None or datetime.timedelta() " "instance") if duration is not None and duration.days < 0: raise ValueError("duration cannot be negative") self._duration = duration
476,578
def __cmp__(self, other): return cmp(self.message, other.message) or cmp(self.new_message, self.other_messge)
def __cmp__(self, other): return cmp(self.message, other.message) or cmp(self.new_message, self.other_messge)
476,579
def __str__(self): return ("ValidationError: {0} " "object_expr={1!r}, " "schema_expr={2!r})").format( self.new_message, self.object_expr, self.schema_expr)
def __str__(self): return ("ValidationError: {0} " "object_expr={1!r}, " "schema_expr={2!r})").format( self.new_message, self.object_expr, self.schema_expr)
476,580
def _report_error(self, legacy_message, new_message=None, object_suffix=None, schema_suffix=None): """ Report an error during validation.
def _report_error(self, legacy_message, new_message=None, schema_suffix=None): """ Report an error during validation.
476,581
def _report_error(self, legacy_message, new_message=None, object_suffix=None, schema_suffix=None): """ Report an error during validation.
def _report_error(self, legacy_message, new_message=None, object_suffix=None, schema_suffix=None): """ Report an error during validation.
476,582
def _report_error(self, legacy_message, new_message=None, object_suffix=None, schema_suffix=None): """ Report an error during validation.
def _report_error(self, legacy_message, new_message=None, object_suffix=None, schema_suffix=None): """ Report an error during validation.
476,583
def __init__(self, devices=None): self.devices = devices or []
def __init__(self, devices=None): self.devices = devices or []
476,584
def __init__(self): self.parser = argparse.ArgumentParser( description=""" Command line tool for interacting with Launch Control """, epilog=""" Please report all bugs using the Launchpad bug tracker: http://bugs.launchpad.net/launch-control/+filebug """, add_help=False) self.subparsers = self.parser.add_subparsers(tit...
def __init__(self): self.parser = argparse.ArgumentParser( description=""" Command line tool for interacting with Launch Control """, epilog=""" Please report all bugs using the Launchpad bug tracker: http://bugs.launchpad.net/launch-control/+filebug """, add_help=False) self.subparsers = self.parser.add_subparsers( ti...
476,585
def test_construction_1(self): name = object() sw_image = SoftwareImage(name) self.assertTrue(sw_image.name is name)
def test_construction_1(self): name = object() sw_image = SoftwareImage(name) self.assertTrue(sw_image.name is name)
476,586
def test_allowed_for_anyone(self): with fixtures.created_bundle_streams(self.bundle_streams): pathnames = [bundle_stream.pathname for bundle_stream in BundleStream.objects.allowed_for_anyone().order_by('pathname')] self.assertEqual(pathnames, self.expected_pathnames)
def test_allowed_for_anyone(self): with fixtures.created_bundle_streams(self.bundle_streams): pathnames = [bundle_stream.pathname for bundle_stream in BundleStream.objects.allowed_for_anyone().order_by('pathname')] self.assertEqual(pathnames, self.expected_pathnames)
476,587
def save(self, *args, **kwargs): if self.content: sha1 = hashlib.sha1() for chunk in self.content.chunks(): sha1.update(chunk) self.content_sha1 = sha1.hexdigest() self.content.seek(0) return super(Bundle, self).save(*args, **kwargs)
def save(self, *args, **kwargs): if self.content: sha1 = hashlib.sha1() for chunk in self.content.chunks(): sha1.update(chunk) self.content_sha1 = sha1.hexdigest() self.content.seek(0) return super(Bundle, self).save(*args, **kwargs)
476,588
def pod_attrs(self): """ Return a list of sorted attributes.
def pod_attrs(self): """ Return a list of sorted attributes.
476,589
... def __init__(self, name):
... def __init__(self, name):
476,590
... def name(self):
... def name(self):
476,591
def __repr__(self): """ Produce more-less human readable encoding of all fields.
def __repr__(self): """ Produce more-less human readable encoding of all fields.
476,592
def _fill_args(self, *args, **kwargs): a_out = [] used_kwargs = set() # Walk through all arguments of the original function. Ff the argument # is present in `args' then use it. If we run out of positional # arguments look for keyword arguments with the same name for i, arg_name in enumerate(self._args): # find the argu...
def _fill_args(self, *args, **kwargs): a_out = [] used_kwargs = set() # Walk through all arguments of the original function. Ff the argument # is present in `args' then use it. If we run out of positional # arguments look for keyword arguments with the same name for i, arg_name in enumerate(self._args): # find the argu...
476,593
def bundles(self, pathname): """ Name ---- `bundles` (`pathname`)
def bundles(self, pathname): """ Name ---- `bundles` (`pathname`)
476,594
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
476,595
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
476,596
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
476,597
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
476,598
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri...
476,599