rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
ext_modules = [ python_c_extension ], | ext_modules = ext_module_list, | def MakeTestSuite(): # This is apparently needed on some systems to make sure that the tests # work even if a previous version is already installed. if 'google' in sys.modules: del sys.modules['google'] generate_proto("../src/google/protobuf/unittest.proto") generate_proto("../src/google/protobuf/unittest_custom_optio... | 514bdbee452fcb1c53274f7a00c0d18bf63e19d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10745/514bdbee452fcb1c53274f7a00c0d18bf63e19d1/setup.py |
sub_message.SetInParent() | sub_message.SetInParent() | def _MergeField(tokenizer, message): """Merges a single protocol message field into a message. Args: tokenizer: A tokenizer to parse the field name and values. message: A protocol message to record the data. Raises: ParseError: In case of ASCII parsing problems. """ message_descriptor = message.DESCRIPTOR if tokenize... | 949e5f8b62bdd7cf8dbfc47dfeb690d77a004e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10745/949e5f8b62bdd7cf8dbfc47dfeb690d77a004e86/text_format.py |
raise Error("stock link to non-directory `%s'" % stock.link) | raise Error("stock link to non-directory `%s'" % self.link) | def __init__(self, path): self.paths = self.Paths(path) self.name = basename(path) self.link = os.readlink(self.paths.link) if not isdir(self.link): raise Error("stock link to non-directory `%s'" % stock.link) | 7c2270a9fca5033c90d8f26578bcdfbbc513dbd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/7c2270a9fca5033c90d8f26578bcdfbbc513dbd4/pool.py |
def _read_versions(self): | def _init_read_versions(self): | def _read_versions(self): source_versions = {} for dpath, dnames, fnames in os.walk(self.paths.source_versions): relative_path = make_relative(self.paths.source_versions, dpath) for fname in fnames: fpath = join(dpath, fname) versions = [ line.strip() for line in file(fpath).readlines() if line.strip() ] source_version... | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
def _get_workdir(self): | def _init_get_workdir(self): | def _get_workdir(self): """Return an initialized workdir path. | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
self.source_versions = self._read_versions() self.workdir = self._get_workdir() | self.source_versions = self._init_read_versions() self.workdir = self._init_get_workdir() | def __init__(self, path, pkgcache): self.paths = StockPaths(path) self.name = basename(path) self.branch = None if "#" in self.name: self.branch = self.name.split("#")[1] | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
for binary in self.stocks.get_binaries(): if self.pkgcache.exists(basename(binary)): continue self.pkgcache.add(binary) def _get_source_path(self, package): name, version = parse_package_id(package) for source_path, source_version in self.stocks.get_sources(): if basename(source_path) == name: source_path = dirname(s... | self.stocks.sync() | def _sync(self): """synchronise pool with registered stocks""" for binary in self.stocks.get_binaries(): if self.pkgcache.exists(basename(binary)): continue | 958adc137a35a06ef8cd53f5768ff130640959bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/958adc137a35a06ef8cd53f5768ff130640959bb/pool.py |
if self._get_source_path(package): | if self.stocks.exists_source_version(*parse_package_id(package)): | def exists(self, package): """Check if package exists in pool -> Returns bool""" if self.pkgcache.exists(package): return True | 958adc137a35a06ef8cd53f5768ff130640959bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/958adc137a35a06ef8cd53f5768ff130640959bb/pool.py |
self.packagelist.add(name) | if name in self.namerefs: self.namerefs[name] += 1 else: self.namerefs[name] = 1 | def _register(self, filename): name, version = self._parse_filename(filename) self.filenames[(name, version)] = filename self.packagelist.add(name) | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
self.packagelist.remove(name) | self.namerefs[name] -= 1 if not self.namerefs[name]: del self.namerefs[name] | def _unregister(self, name, version): del self.filenames[(name, version)] self.packagelist.remove(name) | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
self.packagelist = set() | self.namerefs = {} | def __init__(self, path): self.path = path | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
if name in self.packagelist: | if name in self.namerefs: | def exists(self, name, version=None): """Returns True if package exists in cache. | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
packages |= set([ (basename(path), version) for path, version in self.stocks.get_sources() ]) | for stock, path, versions in self.stocks.get_source_versions(): package = basename(path) packages |= set([ (package, version) for version in versions ]) | def list(self, all_versions=False): """List packages in pool -> list of (name, version) tuples. | 3a9a15f86b0b640914c7d96efa3fb992e53dc72b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/3a9a15f86b0b640914c7d96efa3fb992e53dc72b/pool.py |
if not islink(fname) and isfile(fname) and fname.endswith(".deb"): binaries.append(join(dirpath, fname)) | fpath = join(dirpath, fname) if not islink(fpath) and isfile(fpath) and fname.endswith(".deb"): binaries.append(fpath) | def get_binaries(self): """Recursively scan stocks for binaries -> list of filename""" | f8a11cd3c435a22b9f228acd50f0aa30a575178c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/f8a11cd3c435a22b9f228acd50f0aa30a575178c/pool.py |
def _lexcmp(a, b): i = 0 while True: if len(a) == len(b): if i == len(a): return 0 else: if i == len(a): return -1 if i == len(b): return 1 if a[i].isalpha(): if not b[i].isalpha(): return -1 if b[i].isalpha(): if not a[i].isalpha(): return 1 val = cmp(a[i], b[i]) if val != 0: return val i += 1 | def getnum(self): str = self.str i = 0 for c in str: if c not in '0123456789': break i += 1 | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py | |
val = cmp(l1, l2) | val = _lexcmp(l1, l2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val if p1.str == p2.str: return 0 | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py |
val = cmp(l1, l2) | val = _lexcmp(l1, l2) | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse lexical components i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: ... | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py |
files = StockBase.Paths.files + \ [ 'source-versions', 'SYNC_HEAD', 'checkout' ] | files = [ 'source-versions', 'SYNC_HEAD', 'checkout' ] | def __init__(self, path, recursed_paths=[]): StockBase.__init__(self, path) if self.link in recursed_paths: raise CircularDependency("circular dependency detected `%s' is in recursed paths %s" % (self.link, recursed_paths)) | 8bc3da5dd19d4b325963f509371ba23b60a5442c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/8bc3da5dd19d4b325963f509371ba23b60a5442c/pool.py |
path = join(path, ".git") command = "git --git-dir %s init" % commands.mkarg(path) | init_path = join(init_path, ".git") command = "git --git-dir %s init" % commands.mkarg(init_path) | def init_create(cls, path, bare=False, verbose=False): if not lexists(path): os.mkdir(path) | 1369eb129a26d558fcada22040a4b474703d785c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/1369eb129a26d558fcada22040a4b474703d785c/git.py |
return dir, branch | return realpath(dir), branch | def _parse_stock(stock): try: dir, branch = stock.split("#", 1) except ValueError: dir = stock branch = None | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): | matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): raise Error("no matches for unregister") | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
shutil.rmtree(self.stocks[stock_name].path) del self.stocks[stock_name] | if len(matches) > 1: raise Error("multiple implicit matches for unregister") stock = matches[0] shutil.rmtree(stock.path) del self.stocks[stock.name] | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): raise Error("no matches for unregister") | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) | def pkgcache_list_versions(pool, name): versions = [ pkgcache_version for pkgcache_name, pkgcache_version in pool.pkgcache.list() if pkgcache_name == name ] for subpool in pool.subpools: versions += pkgcache_list_versions(subpool, name) return versions def pkgcache_getpath_newest(pool, name): versions = pkgcache_lis... | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path | source_package = binary2source(pool, package) if source_package: path = pool.getpath_build_log(source_package) | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
return None | if not path: package_desc = `package` if source_package: package_desc += " (%s)" % source_package fatal("no build log for " + package_desc) return path | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
try: p = pool.Pool() except pool.Error, e: fatal(e) | path = getpath_build_log(package) | def main(): args = sys.argv[1:] if not args: usage() package = args[0] try: p = pool.Pool() except pool.Error, e: fatal(e) source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + p... | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package... | def main(): args = sys.argv[1:] if not args: usage() package = args[0] try: p = pool.Pool() except pool.Error, e: fatal(e) source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + p... | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py | |
if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val | 0df2259a0dae6973e1da3091d1f374dc26f8deb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/0df2259a0dae6973e1da3091d1f374dc26f8deb6/debversion.py | |
epoch = 0 | epoch = '' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = 0 if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 395732e683f0283bdaeb11dd1afb787a931240ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/395732e683f0283bdaeb11dd1afb787a931240ef/debversion.py |
class VersionParser: def __init__(self, str): self.str = str def getlex(self): lex = re.match(r'(\D*)', self.str).group(1) self.str = self.str[len(lex):] return lex def getnum(self): num = re.match(r'(\d*)', self.str).group(1) self.str = self.str[len(num):] if num: return int(num) return 0 def _compare(s1, s2): ... | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = 0 if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 395732e683f0283bdaeb11dd1afb787a931240ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/395732e683f0283bdaeb11dd1afb787a931240ef/debversion.py | |
epoch = '' | epoch = '0' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = '' if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
debian_revision = '' | debian_revision = '0' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = '' if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
a = parse(normalize(a)) b = parse(normalize(b)) | a = parse(a) b = parse(b) | def compare(a, b): """Compare a with b according to Debian versioning criteria""" a = parse(normalize(a)) b = parse(normalize(b)) for i in (0, 1, 2): val = _compare(a[i], b[i]) if val != 0: return val return 0 | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
val = _compare(a[i], b[i]) | val = _compare_flat(a[i], b[i]) | def compare(a, b): """Compare a with b according to Debian versioning criteria""" a = parse(normalize(a)) b = parse(normalize(b)) for i in (0, 1, 2): val = _compare(a[i], b[i]) if val != 0: return val return 0 | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
howmany = 1000 | howmany = 10000 | def test(): import time howmany = 1000 start = time.time() for i in xrange(howmany): compare("0-2010.10.1-d6cbb928", "0-2010.10.10-a9ee521c") end = time.time() elapsed = end - start print "%d runs in %.4f seconds (%.2f per/sec)" % (howmany, elapsed, howmany / elapsed) | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
packages = dict(self._list()) | packages = dict(self._list(all_versions=False)) | def resolve(self, unresolved): """Resolve a list of unresolved packages. If unresolved is a single unresolved package, return a single resolved package. If unresolved is a tuple or list of unresolved packages, return a list of resolved packages""" | 55ea724bfc462ec257e843569bdd5882202b0eef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/55ea724bfc462ec257e843569bdd5882202b0eef/pool.py |
if val != 0: return val l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val if p1.str == p2.str: return 0 | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py | |
i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: return val | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse numeric component for comparison i = 0 for c in s1: if c not in '0123456789': break i += 1 if i: n1 = int(s1[:i]) s1 = s1[i:] else: n1 = 0 i = 0 for c in s2: if c not in '0123456789': break i += 1 if i: n2 = int(s2[:i]) s2 = s2[i:] else: n2 = 0 ... | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py | |
if val != 0: return val i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse numeric component for comparison i = 0 for c in s1: if c not in '0123456789': break i += 1 if i: n1 = int(s1[:i]) s1 = s1[i:] else: n1 = 0 i = 0 for c in s2: if c not in '0123456789': break i += 1 if i: n2 = int(s2[:i]) s2 = s2[i:] else: n2 = 0 ... | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py | |
if not packages and not input: | if not args[1:] and not input: | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'i:sqt', ['input=', 'strict', 'quiet', 'tree']) except getopt.GetoptError, e: usage(e) if not args: usage() outputdir = args[0] packages = args[1:] input = None opt_strict = False opt_quiet = False opt_tree = False for opt, val in opts: if opt in ('-i', '--i... | d33ab6df2a62bde457c03aacc0aff06baa2ce0c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/d33ab6df2a62bde457c03aacc0aff06baa2ce0c8/cmd_get.py |
packages.sort(reverse=True) | def _cmp(a, b): val = cmp(b[0], a[0]) if val != 0: return val return debversion.compare(a[1], b[1]) packages.sort(cmp=_cmp, reverse=True) | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'an', ['all-versions', 'name-only']) except getopt.GetoptError, e: usage(e) opt_all_versions = False opt_name_only = False for opt, val in opts: if opt in ('-a', '--all-versions'): opt_all_versions = True elif opt in ('-n', '--name-only'): opt_name_only = True... | dff2e02dc21266e3313b06564e052f15180bea32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/dff2e02dc21266e3313b06564e052f15180bea32/cmd_list.py |
paths = self.Paths(path) | paths = cls.Paths(path) | def create(cls, path, link): mkdir(path) paths = self.Paths(path) os.symlink(realpath(link), paths.link) | abe1e191badf44c3949a18d7b7b9b4bd7d43cc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/abe1e191badf44c3949a18d7b7b9b4bd7d43cc5d/pool.py |
if self.branch: relative_path = make_relative(self.paths.checkout, dir) else: relative_path = make_relative(self.link, dir) | relative_path = make_relative(self.workdir, dir) | def _sync_update_source_versions(self, dir): """update versions for a particular source package at <dir>""" packages = deb_get_packages(dir) versions = verseek.list(dir) | bec42009e0647f314e2da7e1465d6d8342ac582a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/bec42009e0647f314e2da7e1465d6d8342ac582a/pool.py |
self.head = Git(self.workdir).rev_parse("HEAD") | self.head = Git(self.paths.checkout).rev_parse("HEAD") | def sync(self): """sync stock by updating source versions and importing binaries into the cache""" | bec42009e0647f314e2da7e1465d6d8342ac582a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/bec42009e0647f314e2da7e1465d6d8342ac582a/pool.py |
for subpool in subpools: | for subpool in self.subpools: | def print_info(self): if len(self.stocks): print "# stocks" for stock in self.stocks: addr = stock.link if stock.branch: addr += "#" + stock.branch print addr | 4588c70e3e5137403c9b806ad500cfc57d020d43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/4588c70e3e5137403c9b806ad500cfc57d020d43/pool.py |
checkout_path = stock.paths.checkout if exists(join(checkout_path, "arena.internals")): command = "cd %s && sumo-close" % commands.mkarg(checkout_path) error = os.system(command) if error: raise Error("failed command: " + command) shutil.rmtree(stock.paths.path) | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: raise Error("no matches for unregister") | 6d8e479ce6858e29690ba17f229cbe7addab6e2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/6d8e479ce6858e29690ba17f229cbe7addab6e2f/pool.py | |
if stock.name in self.subpools: | if isinstance(stock, StockPool): | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: raise Error("no matches for unregister") | 6d8e479ce6858e29690ba17f229cbe7addab6e2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/6d8e479ce6858e29690ba17f229cbe7addab6e2f/pool.py |
for name, version in self.pkgcache.list(): packages.add((name, version)) else: newest = {} for name, version in self.pkgcache.list(): if not newest.has_key(name) or newest[name] < version: newest[name] = version for name, version in newest.items(): packages.add((name, version)) return list(packages) | return list(packages) newest = {} for name, version in packages: if not newest.has_key(name) or newest[name] < version: newest[name] = version return newest.items() | def list(self, all_versions=False): """List packages in pool -> list of (name, version) tuples. | da33187959271d3ae9063826d7adcbf11af74502 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/da33187959271d3ae9063826d7adcbf11af74502/pool.py |
commit = orig.rev_parse(self.branch) if not commit: raise Error("no such branch `%s' at %s" % (self.branch, self.link)) checkout.update_ref("refs/heads/" + self.branch, commit) | def dup_branch(branch): commit = orig.rev_parse(branch) if not commit: raise Error("no such branch `%s' at %s" % (branch, self.link)) checkout.update_ref("refs/heads/" + branch, commit) dup_branch(self.branch) | def _get_workdir(self): """Return an initialized workdir path. | e76f0c20c7871164ce3eda2068025d12bac717e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e76f0c20c7871164ce3eda2068025d12bac717e5/pool.py |
return self._getoutput("git-rev-parse", rev + "^0") | return self._getoutput("git-rev-parse", rev) | def rev_parse(self, rev): """git-rev-parse <rev>. Returns object-id of parsed rev. Returns None on failure. """ try: return self._getoutput("git-rev-parse", rev + "^0") except self.Error: return None | 35cb41c357f784dd4ac68556b88a232462d1c7e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/35cb41c357f784dd4ac68556b88a232462d1c7e4/git.py |
_require_integer_or_float(timeout) | if timeout is not None: _require_integer_or_float(timeout) | def allow_args_openconn(desthost, destport, localip=None, localport=0, timeout=5): # TODO: the wiki:RepyLibrary gives localport=0 as the default for this function, # slightly different than the localport=None it gives for sendmess(). This # should either be verified as intentional or made the same. _require_string(des... | 915e45e4faccdaaf7dfa40921f8ef3ca63e59f80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/915e45e4faccdaaf7dfa40921f8ef3ca63e59f80/namespace.py |
exitall() | if mycontext['winner'] == None: mycontext['winner'] = 'timer' | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
settimer(.5, foo, ()) | if callfunc == 'initialize': | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
for num in range(50): randomfloat() print "This should be reached when there aren't time restrictions" | for attempt in range(3): sleep(1) mycontext['winner'] = None settimer(.5, foo, ()) for num in range(50): randomfloat() sleep(.00001) if mycontext['winner'] == None: print "This should be reached when there aren't time restrictions" while mycontext['winner'] == None: sleep(.2) | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
test_single(file_path) | if not file_path.startswith('ut_') or len(file_path.split('_'))<3: print "Error, cannot determine module name from filename '"+file_path+"'" return else: module_name = file_path.split('_')[1] files_to_use = [file_path] module_file_list = filter_files(valid_files, module = module_name) files_to_use = files_to_use ... | def main(): """ <Purpose> Executes the main program that is the unit testing framework. Tests different modules, files, capabilities, dependent on command line arguments. <Arguments> None <Exceptions> None. <Side Effects> None <Returns> None """ ### ### Define allowed arguments. ### parser = optparse.OptionParser()... | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
def test_single(file_path): """ <Purpose> Given the test file path, this function will execute the test using the test framework. | def execute_and_check_program(file_path): """ <Purpose> Given the test file path, this function will execute the program and monitor its behavior | def test_single(file_path): """ <Purpose> Given the test file path, this function will execute the test using the test framework. <Arguments> Test file path. <Exceptions> None. <Side Effects> None <Returns> None """ file_path = os.path.normpath(file_path) testing_monitor(file_path) | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(setup_file) | execute_and_check_program(setup_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by mod... | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(test_file) | execute_and_check_program(test_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by mod... | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(shutdown_file) | execute_and_check_program(shutdown_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by mod... | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
guid=PyRSS2Gen.Guid(config.TESTLOG_URL + datestr.replace(' ', '_')), | guid=PyRSS2Gen.Guid(config.TESTLOG_URL + str(runnumber)), | def _create_rss_file(resultslist): failureitems = [] for (runnumber, revision, resulttext) in resultslist: if resulttext[0].strip() != "SUCCESS": datestr = resulttext[1].strip() dateobj = datetime.datetime.strptime(datestr, "%Y-%m-%d %H:%M:%S") # The PyRSS2Gen module expects this to be in GMT, and python is a pain # f... | 66108cc2e075c51bfa10cdc1724901a2d869e77b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/66108cc2e075c51bfa10cdc1724901a2d869e77b/run_all_tests.py |
tcp_time_updatetime(12345) times.append(time_gettime()) | connected_server = tcp_time_updatetime(12345) current_time = time_gettime() times.append(current_time) server_list.append(connected_server) integrationtestlib.log("Calling time_gettime(). Retrieved time: " + str(current_time)) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("lekimbrel@gmail.com") integrationtestlib.log("Starting tes... | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("lekimbrel@gmail.com") integrationtestlib.log("Starting tes... | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py | ||
notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' | notify_str += "failed to get ntp time via tcp at least twice in 5 attempts\n\n" notify_str += "Appending a list of all the exceptions returned and servers we attempted to connect to:\n\n" notify_str += str(exception_string_list) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("lekimbrel@gmail.com") integrationtestlib.log("Starting tes... | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) | test_diff = test_stop1 - test_start if math.fabs(diff - test_diff) > 10: fail_test_str += ' WARNING large descrepancy between tcp times. \nThe difference between tcp_time diff and the actual test diff is: '+str(diff - test_diff) fail_test_str += "\n\nThe start time of test was: " + str(test_start) + ". The end time o... | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("lekimbrel@gmail.com") integrationtestlib.log("Starting tes... | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
fail_test(str(e)) | integrationtestlib.log("Failed to call ntp_time_updatetime(). Returned with exception: " +str(e)) notify_str += "\nFailed to call ntp_time_updatetime(). Returned with exception: " +str(e) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("lekimbrel@gmail.com") integrationtestlib.log("Starting tes... | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
if not os.path.isdir(os.path.dirname(generatedfilename)): | if os.path.dirname(generatedfilename) != '' and not os.path.isdir(os.path.dirname(generatedfilename)): | def _generate_python_file_from_repy(repyfilename, generatedfilename, shared_mycontext, callfunc, callargs): """ Generate a python module from a repy file so it can be imported The first line is TRANSLATION_TAGLINE, so it's easy to detect that the file was automatically generated """ #Start the generation! Print out t... | f349a69738f908d819d2da61f3429758e778a150 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/f349a69738f908d819d2da61f3429758e778a150/repyhelper.py |
acceptor_state['lock'].acquire() result = acceptor_state['started'] acceptor_state['lock'].release() | accepter_state['lock'].acquire() result = accepter_state['started'] accepter_state['lock'].release() | def is_accepter_started(): acceptor_state['lock'].acquire() result = acceptor_state['started'] acceptor_state['lock'].release() return result | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
if is_accepter_started(): | if not node_reset_config['reset_accepter'] and is_accepter_started(): | def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return... | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return... | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py | ||
acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() | accepter_state['lock'].acquire() accepter_state['started']= True accepter_state['lock'].release() | def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return... | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Anothe... | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py | ||
def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Anothe... | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py | ||
if mycontext['maxlag'] > 4: | if mycontext['maxlag'] > 2: | def check_and_exit(): if mycontext['maxlag'] > 4: print "UDP packets lag too long in the buffer: ", mycontext['maxlag'] if mycontext['maxlag'] == 0: print "UDP packets were not received or had 0 lag" exitall() | de4a8f088d7b017fa9dbb51eaf728048f32fed07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/de4a8f088d7b017fa9dbb51eaf728048f32fed07/ut_repytests_testudpbuffersize.py |
sockobj.send("%9f "%getruntime()) | sockobj.send("%9f "%getruntime() + " "*90) | def sendforever(sockobj): while True: # send a message that is around 100 bytes sockobj.send("%9f "%getruntime()) | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
sendtime = float(connobj.recv(10).split()[0]) | sendtime = float(connobj.recv(100).strip().split()[0]) | def handleconnection(ip, port, connobj, ch, mainch): while True: sendtime = float(connobj.recv(10).split()[0]) lag = getruntime() - sendtime if mycontext['maxlag'] < lag: mycontext['maxlag'] = lag | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
if mycontext['maxlag'] > 4: | if mycontext['maxlag'] > 2: | def check_and_exit(): if mycontext['maxlag'] > 4: print "TCP packets lag too long in the buffer: ", mycontext['maxlag'] if mycontext['maxlag'] == 0: print "TCP packets were not received or had 0 lag" exitall() | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
copy_to_target("production_nat_new/src/nmpatch/nmmain.py", target_dir) copy_to_target("production_nat_new/src/nmpatch/nmclient.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/ShimStackInterface.repy", target_dir) | def main(): repytest = False RANDOMPORTS = False target_dir = None for arg in sys.argv[1:]: # -t means we will copy repy tests if arg == '-t': repytest = True # The user wants us to fill in the port numbers randomly. elif arg == '-randomports': RANDOMPORTS = True # Not a flag? Assume it's the target directory else: ... | 18f2df8a7db9cf2f36003cd18801ab306ca077dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/18f2df8a7db9cf2f36003cd18801ab306ca077dd/preparetest.py | |
def start_vessel(vesselhandle, identity, program_file, arg_list=[]): | def start_vessel(vesselhandle, identity, program_file, arg_list=None): | def start_vessel(vesselhandle, identity, program_file, arg_list=[]): """ <Purpose> Start a program running on a vessel. <Arguments> vesselhandle The vesselhandle of the vessel that is to be started. identity The identity of either the owner or a user of the vessel. program_file The name of the file that already exists ... | d8dfc51fa9873871f273631cac4fa1d828cbb7cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/d8dfc51fa9873871f273631cac4fa1d828cbb7cf/experimentlib.py |
arg_list.insert(0, program_file) arg_string = " ".join(arg_list) | arg_string = program_file if arg_list is not None: arg_string += " " + " ".join(arg_list) | def start_vessel(vesselhandle, identity, program_file, arg_list=[]): """ <Purpose> Start a program running on a vessel. <Arguments> vesselhandle The vesselhandle of the vessel that is to be started. identity The identity of either the owner or a user of the vessel. program_file The name of the file that already exists ... | d8dfc51fa9873871f273631cac4fa1d828cbb7cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/d8dfc51fa9873871f273631cac4fa1d828cbb7cf/experimentlib.py |
raise UserError("There is an error in autosave: '" + str(error) + "'. You can turn off autosave using the command 'set autosave off'.") | raise seash_exceptions.UserError("There is an error in autosave: '" + str(error) + "'. You can turn off autosave using the command 'set autosave off'.") | def command_loop(): # Things that may be set herein and used in later commands. # Contains the local variables of the original command loop. # Keeps track of the user's state in seash. Referenced # during command executions by the command_parser. environment_dict = { 'host': None, 'port': None, 'expnum': None, 'filena... | b558d0ab07364df0135677f61e50ddecbe3cf72f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/b558d0ab07364df0135677f61e50ddecbe3cf72f/seash.py |
def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by mod... | 62d38796680cf39be37739fcad4ef8a8118404d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/62d38796680cf39be37739fcad4ef8a8118404d5/utf.py | ||
time.sleep(10) | time.sleep(30) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by mod... | 62d38796680cf39be37739fcad4ef8a8118404d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/62d38796680cf39be37739fcad4ef8a8118404d5/utf.py |
msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON | msg = "[" + vessel['nodelocation'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Setting user keys.") | print("[" + vessel['nodelocation'] + "] Setting user keys.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) | experimentlib.set_vessel_users(vessel['vesselhandle'], identity, USERKEY_LIST) | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
msg = "[" + vessel['location'] + "] Failure: " + str(e) | msg = "[" + vessel['nodelocation'] + "] Failure: " + str(e) | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Success.") | print("[" + vessel['nodelocation'] + "] Success.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Already had correct user keys.") | print("[" + vessel['nodelocation'] + "] Already had correct user keys.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME... | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
if not first_line.startswith(TRANSLATION_TAGLINE): | if not first_line.startswith(ENCODING_STRING) or not second_line.startswith(TRANSLATION_TAGLINE): | def _translation_is_needed(repyfilename, generatedfile): """ Checks if generatedfile needs to be regenerated. Does several checks to decide if generating generatedfilename based on repyfilename is a good idea. --does file already exist? --was it automatically generated? --was it generated from the same source file? --w... | 35fbd126b7c8696094436868629efcaa038e96c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/35fbd126b7c8696094436868629efcaa038e96c4/repyhelper.py |
data, addr = entry['socket'].recvfrom(4096) | data, addr = entry['socket'].recvfrom(65535) | def start_event(entry, handle,eventhandle): if entry['type'] == 'UDP': # some sort of socket error, I'll assume they closed the socket or it's # not important try: # NOTE: is 4096 a reasonable maximum datagram size? data, addr = entry['socket'].recvfrom(4096) except socket.error: # they closed in the meantime? nanny.ta... | 0279ec85664b99b804cb9d07743d989c315efe82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/0279ec85664b99b804cb9d07743d989c315efe82/emulcomm.py |
raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) | if not first_line.startswith(TRANSLATION_TAGLINE): raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) | def _translation_is_needed(repyfilename, generatedfile): """ Checks if generatedfile needs to be regenerated. Does several checks to decide if generating generatedfilename based on repyfilename is a good idea. --does file already exist? --was it automatically generated? --was it generated from the same source file? --w... | 5af41b878021bad0493a6dee230567cab8fc3f01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/5af41b878021bad0493a6dee230567cab8fc3f01/repyhelper.py |
actual_time = after_stop_event[1] - before_stop_event[1] diff_time = actual_time - expected_time | api_start = before_stop_event[1] api_end = after_stop_event[1] actual_time = api_end - api_start all_stops = get_stoptimes_on_interval(api_start, api_end) all_stoptimes = 0 for stop in all_stops: TOS, stop_amount = stop all_stoptimes += stop_amount | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
if diff_time > amount: commit_time(thread_dict, TOC) thread_dict["begin"] = resume_time thread_dict["stopped"] += amount | if all_stoptimes > expected_time: if all_stops[0][0] == TOC: resource_time = max(expected_time, actual_time - all_stoptimes) thread_dict[thread_dict["resource"]] += resource_time thread_dict["begin"] = api_end thread_dict["stopped"] += actual_time - resource_time | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
if thread != ALL_THREADS: for type in TIME_UTIL_KEYS: total_time[type] += thread_dict[type] | if thread_dict is total_time: continue for type in TIME_UTIL_KEYS: total_time[type] += thread_dict[type] | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
def exec_repy_script(filename, restrictionsfile, arguments={}, script_args=''): | def exec_repy_script(filename, restrictionsfile, arguments=None, script_args=''): | def exec_repy_script(filename, restrictionsfile, arguments={}, script_args=''): global mobileNoSubprocess if script_args != '': script_args = ' ' + script_args if not mobileNoSubprocess: # Convert arguments arg_string = arguments_to_string(arguments) return exec_command('python repy.py ' + arg_string + restrictionsf... | 29a657b3e3f44dc0b8b0304f8a11227e53da1438 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/29a657b3e3f44dc0b8b0304f8a11227e53da1438/run_tests.py |
if platform.machine().startswith('armv'): _output('Seattle is being installed on a Nokia N800/900 Internet Tablet.') import pwd if pwd.getpwuid(os.getuid())[0] != 'root': _output('Please run the installer as root. This can be done by ' \ + 'installing/using the rootsh or openssh package.') return continue_inst... | def main(): if OS not in SUPPORTED_OSES: raise UnsupportedOSError("This operating system is not supported.") # Begin pre-installation process. # Pre-install: parse the passed-in arguments. try: # Armon: Changed getopt to accept parameters for Repy and NM IP/Iface # restrictions, also a special disable flag opts, arg... | 456716f9f962bbdd263f3293dbf27268249362cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/456716f9f962bbdd263f3293dbf27268249362cb/seattleinstaller.py | |
def init(geni_username, vesselcount, vesseltype, program_filename, *args): | def init(geni_username, vesselcount, vesseltype, program_filename): | def init(geni_username, vesselcount, vesseltype, program_filename, *args): """ <Purpose> Initializes the deployment of an arbitrary service. Populates a global configuration dictionary and returns a dict of data that could be required by the run() function. init() must be called before the run() function. Note on the ... | c350a143212d411e5944d5c012b1612f03ddbde4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/c350a143212d411e5944d5c012b1612f03ddbde4/overlord.py |
*args [Optional] Any additional arguments will be passed to the program deployed on vessels. | def init(geni_username, vesselcount, vesseltype, program_filename, *args): """ <Purpose> Initializes the deployment of an arbitrary service. Populates a global configuration dictionary and returns a dict of data that could be required by the run() function. init() must be called before the run() function. Note on the ... | c350a143212d411e5944d5c012b1612f03ddbde4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/c350a143212d411e5944d5c012b1612f03ddbde4/overlord.py | |
return True | return True | def assertisallowed(call,*args): # let's pre-reject certain open / file calls #print call_rule_table[call] matches = find_action(call_rule_table[call], args) action, matched_rule, reasoning = matches[0] if action == 'allow': return True elif action == 'deny': matches.reverse() estr = "Call '"+str(call)+"' with args "+... | ded42c126586fbaf5ba6246be776420f00c914a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ded42c126586fbaf5ba6246be776420f00c914a9/restrictions.py |
_call_seattlegeni_func(client.renew_vessels, vesselhandle_list) | _call_seattlegeni_func(client.renew_resources, vesselhandle_list) | def seattlegeni_renew_vessels(identity, vesselhandle_list): """ <Purpose> Renew vessels previously acquired from SeattleGENI. <Arguments> identity The identity to use for communicating with SeattleGENI. vesselhandle_list The vessels to be renewed. <Exceptions> The common SeattleGENI exceptions described in the module c... | db6b30c971c0adeeae6bed8a26724eb31dc1ad19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/db6b30c971c0adeeae6bed8a26724eb31dc1ad19/experimentlib.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.