rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.base.ts.scriptFd = self._writepipe.fileno() | self.base.ts.ts.scriptFd = self._writepipe.fileno() | 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... | 448635682b9febcd71b48e90036d4aca4b26411f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/448635682b9febcd71b48e90036d4aca4b26411f/rpmtrans.py |
to_unicode(str(problem)))) | uproblem)) | 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... | 2e86bc689b2f72b5393337fe78ca369bb1eeb7cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/2e86bc689b2f72b5393337fe78ca369bb1eeb7cf/history.py |
except plugins.PluginYumExit, e: self.logger.critical(_('PluginExit Error: %s'), e) sys.exit(1) | 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... | 8a53a25e575a94871b28c26cd5626a4e577d8215 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a53a25e575a94871b28c26cd5626a4e577d8215/utils.py | |
repo.populate(parser, section, self.conf) | try: repo.populate(parser, section, self.conf) except ValueError, e: msg = _('Repository %r: Error parsing config: %s' % (section,e)) raise Errors.ConfigError, msg | def readRepoConfig(self, parser, section): '''Parse an INI file section for a repository. | e5b628917ef11fb976b461db9ae076f5ac623be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e5b628917ef11fb976b461db9ae076f5ac623be3/__init__.py |
if not key_installed: raise Errors.YumBaseError, \ _('The GPG keys listed for the "%s" repository are ' \ 'already installed but they are not correct for this ' \ 'package.\n' \ 'Check that the correct key URLs are configured for ' \ 'this repository.') % (repo.name) | if not key_installed: raise Errors.YumBaseError, \ _('The GPG keys listed for the "%s" repository are ' \ 'already installed but they are not correct for this ' \ 'package.\n' \ 'Check that the correct key URLs are configured for ' \ 'this repository.') % (repo.name) | 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 ... | 64e0d8840b00a3d309b8348f5e69d33727b529d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/64e0d8840b00a3d309b8348f5e69d33727b529d1/__init__.py |
if not key_installed: raise Errors.YumBaseError, \ _('The GPG keys listed for the "%s" repository are ' \ 'already installed but they are not correct for this ' \ 'package.\n' \ 'Check that the correct key URLs are configured for ' \ 'this repository.') % (repo.name) | if not key_installed: raise Errors.YumBaseError, \ _('The GPG keys listed for the "%s" repository are ' \ 'already installed but they are not correct.\n' \ 'Check that the correct key URLs are configured for ' \ 'this repository.') % (repo.name) | 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. """... | 64e0d8840b00a3d309b8348f5e69d33727b529d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/64e0d8840b00a3d309b8348f5e69d33727b529d1/__init__.py |
print fmt % (utf8_width_fill(name, 22, 22), | print fmt % (utf8_width_fill(name, 26, 26), | def historySummaryCmd(self, extcmds): tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history info'] | 5579a905155a6be3171f6968a24e691bafcac40b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/5579a905155a6be3171f6968a24e691bafcac40b/output.py |
if self.ftype == 'symlnk' and vflags & _RPMVERIFY_LINKTO: | if self.ftype == 'symlink' and vflags & _RPMVERIFY_LINKTO: | def __init__(self, fi, filetuple, csum_type, override_vflags=False): YUMVerifyPackageFile.__init__(self, filetuple[0]) | ccd5ace46edb4bf5e37e24c8a743f4864847e39a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ccd5ace46edb4bf5e37e24c8a743f4864847e39a/packages.py |
self.basecmd = self.cmds[0] | if self.cmds: self.basecmd = self.cmds[0] else: self.basecmd = None | 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... | 8376ac0c3c3ec808b95242b1a1061eb5aa8b9fb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8376ac0c3c3ec808b95242b1a1061eb5aa8b9fb1/utils.py |
self.verbose_logger.log(yum.logginglevels.INFO_2, msg) | self.verbose_logger.log(yum.logginglevels.INFO_2, to_unicode(msg)) | 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: ')... | 7e418ff40a374215d52e53ec33412a23f3a26c50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/7e418ff40a374215d52e53ec33412a23f3a26c50/cli.py |
if needmode in ['ud', 'od']: | if needmode in ['ud']: self.verbose_logger.log(logginglevels.DEBUG_2, _('Trying to update %s to resolve dep'), requiringPo) origobs = self.conf.obsoletes self.conf.obsoletes = 0 txmbrs = self.update(po=requiringPo, requiringPo=requiringPo) self.conf.obsoletes = origobs if not txmbrs: txmbrs = self.update(po=requirin... | def _requiringFromInstalled(self, requiringPo, requirement, errorlist): """processes the dependency resolution for a dep where the requiring package is installed""" | c0124699e38151144ef72ab1be9d8c42510ce375 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/c0124699e38151144ef72ab1be9d8c42510ce375/depsolve.py |
txmbrs = self.matchNaevr(na[0], na[1]) | if len(na) == 2: txmbrs = self.matchNaevr(na[0], na[1]) | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 6526164c728cc28bd8d7b357768e0620dbc7a4fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/6526164c728cc28bd8d7b357768e0620dbc7a4fe/transactioninfo.py |
if self.pkgSack is not None: | if self.pkgSack is None: | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 6526164c728cc28bd8d7b357768e0620dbc7a4fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/6526164c728cc28bd8d7b357768e0620dbc7a4fe/transactioninfo.py |
pkgs = self.pkgSack.returnPackages(pattern) | pkgs = self.pkgSack.returnPackages(patterns=[pattern]) | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 6526164c728cc28bd8d7b357768e0620dbc7a4fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/6526164c728cc28bd8d7b357768e0620dbc7a4fe/transactioninfo.py |
pkgs = self.rpmdb.returnPackages(pattern) | pkgs = self.rpmdb.returnPackages(patterns=[pattern]) | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 6526164c728cc28bd8d7b357768e0620dbc7a4fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/6526164c728cc28bd8d7b357768e0620dbc7a4fe/transactioninfo.py |
msg = _('Package does not match intended download. Suggestion: run yum clean metadata') | msg = _('Package does not match intended download. Suggestion: run yum --enablerepo=%s clean metadata') % po.repo.id | 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 | 99cb2b49b5de22edf923863b36a0cfe5daae534f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/99cb2b49b5de22edf923863b36a0cfe5daae534f/__init__.py |
raise 'unknown public key packet version %d at %d' % (self.version, idx_save) | raise RuntimeError('unknown public key packet version %d at %d' % (self.version, idx_save)) | 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... | 5d7aa9157d2f53056609972b4318766aa186bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/5d7aa9157d2f53056609972b4318766aa186bfd1/pgpmsg.py |
raise "unknown public key algorithm %d at %d" % (self.pk_algo, idx_save) | raise RuntimeError("unknown public key algorithm %d at %d" % (self.pk_algo, idx_save)) | 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... | 5d7aa9157d2f53056609972b4318766aa186bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/5d7aa9157d2f53056609972b4318766aa186bfd1/pgpmsg.py |
raise 'unknown signature packet version %d at %d' % (self.version, idx) | raise RuntimeError('unknown signature packet version %d at %d' % (self.version, idx)) | 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... | 5d7aa9157d2f53056609972b4318766aa186bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/5d7aa9157d2f53056609972b4318766aa186bfd1/pgpmsg.py |
raise 'unknown public-key algorithm (%d) in signature at %d' % (self.pk_algo, idx) | raise RuntimeError('unknown public-key algorithm (%d) in signature at %d' % (self.pk_algo, idx)) | 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... | 5d7aa9157d2f53056609972b4318766aa186bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/5d7aa9157d2f53056609972b4318766aa186bfd1/pgpmsg.py |
thesecerts = decode_msg(block) | thesecerts = decode_msg(block, multi=True) | 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 ... | fd449dbb1030d725cca654de71542c3617577b86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/fd449dbb1030d725cca654de71542c3617577b86/pgpmsg.py |
if 'checksum_type' in yumdb and 'checksum_type' in yumdb: | if 'checksum_type' in yumdb and 'checksum_data' in yumdb: | 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) | e28e0a6ad8d1f8cb84f4f291e5f4c770e1b60bc5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e28e0a6ad8d1f8cb84f4f291e5f4c770e1b60bc5/history.py |
self.rpmdb.dropCachedData() | 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... | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py | |
if self.conf.history_record and not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): | if (not self.conf.history_record or self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST)): frpmdbv = self.tsInfo.futureRpmDBVersion() else: | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py |
self.rpmdb.transactionResultVersion(self.tsInfo.futureRpmDBVersion()) | self.rpmdb.transactionResultVersion(frpmdbv) | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py |
self.rpmdb.dropCachedData() | self.rpmdb.dropCachedDataPostTransaction(list(self.tsInfo)) | def runTransaction(self, cb): """takes an rpm callback object, performs the transaction""" | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py |
self.rpmdb.dropCachedData() | 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... | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py | |
self.history.end(self.rpmdb.simpleVersion(main_only=True)[0], ret) | self.history.end(rpmdbv, ret) | 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... | 8a3c10072407640724399f547ef60d6916db6b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/8a3c10072407640724399f547ef60d6916db6b93/__init__.py |
VALUES (?, ?)""", (self._tid, cmdline)) | VALUES (?, ?)""", (self._tid, to_unicode(cmdline))) | 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 | 7bd63b84d1202e06bc78c92d27fb7167707fa2af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/7bd63b84d1202e06bc78c92d27fb7167707fa2af/history.py |
shell=True, bufsize=-1, stdin=PIPE, | bufsize=-1, stdin=PIPE, | 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 "... | 3dffdd1a713865004921a99bca5fa78a32abad7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/3dffdd1a713865004921a99bca5fa78a32abad7e/packages.py |
my_csum = misc.checksum(csum_type, fp) | my_csum = tcsum | 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 "... | 3dffdd1a713865004921a99bca5fa78a32abad7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/3dffdd1a713865004921a99bca5fa78a32abad7e/packages.py |
for res in prob.res: | for res in prob.conflicts: | 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 =... | bc35eef42e9743d4df152b8c5dbbe875546f2b71 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/bc35eef42e9743d4df152b8c5dbbe875546f2b71/__init__.py |
''', | ''', | 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? | e6e624f7d57df8793e86c29e2e2e947dbb60c67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e6e624f7d57df8793e86c29e2e2e947dbb60c67e/history.py |
CREATE VIEW vtrans_prob_pkgs AS | CREATE VIEW vtrans_prob_pkgs2 AS | 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? | e6e624f7d57df8793e86c29e2e2e947dbb60c67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e6e624f7d57df8793e86c29e2e2e947dbb60c67e/history.py |
main, | main,problem,msg, | 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? | e6e624f7d57df8793e86c29e2e2e947dbb60c67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e6e624f7d57df8793e86c29e2e2e947dbb60c67e/history.py |
FROM (trans_prob_pkgs JOIN trans_rpmdb_problems USING(rpid)) JOIN pkgtups USING(pkgtupid) | FROM (SELECT * FROM trans_prob_pkgs,trans_rpmdb_problems WHERE trans_prob_pkgs.rpid=trans_rpmdb_problems.rpid) JOIN pkgtups USING(pkgtupid) | 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? | e6e624f7d57df8793e86c29e2e2e947dbb60c67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/e6e624f7d57df8793e86c29e2e2e947dbb60c67e/history.py |
results = self.update(requiringPo=requiringPo, name=pkg.name, epoch=pkg.epoch, version=pkg.version, rel=pkg.rel) | tresults = self.update(requiringPo=requiringPo, name=pkg.name, epoch=pkg.epoch, version=pkg.version, rel=pkg.rel) | 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... | a148eb3e854a7c170771b61b3d06f78e46c1e9ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/a148eb3e854a7c170771b61b3d06f78e46c1e9ce/depsolve.py |
self.yumdb = RPMDBAdditionalData(db_path=addldb_path) | version_path = os.path.normpath(cachedir + '/version') self.yumdb = RPMDBAdditionalData(db_path=addldb_path, version_path=version_path) | 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... | d68af7e711cdec200f3b7a8201eeea9ec3355006 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/d68af7e711cdec200f3b7a8201eeea9ec3355006/rpmsack.py |
def __init__(self, db_path='/var/lib/yum/yumdb'): | def __init__(self, db_path='/var/lib/yum/yumdb', version_path=None): | 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... | d68af7e711cdec200f3b7a8201eeea9ec3355006 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/d68af7e711cdec200f3b7a8201eeea9ec3355006/rpmsack.py |
else: result[po.pkgid] = po | else: result[po.pkgid] = po | def searchPrco(self, name, prcotype): | 1f714fa2f00b1d92fc5636e58cf9ad97fd638b03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/1f714fa2f00b1d92fc5636e58cf9ad97fd638b03/rpmsack.py |
ts = self.rpmdb.readOnlyTS() | 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 ... | 3e05536ef876fc761553b632495449fd96bb4b9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/3e05536ef876fc761553b632495449fd96bb4b9e/__init__.py | |
if arg == 'all': ehibeg = base.term.FG_COLOR['green'] + base.term.MODE['bold'] dhibeg = base.term.FG_COLOR['red'] hiend = base.term.MODE['normal'] else: ehibeg = '' dhibeg = '' hiend = '' | on_ehibeg = base.term.FG_COLOR['green'] + base.term.MODE['bold'] on_dhibeg = base.term.FG_COLOR['red'] on_hiend = base.term.MODE['normal'] | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
if arg != 'all': ui_enabled = '' ui_endis_wid = 0 | (ehibeg, dhibeg, hiend) = '', '', '' ui_enabled = '' ui_endis_wid = 0 ui_num = "" ui_excludes_num = '' force_show = False if arg == 'all' or repo.id in extcmds or repo.name in extcmds: force_show = True (ehibeg, dhibeg, hiend) = (on_ehibeg, on_dhibeg, on_hiend) | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
if arg == 'all': ui_enabled = ehibeg + _('enabled') + hiend + ": " ui_endis_wid = utf8_width(_('enabled')) + 2 num = len(repo.sack) tot_num += num ui_num = to_unicode(locale.format("%d", num, True)) | if arg == 'enabled': force_show = False elif arg == 'disabled' and not force_show: continue if force_show or verbose: ui_enabled = ehibeg + _('enabled') + hiend ui_endis_wid = utf8_width(_('enabled')) if not verbose: ui_enabled += ": " ui_endis_wid += 2 | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
ui_num = "" if (arg == 'all' or (arg == 'enabled' and enabled) or (arg == 'disabled' and not enabled)): | if True: | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
base.fmtKeyValFill(_("Repo-name : "), repo.name), base.fmtKeyValFill(_("Repo-status : "), ui_enabled)] | base.fmtKeyValFill(_("Repo-name : "), repo.name)] if force_show or extcmds: out += [base.fmtKeyValFill(_("Repo-status : "), ui_enabled)] | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
num = locale.format("%d", repo.metadata_expire, True) num = _("%s second(s) (last: %s)") % (misc.to_unicode(num), last) | num = _num2ui_num(repo.metadata_expire) num = _("%s second(s) (last: %s)") % (num, last) | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
ct_len = 0 | st_len = 0 | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
if ct_len < ui_endis_wid: ct_len = ui_endis_wid | if st_len < (ui_endis_wid + len(ui_num)): st_len = (ui_endis_wid + len(ui_num)) | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
elif utf8_width(_('status')) > ct_len + ui_len: | elif utf8_width(_('status')) > st_len: | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
left = base.term.columns - (id_len + ct_len + ui_len + 2) | left = base.term.columns - (id_len + st_len + 2) | 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 | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py |
return mysqldump_command ("-u%s %s%s --add-drop-table --default-character-set=utf8 %s" % (user, "-p" if password else "", password, 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 <> 'localhost' else "", db)) | 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)) | 79ef7a1880e122bd6db6fc218ec7bc58b60c4536 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4977/79ef7a1880e122bd6db6fc218ec7bc58b60c4536/dump.py |
return mysqldump_command ("--no-data --compact -u%s %s%s --default-character-set=utf8 %s" % (user, "-p" if password else "", password, 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 if host <> 'localhost' else "", db)) | 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)) | 79ef7a1880e122bd6db6fc218ec7bc58b60c4536 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4977/79ef7a1880e122bd6db6fc218ec7bc58b60c4536/dump.py |
(output, errors) = mysql_command ("-u%s %s%s --default-character-set=utf8 %s < %s" % (user, "-p" if password else "", password, db, tempfile)) | (output, errors) = mysql_command ("-u%s %s%s %s --default-character-set=utf8 %s < %s" % (user, "-p" if password else "", password, "-h"+host if host <> 'localhost' else "", db, tempfile)) | 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... | 79ef7a1880e122bd6db6fc218ec7bc58b60c4536 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4977/79ef7a1880e122bd6db6fc218ec7bc58b60c4536/dump.py |
self.old_restrictions = ["", "", "", "", "", "", "%d" % DEFAULT_MAP_WIDTH, default_font] | self.old_restrictions = ["", "", "", "", "", "", "", "%d" % DEFAULT_MAP_WIDTH, default_font] | def __init__(self, driver, title): default_restriction = 4 default_font = "Anonymous Pro,DejaVu Sans Mono,Consolas,Lucida Console,monospace 8" | cc55e2cca4392b29ddde285dc6e2dc6a747c509c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5325/cc55e2cca4392b29ddde285dc6e2dc6a747c509c/gfilemapper.py |
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... | 4d0494b98559b3cbdc06ecfb1a601bdd0c32fd58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/4d0494b98559b3cbdc06ecfb1a601bdd0c32fd58/bfe_edit_record.py | ||
'/record/edit/? | '/record/edit/?ln=%s | 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... | 4d0494b98559b3cbdc06ecfb1a601bdd0c32fd58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/4d0494b98559b3cbdc06ecfb1a601bdd0c32fd58/bfe_edit_record.py |
out += create_html_link(CFG_SITE_URL + '/record/' + str(bfo.recID) + '/edit/', urlargd={'ln': bfo.lang, 'recid': str(bfo.recID)}, link_label=_("Edit This Record"), linkattrd=linkattrd) | out += create_html_link(CFG_SITE_URL + '/record/edit/? {}, link_label=_("Edit This Record"), linkattrd=linkattrd) | 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... | cfba0cb3738ab0d6ee6a0985311759d0e0fe69f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/cfba0cb3738ab0d6ee6a0985311759d0e0fe69f3/bfe_edit_record.py |
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... | ad33b1113f0cb213932240c9d0115bf05c87b8e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/ad33b1113f0cb213932240c9d0115bf05c87b8e6/bibformat_utils.py | ||
if snippet: | if snippet and count < max_snippets: | 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... | ad33b1113f0cb213932240c9d0115bf05c87b8e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/ad33b1113f0cb213932240c9d0115bf05c87b8e6/bibformat_utils.py |
if nb_words_around == 0: break | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | ad33b1113f0cb213932240c9d0115bf05c87b8e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/ad33b1113f0cb213932240c9d0115bf05c87b8e6/bibformat_utils.py | |
if lower_case.startswith(str(p)): | if lower_case.startswith(str(p).lower()): | 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. | 3eb88945a00338c81481bc5b578d256ceb629795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/3eb88945a00338c81481bc5b578d256ceb629795/bibformat_utils.py |
out += "\n" | 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... | d937bc40807afc453d148b7e8ec9e0c2cf69f2e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/d937bc40807afc453d148b7e8ec9e0c2cf69f2e8/bibformat.py | |
The idea is to first produce big snippets with grep and narrow them | The idea is to first produce big snippets with grep and then narrow them using the cut_out_snippet function. | 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... | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py |
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... | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py | ||
small_snippet = cut_out_snippet(s, escaped_keywords, nb_words_around, \ words_left, right_boundary) words_left -= len(small_snippet.split()) result.append(small_snippet) | if words_left > 0: (small_snippets, words_left) = cut_out_snippet(s, escaped_keywords, \ nb_words_around, words_left, right_boundary) result += small_snippets | 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... | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py |
while nb_words_around * 2 + 1 > max_words: nb_words_around -= 1 if nb_words_around < 1: return "" | snippets = [] | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py |
while i < len(words): | while i < len(words) and max_words > 3: while nb_words_around * 2 + 1 > max_words: nb_words_around -= 1 if nb_words_around == 0: break | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py |
snippet = highlight_matches(snippet, compiled_pattern) snippet_words = snippet.split() length = len(snippet_words) if (length > max_words): j = 0 shorter_snippet = "" while j < max_words: shorter_snippet += " " + snippet_words[j] j += 1 return shorter_snippet else: return snippet | if snippet != "" and i < len(words) and not matches_any(words[i]): max_words -= len(snippet.split()) snippets.append(highlight_matches(snippet, compiled_pattern)) snippet = "" return (snippets, max_words) | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False | c6933875854b5132f61d7122e790af8a2d920137 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/c6933875854b5132f61d7122e790af8a2d920137/bibformat_utils.py |
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' """ | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
pattern = '|'.join(keywords) compiled_pattern = re.compile(pattern, re.IGNORECASE) | def replace_highlight(match): """ replace match.group() by prefix_tag + match.group() + suffix_tag""" return prefix_tag + match.group() + suffix_tag | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py | |
out = get_text_snippets(text_path, stemmed_patterns, nb_words_around, max_snippets) | out = get_text_snippets(text_path, stemmed_patterns, nb_words_around, max_snippets, False) | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets): | def get_text_snippets(textfile_path, patterns, nb_words_around, max_snippets, \ right_boundary = True): | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
%s | grep -i -A%s -B%s -m%s" | %s | grep -i -E -A%s -B%s -m%s" | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
for p in patterns: cmd += " -e %s" | for p in escaped_keywords: cmd += " -e \"(\\b|\\s)\"%s" if right_boundary: cmd += "\"(\\b|\\s)\"" | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
small_snippet = cut_out_snippet(s, patterns, nb_words_around, words_left) | small_snippet = cut_out_snippet(s, escaped_keywords, nb_words_around, \ words_left, right_boundary) | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
out += "..." + highlight(snippet, patterns) + "..." | out += "..." + snippet + "..." | 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... | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
def starts_with_any(word, patterns): ret = False lower_case = word.lower() for p in patterns: if lower_case.startswith(str(p).lower()): ret = True break return ret | def matches_any(w1): if compiled_pattern.search(' ' + w1 + ' '): return True else: return False if right_boundary: pattern = '(\\b|\\s)(' + '|'.join(patterns) + ')(\\b|\\s)' else: pattern = '(\\b|\\s)(' + '|'.join(patterns) + ')' compiled_pattern = re.compile(pattern, re.IGNORECASE | re.UNICODE) | 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. | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
if starts_with_any(words[i], patterns): | if matches_any(words[i]): | 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. | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
if starts_with_any(words[i+j], patterns): | if matches_any(words[i+j]): | 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. | 772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py |
url_params_dict = dict([part.split('=') for part in params.split('&')]) | url_params_dict = dict([part.split('=') for part in params.split('&') \ if len(part) == 2]) | 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... | 615a3806636b81f818bd07651ec47a501ccdca60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/615a3806636b81f818bd07651ec47a501ccdca60/bfe_fulltext.py |
print stemmed_patterns | 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... | 19c0872d142b718a35ec1a6d45d0382a2ee430fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/19c0872d142b718a35ec1a6d45d0382a2ee430fd/bibformat_utils.py | |
It uses the Gerber Saxton algorithm for Fraunhoffer propagation. | It uses the Gerchberg - 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.... | f5d10f29a3132a961d53b130e653397b89a87b6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/f5d10f29a3132a961d53b130e653397b89a87b6c/gs.py |
if err!=None and err<error: break | if error!=None and err<error: break | 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.... | 57752884fee44b2ecf21de948f1a409afb585825 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/57752884fee44b2ecf21de948f1a409afb585825/gs.py |
if err!=None and err<error: break | if error!=None and err<error: break | 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. ... | 57752884fee44b2ecf21de948f1a409afb585825 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/57752884fee44b2ecf21de948f1a409afb585825/gs.py |
if isfunction(obj): | if isfunction(obj) or isroutine(obj): | 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 | 6f430cebb03f0b3de3787c01ac40766c95f30c67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/6f430cebb03f0b3de3787c01ac40766c95f30c67/builder.py |
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 _... | 6f430cebb03f0b3de3787c01ac40766c95f30c67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/6f430cebb03f0b3de3787c01ac40766c95f30c67/builder.py | ||
if (len(line)-len(line1))<=ide and (line1.split(" ")[0]=="def" or line1.split(" ")[0]=="cdef"): | if (len(line)-len(line1))<=ide and (line1.split(" ")[0]=="def" or line1.split(" ")[0]=="cdef" or line1.split(" ")[0]=="cpdef"): | 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 _... | 6f430cebb03f0b3de3787c01ac40766c95f30c67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/6f430cebb03f0b3de3787c01ac40766c95f30c67/builder.py |
print " ",o | 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 _... | 6f430cebb03f0b3de3787c01ac40766c95f30c67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/6f430cebb03f0b3de3787c01ac40766c95f30c67/builder.py | |
if (line.split(" ")[0]=="def" or line.split(" ")[0]=="cpdef" ) and line.find(" _")==-1 and line.find(" class ")==-1 and line[0]=="d" and line.find(o)!=-1: | if (line.split(" ")[0]=="def" or line.split(" ")[0]=="cpdef" ) and line.find(" _")==-1 and line.find(" class ")==-1 and (line[0]=="d" or line[0]=="c") and line.find(o)!=-1: | 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 _... | 6f430cebb03f0b3de3787c01ac40766c95f30c67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/6f430cebb03f0b3de3787c01ac40766c95f30c67/builder.py |
Gerber Saxton Algorithm for Fourier CGH | Gerchberg - Saxton Algorithm for Fourier CGH | 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:** ========== ===================... | 37991c29a56f131b791facaf3ff95f35f08c374d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/37991c29a56f131b791facaf3ff95f35f08c374d/gs.py |
Gerber Saxton Algorithm for Fresnel CGS | Gerchberg - Saxton Algorithm for Fresnel CGS | 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 ... | 37991c29a56f131b791facaf3ff95f35f08c374d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/37991c29a56f131b791facaf3ff95f35f08c374d/gs.py |
def gpu_eval(self,x,y): retval=self.poly.gpu_eval(x,y) return retval | 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 ... | cb6b87a2cba39478b7dbb5d2cc65bcccf8a182d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3690/cb6b87a2cba39478b7dbb5d2cc65bcccf8a182d3/zernike.py | |
'\x0c\x0c\x0c\x0c\x0c' | '\x0c\x0c\x0c\x0c\x0c\x0c' | 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 ... | a5b414ff57299ad61e0d778428328973c5977cdf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/a5b414ff57299ad61e0d778428328973c5977cdf/decode.py |
' 3' | ' 3\x0c' | 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 ... | a5b414ff57299ad61e0d778428328973c5977cdf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/a5b414ff57299ad61e0d778428328973c5977cdf/decode.py |
self.make_file(depends, target, distutils.spawn.spawn, [['cython', source]]) | def build_c(source, target): distutils.spawn.spawn(['cython', source]) distutils.spawn.spawn(['sed', '-i~', '-e', r's/\(static int __Pyx_GetVtable(PyObject [*]dict, void [*]vtabptr) {\)/\1 return 0;/', target ]) self.make_file(depends, target, build_c, [source, target]) | 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 ... | e3cd2b2ebef76058995079722b15548b7fda0b27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/e3cd2b2ebef76058995079722b15548b7fda0b27/setup.py |
for wildcard in 'djvu/*.c', 'djvu/config.pxi': | for wildcard in 'djvu/*.c', 'djvu/*.c~', 'djvu/config.pxi': | 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) | e3cd2b2ebef76058995079722b15548b7fda0b27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/e3cd2b2ebef76058995079722b15548b7fda0b27/setup.py |
def set_cache_size(n): context.cache_size = n | 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... | 23f269a2a35d4ee23c1812127248add0d9faca4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/23f269a2a35d4ee23c1812127248add0d9faca4b/decode.py | |
set_cache_size(n) | context.cache_size = n | def set_cache_size(n): context.cache_size = n | 23f269a2a35d4ee23c1812127248add0d9faca4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/23f269a2a35d4ee23c1812127248add0d9faca4b/decode.py |
set_cache_size(0) | context.cache_size = 0 | def set_cache_size(n): context.cache_size = n | 23f269a2a35d4ee23c1812127248add0d9faca4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3681/23f269a2a35d4ee23c1812127248add0d9faca4b/decode.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.