bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _setupOutputLogging(self, rpmverbosity="info"): # UGLY... set up the transaction to record output from scriptlets io_r = tempfile.NamedTemporaryFile() self._readpipe = io_r self._writepipe = open(io_r.name, 'w+b') self.base.ts.scriptFd = self._writepipe.fileno() rpmverbosity = {'critical' : 'crit', 'emergency' : 'e... | def _setupOutputLogging(self, rpmverbosity="info"): # UGLY... set up the transaction to record output from scriptlets io_r = tempfile.NamedTemporaryFile() self._readpipe = io_r self._writepipe = open(io_r.name, 'w+b') self.base.ts.ts.scriptFd = self._writepipe.fileno() rpmverbosity = {'critical' : 'crit', 'emergency' ... | 464,100 |
def _trans_rpmdb_problem(self, problem): if not hasattr(self, '_tid'): return # Not configured to run cur = self._get_cursor() if cur is None or not self._update_db_file_2(): return None res = executeSQL(cur, """INSERT INTO trans_rpmdb_problems (tid, problem, msg) VALUES (?, ?, ?)""", (self._tid, problem.problem, to_un... | def _trans_rpmdb_problem(self, problem): if not hasattr(self, '_tid'): return # Not configured to run cur = self._get_cursor() if cur is None or not self._update_db_file_2(): return None res = executeSQL(cur, """INSERT INTO trans_rpmdb_problems (tid, problem, msg) VALUES (?, ?, ?)""", (self._tid, problem.problem, uprob... | 464,101 |
def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)): # Parse only command line options that affect basic yum setup opts = self._parser.firstParse(args) # Just print out the version if that's what the user wanted if opts.version: self._printUtilVersion() sys.exit(0) # get the install root t... | def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)): # Parse only command line options that affect basic yum setup opts = self._parser.firstParse(args) # Just print out the version if that's what the user wanted if opts.version: self._printUtilVersion() sys.exit(0) # get the install root t... | 464,102 |
def readRepoConfig(self, parser, section): '''Parse an INI file section for a repository. | def readRepoConfig(self, parser, section): '''Parse an INI file section for a repository. | 464,103 |
def getKeyForPackage(self, po, askcb = None, fullaskcb = None): """ Retrieve a key for a package. If needed, prompt for if the key should be imported using askcb. @param po: Package object to retrieve the key of. @param askcb: Callback function to use for asking for verification. Takes arguments of the po, the userid ... | def getKeyForPackage(self, po, askcb = None, fullaskcb = None): """ Retrieve a key for a package. If needed, prompt for if the key should be imported using askcb. @param po: Package object to retrieve the key of. @param askcb: Callback function to use for asking for verification. Takes arguments of the po, the userid ... | 464,104 |
def getKeyForRepo(self, repo, callback=None): """ Retrieve a key for a repository If needed, prompt for if the key should be imported using callback @param repo: Repository object to retrieve the key of. @param callback: Callback function to use for asking for verification of a key. Takes a dictionary of key info. """... | def getKeyForRepo(self, repo, callback=None): """ Retrieve a key for a repository If needed, prompt for if the key should be imported using callback @param repo: Repository object to retrieve the key of. @param callback: Callback function to use for asking for verification of a key. Takes a dictionary of key info. """... | 464,105 |
def historySummaryCmd(self, extcmds): tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history info'] | def historySummaryCmd(self, extcmds): tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history info'] | 464,106 |
def __init__(self, fi, filetuple, csum_type, override_vflags=False): YUMVerifyPackageFile.__init__(self, filetuple[0]) | def __init__(self, fi, filetuple, csum_type, override_vflags=False): YUMVerifyPackageFile.__init__(self, filetuple[0]) | 464,107 |
def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)): # Parse only command line options that affect basic yum setup opts = self._parser.firstParse(args) # Just print out the version if that's what the user wanted if opts.version: self._printUtilVersion() sys.exit(0) # get the install root t... | def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)): # Parse only command line options that affect basic yum setup opts = self._parser.firstParse(args) # Just print out the version if that's what the user wanted if opts.version: self._printUtilVersion() sys.exit(0) # get the install root t... | 464,108 |
def _maybeYouMeant(self, arg): """ If install argument doesn't match with case, tell the user. """ matches = self.doPackageLists(patterns=[arg], ignore_case=True) matches = matches.installed + matches.available matches = set(map(lambda x: x.name, matches)) if matches: msg = self.fmtKeyValFill(_(' * Maybe you meant: ')... | def _maybeYouMeant(self, arg): """ If install argument doesn't match with case, tell the user. """ matches = self.doPackageLists(patterns=[arg], ignore_case=True) matches = matches.installed + matches.available matches = set(map(lambda x: x.name, matches)) if matches: msg = self.fmtKeyValFill(_(' * Maybe you meant: ')... | 464,109 |
def _requiringFromInstalled(self, requiringPo, requirement, errorlist): """processes the dependency resolution for a dep where the requiring package is installed""" | def _requiringFromInstalled(self, requiringPo, requirement, errorlist): """processes the dependency resolution for a dep where the requiring package is installed""" | 464,110 |
def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 464,111 |
def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 464,112 |
def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 464,113 |
def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 464,114 |
def verifyPkg(self, fo, po, raiseError): """verifies the package is what we expect it to be raiseError = defaults to 0 - if 1 then will raise a URLGrabError if the file does not check out. otherwise it returns false for a failure, true for success""" failed = False | def verifyPkg(self, fo, po, raiseError): """verifies the package is what we expect it to be raiseError = defaults to 0 - if 1 then will raise a URLGrabError if the file does not check out. otherwise it returns false for a failure, true for success""" failed = False | 464,115 |
def deserialize(self, msg, idx, pkt_len) : idx_save = idx self.version, idx = get_whole_int(msg, idx, 1) if self.version != 2 and self.version != 3 and self.version != 4 : raise 'unknown public key packet version %d at %d' % (self.version, idx_save) if self.version == 2 : # map v2 into v3 for coding simplicity since th... | def deserialize(self, msg, idx, pkt_len) : idx_save = idx self.version, idx = get_whole_int(msg, idx, 1) if self.version != 2 and self.version != 3 and self.version != 4 : raise RuntimeError('unknown public key packet version %d at %d' % (self.version, idx_save)) if self.version == 2 : # map v2 into v3 for coding simpl... | 464,116 |
def deserialize(self, msg, idx, pkt_len) : idx_save = idx self.version, idx = get_whole_int(msg, idx, 1) if self.version != 2 and self.version != 3 and self.version != 4 : raise 'unknown public key packet version %d at %d' % (self.version, idx_save) if self.version == 2 : # map v2 into v3 for coding simplicity since th... | def deserialize(self, msg, idx, pkt_len) : idx_save = idx self.version, idx = get_whole_int(msg, idx, 1) if self.version != 2 and self.version != 3 and self.version != 4 : raise 'unknown public key packet version %d at %d' % (self.version, idx_save) if self.version == 2 : # map v2 into v3 for coding simplicity since th... | 464,117 |
def deserialize(self, msg, idx, pkt_len) : self.version, idx = get_whole_int(msg, idx, 1) if self.version == 2 : self.version = 3 if self.version == 3 : hash_len, idx = get_whole_number(msg, idx, 1) self.sig_type, idx = get_whole_int(msg, idx, 1) self.timestamp, idx = get_whole_number(msg, idx, 4) self.timestamp = floa... | def deserialize(self, msg, idx, pkt_len) : self.version, idx = get_whole_int(msg, idx, 1) if self.version == 2 : self.version = 3 if self.version == 3 : hash_len, idx = get_whole_number(msg, idx, 1) self.sig_type, idx = get_whole_int(msg, idx, 1) self.timestamp, idx = get_whole_number(msg, idx, 4) self.timestamp = floa... | 464,118 |
def deserialize(self, msg, idx, pkt_len) : self.version, idx = get_whole_int(msg, idx, 1) if self.version == 2 : self.version = 3 if self.version == 3 : hash_len, idx = get_whole_number(msg, idx, 1) self.sig_type, idx = get_whole_int(msg, idx, 1) self.timestamp, idx = get_whole_number(msg, idx, 4) self.timestamp = floa... | def deserialize(self, msg, idx, pkt_len) : self.version, idx = get_whole_int(msg, idx, 1) if self.version == 2 : self.version = 3 if self.version == 3 : hash_len, idx = get_whole_number(msg, idx, 1) self.sig_type, idx = get_whole_int(msg, idx, 1) self.timestamp, idx = get_whole_number(msg, idx, 4) self.timestamp = floa... | 464,119 |
def decode_multiple_keys(msg): #ditto of above - but handling multiple certs/keys per file certs = [] pgpkey_lines = map(lambda x : x.rstrip(), msg.split('\n')) in_block = 0 block = '' for l in pgpkey_lines : if not in_block : if l == '-----BEGIN PGP PUBLIC KEY BLOCK-----' : in_block = 1 block += '%s\n' % l continue ... | def decode_multiple_keys(msg): #ditto of above - but handling multiple certs/keys per file certs = [] pgpkey_lines = map(lambda x : x.rstrip(), msg.split('\n')) in_block = 0 block = '' for l in pgpkey_lines : if not in_block : if l == '-----BEGIN PGP PUBLIC KEY BLOCK-----' : in_block = 1 block += '%s\n' % l continue ... | 464,120 |
def _ipkg2pid(self, po): csum = None yumdb = po.yumdb_info if 'checksum_type' in yumdb and 'checksum_type' in yumdb: csum = "%s:%s" % (yumdb.checksum_type, yumdb.checksum_data) return self._pkgtup2pid(po.pkgtup, csum) | def _ipkg2pid(self, po): csum = None yumdb = po.yumdb_info if 'checksum_type' in yumdb and 'checksum_data' in yumdb: csum = "%s:%s" % (yumdb.checksum_type, yumdb.checksum_data) return self._pkgtup2pid(po.pkgtup, csum) | 464,121 |
def buildTransaction(self, unfinished_transactions_check=True): """go through the packages in the transaction set, find them in the packageSack or rpmdb, and pack up the ts accordingly""" if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfini... | def buildTransaction(self, unfinished_transactions_check=True): """go through the packages in the transaction set, find them in the packageSack or rpmdb, and pack up the ts accordingly""" if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfini... | 464,122 |
def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 464,123 |
def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 464,124 |
def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 464,125 |
def verifyTransaction(self, resultobject=None): """checks that the transaction did what we expected it to do. Also propagates our external yumdb info""" # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries # for eac... | def verifyTransaction(self, resultobject=None): """checks that the transaction did what we expected it to do. Also propagates our external yumdb info""" # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries # for eac... | 464,126 |
def verifyTransaction(self, resultobject=None): """checks that the transaction did what we expected it to do. Also propagates our external yumdb info""" # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries # for eac... | def verifyTransaction(self, resultobject=None): """checks that the transaction did what we expected it to do. Also propagates our external yumdb info""" # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries # for eac... | 464,127 |
def _trans_cmdline(self, cmdline): if not hasattr(self, '_tid'): return # Not configured to run cur = self._get_cursor() if cur is None or not self._update_db_file_2(): return None res = executeSQL(cur, """INSERT INTO trans_cmdline (tid, cmdline) VALUES (?, ?)""", (self._tid, cmdline)) return cur.lastrowid | def _trans_cmdline(self, cmdline): if not hasattr(self, '_tid'): return # Not configured to run cur = self._get_cursor() if cur is None or not self._update_db_file_2(): return None res = executeSQL(cur, """INSERT INTO trans_cmdline (tid, cmdline) VALUES (?, ?)""", (self._tid, to_unicode(cmdline))) return cur.lastrowid | 464,128 |
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "... | def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "... | 464,129 |
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "... | def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "... | 464,130 |
def _rpmdb_warn_checks(self, out=None, warn=True, chkcmd=None, header=None, ignore_pkgs=[]): if out is None: out = self.logger.warning if chkcmd is None: chkcmd = ['dependencies', 'duplicates'] if header is None: # FIXME: _N() msg = _("** Found %d pre-existing rpmdb problem(s)," " 'yum check' output follows:") header =... | def _rpmdb_warn_checks(self, out=None, warn=True, chkcmd=None, header=None, ignore_pkgs=[]): if out is None: out = self.logger.warning if chkcmd is None: chkcmd = ['dependencies', 'duplicates'] if header is None: # FIXME: _N() msg = _("** Found %d pre-existing rpmdb problem(s)," " 'yum check' output follows:") header =... | 464,131 |
def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | 464,132 |
def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | 464,133 |
def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | 464,134 |
def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist? | 464,135 |
def _requiringFromTransaction(self, requiringPo, requirement, errorlist): """processes the dependency resolution for a dep where requiring package is in the transaction set""" (name, arch, epoch, version, release) = requiringPo.pkgtup (needname, needflags, needversion) = requirement checkdeps = 0 missingdep = 0 upgrad... | def _requiringFromTransaction(self, requiringPo, requirement, errorlist): """processes the dependency resolution for a dep where requiring package is in the transaction set""" (name, arch, epoch, version, release) = requiringPo.pkgtup (needname, needflags, needversion) = requirement checkdeps = 0 missingdep = 0 upgrad... | 464,136 |
def __init__(self, root='/', releasever=None, cachedir=None, persistdir='/var/lib/yum'): self.root = root self._idx2pkg = {} self._name2pkg = {} self._pkgnames_loaded = set() self._tup2pkg = {} self._completely_loaded = False self._pkgname_fails = set() self._pkgmatch_fails = set() self._provmatch_fails = set() self._s... | def __init__(self, root='/', releasever=None, cachedir=None, persistdir='/var/lib/yum'): self.root = root self._idx2pkg = {} self._name2pkg = {} self._pkgnames_loaded = set() self._tup2pkg = {} self._completely_loaded = False self._pkgname_fails = set() self._pkgmatch_fails = set() self._provmatch_fails = set() self._s... | 464,137 |
def __init__(self, db_path='/var/lib/yum/yumdb'): self.conf = misc.GenericHolder() self.conf.db_path = db_path self.conf.writable = False self._packages = {} # pkgid = dir if not os.path.exists(self.conf.db_path): try: os.makedirs(self.conf.db_path) except (IOError, OSError), e: # some sort of useful thing here? A war... | def __init__(self, db_path='/var/lib/yum/yumdb', version_path=None): self.conf = misc.GenericHolder() self.conf.db_path = db_path self.conf.writable = False self._packages = {} # pkgid = dir if not os.path.exists(self.conf.db_path): try: os.makedirs(self.conf.db_path) except (IOError, OSError), e: # some sort of usefu... | 464,138 |
def searchPrco(self, name, prcotype): | def searchPrco(self, name, prcotype): | 464,139 |
def getKeyForPackage(self, po, askcb = None, fullaskcb = None): """ Retrieve a key for a package. If needed, prompt for if the key should be imported using askcb. @param po: Package object to retrieve the key of. @param askcb: Callback function to use for asking for verification. Takes arguments of the po, the userid ... | def getKeyForPackage(self, po, askcb = None, fullaskcb = None): """ Retrieve a key for a package. If needed, prompt for if the key should be imported using askcb. @param po: Package object to retrieve the key of. @param askcb: Callback function to use for asking for verification. Takes arguments of the po, the userid ... | 464,140 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,141 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,142 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,143 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,144 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,145 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,146 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,147 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,148 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,149 |
def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | 464,150 |
def restore_point(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] return mysqldump_command ("-u%s %s%s --add-drop-table --default-character-set=utf8 %s" % (user, "-p" if password else "", password, db)) | def restore_point(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] host = config["db_host"] return mysqldump_command ("-u%s %s%s %s --add-drop-table --default-character-set=utf8 %s" % (user, "-p" if password else "", password, "-h"+host if host <> '... | 464,151 |
def dump(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] return mysqldump_command ("--no-data --compact -u%s %s%s --default-character-set=utf8 %s" % (user, "-p" if password else "", password, db)) | def dump(): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] host = config["db_host"] return mysqldump_command ("--no-data --add-lock=false --compact -u%s %s%s %s --default-character-set=utf8 %s" % (user, "-p" if password else "", password, "-h"+host i... | 464,152 |
def load (sql): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] tempfile = ".temp-mygrate-%s" % str(datetime.time()).replace (':', '_') f = open (tempfile, 'w') f.write (sql) f.close() (output, errors) = mysql_command ("-u%s %s%s --default-character-set... | def load (sql): config = cmds.init.config() user = config["db_user"] password = config["db_pass"] db = config["db_db"] tempfile = ".temp-mygrate-%s" % str(datetime.time()).replace (':', '_') f = open (tempfile, 'w') f.write (sql) f.close() (output, errors) = mysql_command ("-u%s %s%s %s --default-character-... | 464,153 |
def __init__(self, driver, title): default_restriction = 4 default_font = "Anonymous Pro,DejaVu Sans Mono,Consolas,Lucida Console,monospace 8" | def __init__(self, driver, title): default_restriction = 4 default_font = "Anonymous Pro,DejaVu Sans Mono,Consolas,Lucida Console,monospace 8" | 464,154 |
def format_element(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style: the CSS style to be applied to the link. """ _ = gettext_set_language(bfo.lang) out = "" user_info = bfo.user_info collection = guess_primary_collection_of_a_record(bfo.recID) (auth_code, auth_message) = acc_autho... | defformat_element(bfo,style):"""PrintsalinktoBibEdit,ifauthorizationisgranted@paramstyle:theCSSstyletobeappliedtothelink."""_=gettext_set_language(bfo.lang)out=""user_info=bfo.user_infocollection=guess_primary_collection_of_a_record(bfo.recID)(auth_code,auth_message)=acc_authorize_action(user_info,'runbibedit',collecti... | 464,155 |
def format_element(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style: the CSS style to be applied to the link. """ _ = gettext_set_language(bfo.lang) out = "" user_info = bfo.user_info collection = guess_primary_collection_of_a_record(bfo.recID) (auth_code, auth_message) = acc_autho... | def format_element(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style: the CSS style to be applied to the link. """ _ = gettext_set_language(bfo.lang) out = "" user_info = bfo.user_info collection = guess_primary_collection_of_a_record(bfo.recID) (auth_code, auth_message) = acc_autho... | 464,156 |
def format(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style: the CSS style to be applied to the link. """ _ = gettext_set_language(bfo.lang) out = "" user_info = bfo.user_info collection = guess_primary_collection_of_a_record(bfo.recID) (auth_code, auth_message) = acc_authorize_act... | def format(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style: the CSS style to be applied to the link. """ _ = gettext_set_language(bfo.lang) out = "" user_info = bfo.user_info collection = guess_primary_collection_of_a_record(bfo.recID) (auth_code, auth_message) = acc_authorize_act... | 464,157 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | defget_text_snippets(textfile_path,patterns,nb_words_around,max_snippets,\right_boundary=True):"""Extracttextsnippetsaround'patterns'fromfilefoundat'textfile_path'Thesnippetsaremeanttolooklikeintheresultsofthepopularsearchengine:using"..."betweensnippets.Foremptypatternsitreturns""Theideaistofirstproducebigsnippetswith... | 464,158 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | 464,159 |
def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | 464,160 |
def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | 464,161 |
def filter_hidden_fields(recxml, user_info=None, filter_tags=CFG_BIBFORMAT_HIDDEN_TAGS, force_filtering=False): """ Filter out tags specified by filter_tags from MARCXML. If the user is allowed to run bibedit, then filter nothing, unless force_filtering is set to True. @param recxml: marcxml presentation of the record... | def filter_hidden_fields(recxml, user_info=None, filter_tags=CFG_BIBFORMAT_HIDDEN_TAGS, force_filtering=False): """ Filter out tags specified by filter_tags from MARCXML. If the user is allowed to run bibedit, then filter nothing, unless force_filtering is set to True. @param recxml: marcxml presentation of the record... | 464,162 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | 464,163 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | 464,164 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | 464,165 |
def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | 464,166 |
def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | 464,167 |
def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | 464,168 |
def highlight(text, keywords=None, prefix_tag='<strong>', suffix_tag="</strong>"): """ Returns text with all words highlighted with given tags (this function places 'prefix_tag' and 'suffix_tag' before and after words from 'keywords' in 'text'). for example set prefix_tag='<b style="color: black; background-color: rgb... | def highlight_matches(text, compiled_pattern, \ prefix_tag='<strong>', suffix_tag="</strong>"): """ Highlight words in 'text' matching the 'compiled_pattern' """ #FIXME decide if non english accentuated char should be desaccentuaded def replace_highlight(match): """ replace match.group() by prefix_tag + match.group()... | 464,169 |
def replace_highlight(match): """ replace match.group() by prefix_tag + match.group() + suffix_tag""" return prefix_tag + match.group() + suffix_tag | def replace_highlight(match): """ replace match.group() by prefix_tag + match.group() + suffix_tag""" return prefix_tag + match.group() + suffix_tag | 464,170 |
def get_pdf_snippets(recID, patterns, nb_words_around=CFG_WEBSEARCH_FULLTEXT_SNIPPETS_WORDS, max_snippets=CFG_WEBSEARCH_FULLTEXT_SNIPPETS): """ Extract text snippets around 'patterns' from the newest PDF file of 'recID' The search is case-insensitive. The snippets are meant to look like in the results of the popular se... | def get_pdf_snippets(recID, patterns, nb_words_around=CFG_WEBSEARCH_FULLTEXT_SNIPPETS_WORDS, max_snippets=CFG_WEBSEARCH_FULLTEXT_SNIPPETS): """ Extract text snippets around 'patterns' from the newest PDF file of 'recID' The search is case-insensitive. The snippets are meant to look like in the results of the popular se... | 464,171 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it re... | 464,172 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | 464,173 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | 464,174 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | 464,175 |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): """ Extract text snippets around 'patterns' from file found at 'textfile_path' The snippets are meant to look like in the results of the popular search engine: using " ... " between snippets. For empty patterns it returns "" The idea is to f... | 464,176 |
def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | 464,177 |
def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | 464,178 |
def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | def starts_with_any(word, patterns): # Check whether the word's beginning matches any of the patterns. # The second argument is an array of patterns to match. | 464,179 |
def get_files(bfo): """ Returns the files available for the given record. Returned structure is a tuple (parsed_urls, old_versions, additionals): - parsed_urls: contains categorized URLS (see details below) - old_versions: set to True if we can have access to old versions - additionals: set to True if we have other doc... | def get_files(bfo): """ Returns the files available for the given record. Returned structure is a tuple (parsed_urls, old_versions, additionals): - parsed_urls: contains categorized URLS (see details below) - old_versions: set to True if we can have access to old versions - additionals: set to True if we have other doc... | 464,180 |
def get_pdf_snippets(recID, patterns, nb_words_around=CFG_WEBSEARCH_FULLTEXT_SNIPPETS_WORDS, max_snippets=CFG_WEBSEARCH_FULLTEXT_SNIPPETS): """ Extract text snippets around 'patterns' from the newest PDF file of 'recID' The search is case-insensitive. The snippets are meant to look like in the results of the popular se... | def get_pdf_snippets(recID, patterns, nb_words_around=CFG_WEBSEARCH_FULLTEXT_SNIPPETS_WORDS, max_snippets=CFG_WEBSEARCH_FULLTEXT_SNIPPETS): """ Extract text snippets around 'patterns' from the newest PDF file of 'recID' The search is case-insensitive. The snippets are meant to look like in the results of the popular se... | 464,181 |
def ffGS(z,target,estimate=None, iterations=20,error=None): ''' Far field Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. It uses the Gerber Saxton algorithm for Fraunhoffer propagation.... | def ffGS(z,target,estimate=None, iterations=20,error=None): ''' Far field Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. It uses the Gerchberg - Saxton algorithm for Fraunhoffer propaga... | 464,182 |
def ffGS(z,target,estimate=None, iterations=20,error=None): ''' Far field Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. It uses the Gerber Saxton algorithm for Fraunhoffer propagation.... | def ffGS(z,target,estimate=None, iterations=20,error=None): ''' Far field Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. It uses the Gerber Saxton algorithm for Fraunhoffer propagation.... | 464,183 |
def frGS(z,target,estimate=None, iterations=20,error=None): ''' Fresnel transform Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. A FFT implementation of the Fresnel Transform is used. ... | def frGS(z,target,estimate=None, iterations=20,error=None): ''' Fresnel transform Gerchberg - Saxton Algorithm Calculates the phase distribution in a object plane (for a given amplitude constrain) to obtain an specific amplitude distribution in the target plane. A FFT implementation of the Fresnel Transform is used. ... | 464,184 |
def get_function_list(module): r=[] try: oblist=module.__all__ except(AttributeError): return r for o in oblist: obj=module.__dict__[o] if isfunction(obj): r.append(o) return r | def get_function_list(module): r=[] try: oblist=module.__all__ except(AttributeError): return r for o in oblist: obj=module.__dict__[o] if isfunction(obj) or isroutine(obj): r.append(o) return r | 464,185 |
def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | defdocument_packages(packages):foriinpackages:import_string="import"+i+"asmodule"print"Documenting"+iexecimport_stringtry:oblist=module.__all__except(AttributeError):print"*****************************************************"print"Warning:Package"+i+"\n"+\"hasno__all__attributeinthe__init__.pyfile\n"+\"Thisisneededtok... | 464,186 |
def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | 464,187 |
def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | defprint " ",o document_packages(packages):print " ",o forprint " ",o iprint " ",o inprint " ",o packages:print " ",o import_stringprint " ",o =print " ",o "importprint " ",o "+i+"print " ",o asprint " ",o module"print " ",o printprint " ",o "Documentingprint " ",o "+iprint " ",o execprint " ",o import_stringprint " ",... | 464,188 |
def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | def document_packages(packages): for i in packages: import_string = "import "+i+" as module" print "Documenting "+i exec import_string try: oblist=module.__all__ except(AttributeError): print "*****************************************************" print "Warning: Package "+i+" \n"+\ "has no __all__ attribute in the _... | 464,189 |
def GScgh(z,target,reference=1.,iterations=20,error=None): ''' Gerber Saxton Algorithm for Fourier CGH Function that calculates Fourier holographic optical elements using the Gerber Saxton algorithm. The algorithm uses the FFT implementation of the Fraunhoffer Transform. **ARGUMENTS:** ========== ===================... | def GScgh(z,target,reference=1.,iterations=20,error=None): ''' Gerchberg - Saxton Algorithm for Fourier CGH Function that calculates Fourier holographic optical elements using the Gerber Saxton algorithm. The algorithm uses the FFT implementation of the Fraunhoffer Transform. **ARGUMENTS:** ========== ==============... | 464,190 |
def GScghFr(z,target,reference=1.,iterations=20,error=None): ''' Gerber Saxton Algorithm for Fresnel CGS Function that calculates a Fresnel holographic optical elements using the Gerber Saxton algorithm. The algorithm uses the FFT implementation of the Fresnel transform. .. note:: A Fresnel CGH can be interpreted as ... | def GScghFr(z,target,reference=1.,iterations=20,error=None): ''' Gerchberg - Saxton Algorithm for Fresnel CGS Function that calculates a Fresnel holographic optical elements using the Gerber Saxton algorithm. The algorithm uses the FFT implementation of the Fresnel transform. .. note:: A Fresnel CGH can be interprete... | 464,191 |
def evalm(self,x,y,mask=True): ''' Evaluate the zernike polynomial Method used to evaluate the zernike polynomial at the coordinates given by the 2D arrays x,y **ARGUMENTS** ==== ============================================================== x 2D array containing the X coordinates where the Zernike polynomial is ... | def evalm(self,x,y,mask=True): ''' Evaluate the zernike polynomialdef gpu_eval(self,x,y): retval=self.poly.gpu_eval(x,y) return retval Method used to evaluate the zernike polynomial at the coordinates given by the 2D arrays x,ydef gpu_eval(self,x,y): retval=self.poly.gpu_eval(x,y) return retval **ARGUMENTS**def gpu_eva... | 464,192 |
def test_export_ps(self): r''' >>> import sys >>> context = Context() >>> document = context.new_document(FileUri(images + 'test0.djvu')) >>> message = document.get_message() >>> type(message) == DocInfoMessage True >>> document.decoding_done True >>> document.decoding_error False >>> document.decoding_status == JobOK ... | def test_export_ps(self): r''' >>> import sys >>> context = Context() >>> document = context.new_document(FileUri(images + 'test0.djvu')) >>> message = document.get_message() >>> type(message) == DocInfoMessage True >>> document.decoding_done True >>> document.decoding_error False >>> document.decoding_status == JobOK ... | 464,193 |
def test_export_ps(self): r''' >>> import sys >>> context = Context() >>> document = context.new_document(FileUri(images + 'test0.djvu')) >>> message = document.get_message() >>> type(message) == DocInfoMessage True >>> document.decoding_done True >>> document.decoding_error False >>> document.decoding_status == JobOK ... | def test_export_ps(self): r''' >>> import sys >>> context = Context() >>> document = context.new_document(FileUri(images + 'test0.djvu')) >>> message = document.get_message() >>> type(message) == DocInfoMessage True >>> document.decoding_done True >>> document.decoding_error False >>> document.decoding_status == JobOK ... | 464,194 |
def cython_sources(self, ext): targets = {} deps = [] for source in ext.sources: assert source.endswith('.pyx') target = '%s.c' % source[:-4] yield target depends = [source, self.config_filename] + ext.depends if not (self.force or distutils.dep_util.newer_group(depends, target)): distutils.log.debug('not cythoning %r ... | def cython_sources(self, ext): targets = {} deps = [] for source in ext.sources: assert source.endswith('.pyx') target = '%s.c' % source[:-4] yield target depends = [source, self.config_filename] + ext.depends if not (self.force or distutils.dep_util.newer_group(depends, target)): distutils.log.debug('not cythoning %r ... | 464,195 |
def run(self): if self.all: for wildcard in 'djvu/*.c', 'djvu/config.pxi': filenames = glob.glob(wildcard) if filenames: distutils.log.info('removing %r', wildcard) if self.dry_run: continue for filename in glob.glob(wildcard): os.remove(filename) return distutils.command.clean.clean.run(self) | def run(self): if self.all: for wildcard in 'djvu/*.c', 'djvu/*.c~', 'djvu/config.pxi': filenames = glob.glob(wildcard) if filenames: distutils.log.info('removing %r', wildcard) if self.dry_run: continue for filename in glob.glob(wildcard): os.remove(filename) return distutils.command.clean.clean.run(self) | 464,196 |
def test_context_cache(): def set_cache_size(n): context.cache_size = n context = Context() assert_equal(context.cache_size, 10 << 20) for n in -100, 0, 1 << 31: with raises(ValueError, '0 < cache_size < (2 ** 31) must be satisfied'): set_cache_size(n) with raises(ValueError, '0 < cache_size < (2 ** 31) must be satis... | def test_context_cache(): context = Context() assert_equal(context.cache_size, 10 << 20) for n in -100, 0, 1 << 31: with raises(ValueError, '0 < cache_size < (2 ** 31) must be satisfied'): set_cache_size(n) with raises(ValueError, '0 < cache_size < (2 ** 31) must be satisfied'): set_cache_size(0) n = 1 while n < (1 << ... | 464,197 |
def set_cache_size(n): context.cache_size = n | def set_cache_size(n): context.cache_size = n | 464,198 |
def set_cache_size(n): context.cache_size = n | def set_cache_size(n): context.cache_size = n | 464,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.