rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
found_cmd = r'tool\cmake\bin\%s' % found_cmd | found_cmd = r'..\tool\cmake\bin\%s' % self.cmake_cmd | def persist_cmake(self): if sys.platform == 'win32': version = '2.8.0' found_cmd = '' for test_cmd in (self.cmake_cmd, r'tool\cmake\bin\%s' % self.cmake_cmd): print 'Testing for CMake version %s at `%s`...' % (version, test_cmd) p = subprocess.Popen([test_cmd, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout, stderr = p.communicate() if p.returncode == 0 and stdout == 'cmake version %s\r\n' % version: # found one that works, hurrah! print 'Found valid CMake version' found_cmd = test_cmd # HACK: gotta go out so just hacking this for now if found_cmd == r'tool\cmake\bin\%s' % self.cmake_cmd: found_cmd = r'..\tool\cmake\bin\%s' % self.cmake_cmd break if not found_cmd: msg = 'CMake 2.8.0 not installed. Auto download now? [Y/n]' print msg, | f454dc64e3a0f9d4d7faf35dadf5eee4d798a48f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10355/f454dc64e3a0f9d4d7faf35dadf5eee4d798a48f/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
67,
71,
6540,
12,
2890,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
225,
1177,
273,
296,
22,
18,
28,
18,
20,
11,
1392,
67,
4172,
273,
875,
364,
1842,
67,
4172,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
67,
71,
6540,
12,
2890,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
225,
1177,
273,
296,
22,
18,
28,
18,
20,
11,
1392,
67,
4172,
273,
875,
364,
1842,
67,
4172,
316,
... |
def LoadFvImageName(XmlFvImageNames): XmlTag = "FvImageNames" FvImageName = XmlElement(XmlFvImageNames, XmlTag) return FvImageName def LoadFvImageOption(XmlFvImageOptions): XmlTag = "NameValue" FvImageOption = XmlElement(XmlFvImageOptions, XmlTag) return FvImageOption def LoadFvImage(XmlFvImage): FvImage = PlatformFvImageClass() XmlTag = "" FvImage.Name = '' XmlTag = "" FvImage.Value = '' XmlTag = "Type" FvImage.Type = XmlAttribute(XmlFvImage, XmlTag) XmlTag = "FvImage/FvImageNames" FvImage.FvImageNames = map(LoadFvImageName, XmlList(XmlFvImage, XmlTag)) XmlTag = "FvImage/FvImageOptions" FvImage.FvImageOptions = map(LoadFvImageOption, XmlList(XmlFvImage, XmlTag)) return FvImage | def LoadDynamicPcdBuildDefinitions(XmlFpd): DynamicPcdBuildDefinitions = [] XmlTag = "PlatformSurfaceArea/DynamicPcdBuildDefinitions/PcdBuildData" return map(LoadPlatformPcdBuildData, XmlList(XmlFpd, XmlTag)) | e3ad7624a34c23e19c67d615b2919203a867bc02 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/e3ad7624a34c23e19c67d615b2919203a867bc02/LoadFpd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
9791,
52,
4315,
3116,
7130,
12,
4432,
42,
22353,
4672,
12208,
52,
4315,
3116,
7130,
273,
5378,
5714,
1805,
273,
315,
8201,
11508,
5484,
19,
9791,
52,
4315,
3116,
7130,
19,
52,
4315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
9791,
52,
4315,
3116,
7130,
12,
4432,
42,
22353,
4672,
12208,
52,
4315,
3116,
7130,
273,
5378,
5714,
1805,
273,
315,
8201,
11508,
5484,
19,
9791,
52,
4315,
3116,
7130,
19,
52,
4315... | |
except UnicodeError, arg: return False, u'Encoding Error: %s (%s)' % (arg.__class__.__name__, unicode(arg)) except httplib.error, arg: return False, u'HTTP Error: %s (%s)' % (arg.__class__.__name__, arg.line) except socket.error, arg: | except UnicodeError, error: return False, u'Encoding Error: %s (%s)' % (error.__class__.__name__, unicode(error)) except httplib.error, error: return False, u'HTTP Error: %s' % error.__class__.__name__ except socket.error, error: | def check(self, useHEAD = True): """ Returns True and the server status message if the page is alive. Otherwise returns false """ try: wasRedirected = self.resolveRedirect(useHEAD = useHEAD) except UnicodeError, arg: return False, u'Encoding Error: %s (%s)' % (arg.__class__.__name__, unicode(arg)) except httplib.error, arg: return False, u'HTTP Error: %s (%s)' % (arg.__class__.__name__, arg.line) except socket.error, arg: # TODO: decode arg[1]. On Linux, it's encoded in UTF-8. # How is it encoded in Windows? Or can we somehow just # get the English message? return False, u'Socket Error: %s' % repr(arg[1]) #except UnicodeEncodeError, arg: # return False, u'Non-ASCII Characters in URL: %s' % arg if wasRedirected: if self.url in self.redirectChain: if useHEAD: # Some servers don't seem to handle HEAD requests properly, # which leads to a cyclic list of redirects. # We simply start from the beginning, but this time, # we don't use HEAD, but GET requests. redirChecker = LinkChecker(self.redirectChain[0], serverEncoding = self.serverEncoding) return redirChecker.check(useHEAD = False) else: urlList = ['[%s]' % url for url in self.redirectChain + [self.url]] return False, u'HTTP Redirect Loop: %s' % ' -> '.join(urlList) elif len(self.redirectChain) >= 19: if useHEAD: # Some servers don't seem to handle HEAD requests properly, # which leads to a long (or infinite) list of redirects. # We simply start from the beginning, but this time, # we don't use HEAD, but GET requests. redirChecker = LinkChecker(self.redirectChain[0], serverEncoding = self.serverEncoding) return redirChecker.check(useHEAD = False) else: urlList = ['[%s]' % url for url in self.redirectChain + [self.url]] return False, u'Long Chain of Redirects: %s' % ' -> '.join(urlList) else: redirChecker = LinkChecker(self.url, self.redirectChain, self.serverEncoding) return redirChecker.check(useHEAD = useHEAD) else: try: conn = self.getConnection() except httplib.error, arg: return False, u'HTTP Error: %s (%s)' % (arg.__class__.__name__, arg.line) try: conn.request('GET', '%s%s' % (self.path, self.query), None, self.header) except socket.error, arg: return False, u'Socket Error: %s' % repr(arg[1]) #except UnicodeEncodeError, arg: # return False, u'Non-ASCII Characters in URL: %s' % arg try: response = conn.getresponse() except Exception, arg: return False, u'Error: %s' % arg # read the server's encoding, in case we need it later self.readEncodingFromResponse(response) # site down if the server status is between 400 and 499 siteDown = response.status in range(400, 500) return not siteDown, '%s %s' % (response.status, response.reason) | 920e0f300ade446cdbe0dadb5b3abc6cc854e52c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/920e0f300ade446cdbe0dadb5b3abc6cc854e52c/weblinkchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
999,
12458,
273,
1053,
4672,
3536,
2860,
1053,
471,
326,
1438,
1267,
883,
309,
326,
1363,
353,
13714,
18,
5272,
1135,
629,
3536,
775,
30,
1703,
5961,
329,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
999,
12458,
273,
1053,
4672,
3536,
2860,
1053,
471,
326,
1438,
1267,
883,
309,
326,
1363,
353,
13714,
18,
5272,
1135,
629,
3536,
775,
30,
1703,
5961,
329,
273,
365,
... |
implements(IField) | if IInterface.providedBy(IField): implements(IField) else: __implements__ = IField | def fiddle(self, schema): pass | 2cf993551f95bbb1759af05a816a6350dbc1ee55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12166/2cf993551f95bbb1759af05a816a6350dbc1ee55/mocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
3132,
12,
2890,
16,
1963,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
3132,
12,
2890,
16,
1963,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not all_repos: | if all_repos is None: | def get_repos(self, all_repos=None): """ Get all repos from db and for each repo create it's backend instance. and fill that backed with information from database :param all_repos: give specific repositories list, good for filtering """ if not all_repos: all_repos = self.sa.query(Repository)\ .order_by(Repository.repo_name).all() | 146dec9cca1e7cbbe786f9444ed712c94aa2fed0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4230/146dec9cca1e7cbbe786f9444ed712c94aa2fed0/scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
15564,
12,
2890,
16,
777,
67,
15564,
33,
7036,
4672,
3536,
968,
777,
13686,
628,
1319,
471,
364,
1517,
3538,
752,
518,
1807,
4221,
791,
18,
471,
3636,
716,
20732,
598,
1779,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
15564,
12,
2890,
16,
777,
67,
15564,
33,
7036,
4672,
3536,
968,
777,
13686,
628,
1319,
471,
364,
1517,
3538,
752,
518,
1807,
4221,
791,
18,
471,
3636,
716,
20732,
598,
1779,
6... |
if prj != 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]': | if prj != 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]': | def dted_2(): ds = gdal.Open( 'data/n43.dt0' ) gt = ds.GetGeoTransform() max_error = 0.000001 if abs(gt[0] - (-80.004166666666663)) > max_error or abs(gt[1] - 0.0083333333333333332) > max_error \ or abs(gt[2] - 0) > max_error or abs(gt[3] - 44.00416666666667) > max_error \ or abs(gt[4] - 0) > max_error or abs(gt[5] - (-0.0083333333333333332)) > max_error: gdaltest.post_reason( 'DTED geotransform wrong.' ) return 'fail' prj = ds.GetProjection() if prj != 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]': gdaltest.post_reason( 'Projection does not match expected:\n%s' % prj ) return 'fail' band1 = ds.GetRasterBand(1) if band1.GetNoDataValue() != -32767: gdaltest.post_reason( 'Grid NODATA value wrong or missing.' ) return 'fail' if band1.DataType != gdal.GDT_Int16: gdaltest.post_reason( 'Data type is not Int16!' ) return 'fail' return 'success' | 57c730972bc29cfea1a37bf0a6d17ed4588a83d3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10290/57c730972bc29cfea1a37bf0a6d17ed4588a83d3/dted.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
2344,
67,
22,
13332,
225,
3780,
273,
15551,
287,
18,
3678,
12,
296,
892,
19,
82,
8942,
18,
7510,
20,
11,
262,
225,
9879,
273,
3780,
18,
967,
12447,
4059,
1435,
225,
943,
67,
163... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
2344,
67,
22,
13332,
225,
3780,
273,
15551,
287,
18,
3678,
12,
296,
892,
19,
82,
8942,
18,
7510,
20,
11,
262,
225,
9879,
273,
3780,
18,
967,
12447,
4059,
1435,
225,
943,
67,
163... |
"tapi": CM3_ALL or M3OSTYPE == "POSIX", | "tapi": CM3_ALL or M3OSTYPE == "WIN32", | def _FilterPackage(Package): PackageConditions = { "m3gdb": (M3GDB or CM3_GDB) and {"FreeBSD4": True, "LINUXLIBC6" : True, "SOLgnu" : True, "NetBSD2_i386" : True }.get(Target, False), "m3objfile": CM3_ALL or M3OSTYPE == "WIN32", "mklib": CM3_ALL or M3OSTYPE == "WIN32", "dll2lib": CM3_ALL, "fix_nl": CM3_ALL or M3OSTYPE == "WIN32", "libdump": CM3_ALL or M3OSTYPE == "WIN32", "import-libs": CM3_ALL or M3OSTYPE == "WIN32", "tcl": CM3_ALL or HAVE_TCL, "udp": CM3_ALL or M3OSTYPE == "POSIX", "tapi": CM3_ALL or M3OSTYPE == "POSIX", "serial": CM3_ALL or HAVE_SERIAL, "X11R4": CM3_ALL or M3OSTYPE != "WIN32", "showthread": CM3_ALL or M3OSTYPE != "WIN32", "pkl-fonts": CM3_ALL or M3OSTYPE != "WIN32", "juno-machine": CM3_ALL or M3OSTYPE != "WIN32", "juno-compiler": CM3_ALL or M3OSTYPE != "WIN32", "juno-app": CM3_ALL or M3OSTYPE != "WIN32", "m3back": not GCC_BACKEND, "m3staloneback": not GCC_BACKEND, "m3cc": GCC_BACKEND and not OMIT_GCC, } return PackageConditions.get(Package, True) | 858c6e5a156d91c49a04a6dea38d068cc7d4dc17 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/858c6e5a156d91c49a04a6dea38d068cc7d4dc17/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1586,
2261,
12,
2261,
4672,
7508,
8545,
273,
288,
315,
81,
23,
75,
1966,
6877,
261,
49,
23,
43,
2290,
578,
15871,
23,
67,
43,
2290,
13,
471,
12528,
9194,
30780,
24,
6877,
1053,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1586,
2261,
12,
2261,
4672,
7508,
8545,
273,
288,
315,
81,
23,
75,
1966,
6877,
261,
49,
23,
43,
2290,
578,
15871,
23,
67,
43,
2290,
13,
471,
12528,
9194,
30780,
24,
6877,
1053,
... |
except OSError: | except OSError: | def delete_db(settings): """Delete the old database.""" engine = settings.DATABASE_ENGINE if engine == 'sqlite3': try: os.unlink(settings.DATABASE_NAME) except OSError: pass elif engine == 'mysql': import _mysql s = _mysql.connect(host=settings.DATABASE_HOST, user=settings.DATABASE_USER, passwd=settings.DATABASE_PASSWORD) for cmd in ['drop database if exists %s', 'create database %s CHARACTER SET utf8 COLLATE utf8_general_ci']: s.query(cmd % settings.DATABASE_NAME) elif engine in ('postgresql', 'postgresql_psycopg2'): if settings.DATABASE_NAME == '': raise AssertionError, "You must specified a value for DATABASE_NAME in local_settings.py." if settings.DATABASE_USER == '': raise AssertionError, "You must specified a value for DATABASE_USER in local_settings.py." params=" --username=%s --password" % settings.DATABASE_USER if settings.DATABASE_HOST: params += " --host=%s" % settings.DATABASE_HOST if settings.DATABASE_PORT: params += " --port=%s" % settings.DATABASE_PORT params += " %s" % settings.DATABASE_NAME print """You will be prompted for the password for the user '%s' twice. Once to drop an existing database and then a second time for create the database """ % settings.DATABASE_USER for cmd in ['dropdb %s', 'createdb %s']: os.system(cmd % params) else: raise AssertionError, "Unknown database engine %s" % engine | 6bb4ee4e3413db8bff6866226b96bc305a1c8cd3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/171/6bb4ee4e3413db8bff6866226b96bc305a1c8cd3/load_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... |
result = diracAdmin.banSiteFromMask(site,comment,printOutput=True) | result = diracAdmin.banSiteFromMask( site, comment, printOutput = True ) | def usage(): print 'Usage: %s <DIRAC site name> <COMMENT>" [--email=<True/False>]' %(Script.scriptName) print 'Note: emails should only be disabled for bulk operations.' DIRAC.exit(2) | 2b204336b411589d2f99cfea8f7c7d239b7db197 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/2b204336b411589d2f99cfea8f7c7d239b7db197/dirac-admin-ban-site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
2984,
306,
413,
3652,
27127,
5510,
19,
8381,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
1172,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
4537,
2226,
2834,
508,
34,
411,
12200,
2984,
306,
413,
3652,
27127,
5510,
19,
8381,
34,
3864,
8975,
3651,
18,
4263,
461,
13,
1172,
296,
... |
atoms.set_constraint(FixAtoms(indices=fix)) | atoms.set_constraint([FixAtoms(indices=fix)]+fix_cart) else: atoms.set_constraint(fix_cart) | def read_aims(filename): """Import FHI-aims geometry type files. Reads unitcell, atom positions and constraints from a geometry.in file. """ from ase import Atoms, FixAtoms atoms = Atoms() fd = open(filename, 'r') lines = fd.readlines() fd.close() positions = [] cell = [] symbols = [] fix = [] i = -1 for n, line in enumerate(lines): inp = line.split() if inp == []: continue if inp[0] == 'atom': floatvect = float(inp[1]), float(inp[2]), float(inp[3]) positions.append(floatvect) symbols.append(inp[-1]) i += 1 elif inp[0] == 'lattice_vector': floatvect = float(inp[1]), float(inp[2]), float(inp[3]) cell.append(floatvect) try: if lines[n+1].split()[0] == 'constraint_relaxation': fix.append(i) except IndexError: continue atoms = Atoms(symbols, positions) if len(cell)==3: atoms.set_cell(cell) if len(fix): atoms.set_constraint(FixAtoms(indices=fix)) return atoms | df438801b6b59dedfcb56e9d333d40698705acc3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/df438801b6b59dedfcb56e9d333d40698705acc3/aims.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4581,
87,
12,
3459,
4672,
3536,
5010,
28705,
45,
17,
4581,
87,
5316,
618,
1390,
18,
225,
29185,
2836,
3855,
16,
3179,
6865,
471,
6237,
628,
279,
5316,
18,
267,
585,
18,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4581,
87,
12,
3459,
4672,
3536,
5010,
28705,
45,
17,
4581,
87,
5316,
618,
1390,
18,
225,
29185,
2836,
3855,
16,
3179,
6865,
471,
6237,
628,
279,
5316,
18,
267,
585,
18,
3536,
... |
@return: The object's C{__epydoc_sort__} list. | @return: A list specifying the sort order that should be used for the object's children. Elements that are in this list should appear before elements that are not in this list; and elements that are in this list should appear in the order that they appear in this list. | def sortorder(self): """ @return: The object's C{__epydoc_sort__} list. @rtype: C{list} of C{string} """ return self._sortorder | 6d6fd676bcc4d861c9f4f28506061b79289f7f4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/6d6fd676bcc4d861c9f4f28506061b79289f7f4e/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
1019,
12,
2890,
4672,
3536,
632,
2463,
30,
432,
666,
13664,
326,
1524,
1353,
716,
1410,
506,
1399,
364,
326,
733,
1807,
2325,
18,
225,
17219,
716,
854,
316,
333,
666,
1410,
9788,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
1019,
12,
2890,
4672,
3536,
632,
2463,
30,
432,
666,
13664,
326,
1524,
1353,
716,
1410,
506,
1399,
364,
326,
733,
1807,
2325,
18,
225,
17219,
716,
854,
316,
333,
666,
1410,
9788,
... |
msz = stats.f_bsize * stats.f_bavail | msz = stats.f_frsize * stats.f_bavail | def free_space(self, end_session=True): msz = csz = 0 if not iswindows: if self._main_prefix is not None: stats = os.statvfs(self._main_prefix) msz = stats.f_bsize * stats.f_bavail if self._card_prefix is not None: stats = os.statvfs(self._card_prefix) csz = stats.f_bsize * stats.f_bavail else: msz = self._windows_space(self._main_prefix)[1] csz = self._windows_space(self._card_prefix)[1] return (msz, 0, csz) | 61d5c451430b7b7163acd8f520925b88033684cd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/61d5c451430b7b7163acd8f520925b88033684cd/driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
67,
2981,
12,
2890,
16,
679,
67,
3184,
33,
5510,
4672,
4086,
94,
273,
2873,
94,
273,
374,
309,
486,
353,
13226,
30,
309,
365,
6315,
5254,
67,
3239,
353,
486,
599,
30,
3177,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
67,
2981,
12,
2890,
16,
679,
67,
3184,
33,
5510,
4672,
4086,
94,
273,
2873,
94,
273,
374,
309,
486,
353,
13226,
30,
309,
365,
6315,
5254,
67,
3239,
353,
486,
599,
30,
3177,
273... |
mi = ActionItem(_('No configuration values'), None | mi = ActionItem(_('No configuration values'), None, | def create_config_menu(self): """ Create a config menu for the given path """ configuration_values = [] | 6d74b257cb2f0c0fa221d16bdb4761ba713648f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/6d74b257cb2f0c0fa221d16bdb4761ba713648f2/configuration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1425,
67,
5414,
12,
2890,
4672,
3536,
1788,
279,
642,
3824,
364,
326,
864,
589,
3536,
1664,
67,
2372,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1425,
67,
5414,
12,
2890,
4672,
3536,
1788,
279,
642,
3824,
364,
326,
864,
589,
3536,
1664,
67,
2372,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if left[0] == KERNING_CLASS_PREFIX: | if left[0] == "@": | def guessPairType(self, pair): """ >>> kerning = { ... ("@A_left", "@A_right") : 1, ... ("A1", "@A_right") : 2, ... ("@A_left", "A2") : 3, ... ("A3", "A3") : 4, ... } >>> groups = { ... "@A_left" : ["A", "A1", "A2", "A3"], ... "@A_right" : ["A", "A1", "A2", "A3"], ... } >>> obj = MathKerning(kerning, groups) >>> obj.guessPairType(("@A_left", "@A_right")) ('class', 'class') >>> obj.guessPairType(("A1", "@A_right")) ('exception', 'class') >>> obj.guessPairType(("@A_left", "A2")) ('class', 'exception') >>> obj.guessPairType(("A3", "A3")) ('exception', 'exception') >>> obj.guessPairType(("A", "A")) ('single', 'single') """ left, right = pair CLASS_TYPE = "class" SINGLE_TYPE = "single" EXCEPTION_TYPE = "exception" # leftType = SINGLE_TYPE rightType = SINGLE_TYPE # is the left a simple class? if left[0] == KERNING_CLASS_PREFIX: leftType = CLASS_TYPE # or is it part of a class? if right[0] == KERNING_CLASS_PREFIX: rightType = CLASS_TYPE # if self._kerning.has_key(pair): potLeft = [left] potRight = [right] if leftType == SINGLE_TYPE and self._groupMap.has_key(left): for groupName in self._groupMap[left]: potLeft.append(groupName) if rightType == SINGLE_TYPE and self._groupMap.has_key(right): for groupName in self._groupMap[right]: potRight.append(groupName) # hits = [] for left in potLeft: for right in potRight: if self._kerning.has_key((left, right)): hits.append((left, right)) for left, right in hits: if leftType != CLASS_TYPE: if left[0] == KERNING_CLASS_PREFIX: leftType = EXCEPTION_TYPE if rightType != CLASS_TYPE: if right[0] == KERNING_CLASS_PREFIX: rightType = EXCEPTION_TYPE return (leftType, rightType) | de2dfa43a24bfa2f4da392648b9c09be60d7df98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8840/de2dfa43a24bfa2f4da392648b9c09be60d7df98/mathKerning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
4154,
559,
12,
2890,
16,
3082,
4672,
3536,
4080,
417,
264,
2093,
273,
288,
1372,
377,
7566,
36,
37,
67,
4482,
3113,
8787,
37,
67,
4083,
7923,
294,
404,
16,
1372,
377,
7566,
37,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
4154,
559,
12,
2890,
16,
3082,
4672,
3536,
4080,
417,
264,
2093,
273,
288,
1372,
377,
7566,
36,
37,
67,
4482,
3113,
8787,
37,
67,
4083,
7923,
294,
404,
16,
1372,
377,
7566,
37,
... |
environ['PATH_INFO'] = request_uri[len(root_uri):] | environ['PATH_INFO'] = urllib.unquote(request_uri[len(root_uri):]) | def dispatch_request(environ, start_response): """Main entry point for the Trac web interface. @param environ: the WSGI environment dict @param start_response: the WSGI callback for starting the response """ if 'mod_python.options' in environ: options = environ['mod_python.options'] environ.setdefault('trac.env_path', options.get('TracEnv')) environ.setdefault('trac.env_parent_dir', options.get('TracEnvParentDir')) environ.setdefault('trac.env_index_template', options.get('TracEnvIndexTemplate')) environ.setdefault('trac.template_vars', options.get('TracTemplateVars')) environ.setdefault('trac.locale', options.get('TracLocale')) if 'TracUriRoot' in options: # Special handling of SCRIPT_NAME/PATH_INFO for mod_python, which # tends to get confused for whatever reason root_uri = options['TracUriRoot'].rstrip('/') request_uri = environ['REQUEST_URI'].split('?', 1)[0] if not request_uri.startswith(root_uri): raise ValueError('TracUriRoot set to %s but request URL ' 'is %s' % (root_uri, request_uri)) environ['SCRIPT_NAME'] = root_uri environ['PATH_INFO'] = request_uri[len(root_uri):] else: environ.setdefault('trac.env_path', os.getenv('TRAC_ENV')) environ.setdefault('trac.env_parent_dir', os.getenv('TRAC_ENV_PARENT_DIR')) environ.setdefault('trac.env_index_template', os.getenv('TRAC_ENV_INDEX_TEMPLATE')) environ.setdefault('trac.template_vars', os.getenv('TRAC_TEMPLATE_VARS')) environ.setdefault('trac.locale', '') locale.setlocale(locale.LC_ALL, environ['trac.locale']) # Allow specifying the python eggs cache directory using SetEnv if 'mod_python.subprocess_env' in environ: egg_cache = environ['mod_python.subprocess_env'].get('PYTHON_EGG_CACHE') if egg_cache: os.environ['PYTHON_EGG_CACHE'] = egg_cache # Determine the environment env_path = environ.get('trac.env_path') if not env_path: env_parent_dir = environ.get('trac.env_parent_dir') env_paths = environ.get('trac.env_paths') if env_parent_dir or env_paths: # The first component of the path is the base name of the # environment path_info = environ.get('PATH_INFO', '').lstrip('/').split('/') env_name = path_info.pop(0) if not env_name: # No specific environment requested, so render an environment # index page send_project_index(environ, start_response, env_parent_dir, env_paths) return [] # To make the matching patterns of request handlers work, we append # the environment name to the `SCRIPT_NAME` variable, and keep only # the remaining path in the `PATH_INFO` variable. environ['SCRIPT_NAME'] = Href(environ['SCRIPT_NAME'])(env_name) environ['PATH_INFO'] = '/'.join([''] + path_info) if env_parent_dir: env_path = os.path.join(env_parent_dir, env_name) else: env_path = get_environments(environ).get(env_name) if not env_path or not os.path.isdir(env_path): start_response('404 Not Found', []) return ['Environment not found'] if not env_path: raise EnvironmentError('The environment options "TRAC_ENV" or ' '"TRAC_ENV_PARENT_DIR" or the mod_python ' 'options "TracEnv" or "TracEnvParentDir" are ' 'missing. Trac requires one of these options ' 'to locate the Trac environment(s).') env = _open_environment(env_path, run_once=environ['wsgi.run_once']) base_url = env.config.get('trac', 'base_url') if base_url: environ['trac.base_url'] = base_url req = Request(environ, start_response) try: db = env.get_db_cnx() try: try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except RequestDone: pass return req._response or [] finally: db.close() except HTTPException, e: env.log.warn(e) if req.hdf: req.hdf['title'] = e.reason or 'Error' req.hdf['error'] = { 'title': e.reason or 'Error', 'type': 'TracError', 'message': e.message } try: req.send_error(sys.exc_info(), status=e.code) except RequestDone: return [] except Exception, e: env.log.exception(e) import traceback from StringIO import StringIO tb = StringIO() traceback.print_exc(file=tb) if req.hdf: req.hdf['title'] = str(e) or 'Error' req.hdf['error'] = { 'title': str(e) or 'Error', 'type': 'internal', 'traceback': tb.getvalue() } try: req.send_error(sys.exc_info(), status=500) except RequestDone: return [] | 524b7a9a76950acaed6962cd1487ddf1150f691c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/524b7a9a76950acaed6962cd1487ddf1150f691c/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
67,
2293,
12,
28684,
16,
787,
67,
2740,
4672,
3536,
6376,
1241,
1634,
364,
326,
2197,
71,
3311,
1560,
18,
225,
632,
891,
5473,
30,
326,
7649,
13797,
3330,
2065,
632,
891,
787,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
67,
2293,
12,
28684,
16,
787,
67,
2740,
4672,
3536,
6376,
1241,
1634,
364,
326,
2197,
71,
3311,
1560,
18,
225,
632,
891,
5473,
30,
326,
7649,
13797,
3330,
2065,
632,
891,
787,
67... |
self.create = wx.RadioButton(self, -1, _(u"Discard all my data and start from scratch")) sizer.Add(self.create, flag=wx.ALL, border=5) self.create.Bind(wx.EVT_LEFT_DCLICK, self.onButton) | self.undocheck = wx.RadioButton(self, -1, _(u"Discard recent changes until data integrity tests pass")) sizer.Add(self.undocheck, flag=wx.ALL, border=5) self.undocheck.Bind(wx.EVT_LEFT_DCLICK, self.onButton) self.create = wx.RadioButton(self, -1, _(u"Discard all my data and start from scratch")) sizer.Add(self.create, flag=wx.ALL, border=5) self.create.Bind(wx.EVT_LEFT_DCLICK, self.onButton) | def __init__(self, exception=None): # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. pre = wx.PreDialog() style = wx.CAPTION pre.Create(None, -1, _(u"Startup Options for Chandler"), wx.DefaultPosition, wx.DefaultSize, style) | ac1678e560cf275adf66e2c101e6007abb13c163 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ac1678e560cf275adf66e2c101e6007abb13c163/StartupOptionsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1520,
33,
7036,
4672,
468,
17561,
434,
4440,
7075,
18,
6353,
16186,
2738,
972,
732,
675,
2640,
326,
6176,
468,
1427,
732,
848,
444,
392,
2870,
2154,
716,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1520,
33,
7036,
4672,
468,
17561,
434,
4440,
7075,
18,
6353,
16186,
2738,
972,
732,
675,
2640,
326,
6176,
468,
1427,
732,
848,
444,
392,
2870,
2154,
716,
... |
x = i = H = pS = 0 | x = i = H = pS = hx = 0 | def split(self, availWidth, availHeight): canv = self.canv C = self._content x = i = H = pS = 0 n = len(C) I2W = {} for x in xrange(n): c = C[x] I = c._ptoinfo if I not in I2W.keys(): T = I.trailer Hdr = I.header tW, tH = _listWrapOn(T, availWidth, self.canv) tSB = T[0].getSpaceBefore() I2W[I] = T,tW,tH,tSB else: T,tW,tH,tSB = I2W[I] _, h = c.wrapOn(canv,availWidth,0xfffffff) if x: h += max(c.getSpaceBefore()-pS,0) pS = c.getSpaceAfter() H += h+pS if H+tH+max(tSB,pS)>=availHeight-_FUZZ: break i += 1 | 8d8c0ec1fd140512007c83c05dcbc570c6560932 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/8d8c0ec1fd140512007c83c05dcbc570c6560932/flowables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
848,
90,
273,
365,
18,
4169,
90,
385,
273,
365,
6315,
1745,
619,
273,
277,
273,
670,
273,
293,
55,
273,
366,
92,
273,
374,
290... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
848,
90,
273,
365,
18,
4169,
90,
385,
273,
365,
6315,
1745,
619,
273,
277,
273,
670,
273,
293,
55,
273,
366,
92,
273,
374,
290... |
self.assertComplexIdentical(cmath.tanh(complex(0., .0j)), complex(0., .0j)) self.assertComplexIdentical(cmath.tanh(complex(0., -.0j)), complex(0., -.0j)) self.assertComplexIdentical(cmath.tanh(complex(-0., .0j)), complex(-0., .0j)) self.assertComplexIdentical(cmath.tanh(complex(-0., -.0j)), complex(-0., -.0j)) | for z in complex_zeros: self.assertComplexIdentical(cmath.tanh(z), z) | def testTanhSign(self): self.assertComplexIdentical(cmath.tanh(complex(0., .0j)), complex(0., .0j)) self.assertComplexIdentical(cmath.tanh(complex(0., -.0j)), complex(0., -.0j)) self.assertComplexIdentical(cmath.tanh(complex(-0., .0j)), complex(-0., .0j)) self.assertComplexIdentical(cmath.tanh(complex(-0., -.0j)), complex(-0., -.0j)) | 204cd77183ab7f1b4d179d1abaaddf17e5b07be6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/204cd77183ab7f1b4d179d1abaaddf17e5b07be6/test_cmath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
56,
304,
76,
2766,
12,
2890,
4672,
365,
18,
11231,
12795,
6106,
1706,
12,
7670,
421,
18,
88,
304,
76,
12,
14259,
12,
20,
12990,
263,
20,
78,
13,
3631,
7233,
12,
20,
12990,
263,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
56,
304,
76,
2766,
12,
2890,
4672,
365,
18,
11231,
12795,
6106,
1706,
12,
7670,
421,
18,
88,
304,
76,
12,
14259,
12,
20,
12990,
263,
20,
78,
13,
3631,
7233,
12,
20,
12990,
263,... |
try: | if self.lp: return self.get_bug_new(id) return self.get_bug_old(id) def get_bug_new(self, id): def _sort(task1, task2): statuses = ["Unknown", "Invalid", "Won't fix", "Fix Released", "Fix Committed", "New", "Incomplete", "Confirmed", "Triaged", "In Progress"] severities = ["Unknown", "Undecided", "Wishlist", "Low", "Medium", "High", "Critical"] task1_status = task1.status task1_importance = task1.importance task2_status = task2.status task2_importance = task2.importance if task1_status != task2_status: if statuses.index(task1_status) < statuses.index(task2_status): return -1 return 1 if task1_importance != task2_importance: if severities.index(task1_importance) < severities.index(task2_importance): return -1 return 1 return 0 try: bugdata = self.lp.bugs[id] if bugdata.private: raise BugtrackerError, "This bug is private" dup = bugdata.duplicate_of affected = bugdata.users_affected_count_with_dupes heat = bugdata.heat tasks = bugdata.bug_tasks if tasks.total_size != 1: tasks = list(tasks) tasks.sort(_sort) taskdata = tasks[-1] else: taskdata = tasks[0] assignee = taskdata.assignee t = taskdata.bug_target_display_name if assignee: assignee = u"%s (%s)" % (assignee.display_name, assignee.name) else: assignee = '' except Exception, e: supylog.exception("Error gathering bug data for %s bug %d" % (self.description, id)) s = 'Could not parse data returned by %s: %s (%s/bugs/%d)' % (self.description, e, self.url, id) raise BugtrackerError, s if dup: dupbug = self.get_bug(dup.id) return [(id, t, bugdata.title + (' (dup-of: %d)' % dup.id), taskdata.importance, taskdata.status, assignee, "%s/bugs/%s" % (self.url, id))] + dupbug return [(id, t, bugdata.title + " (affected: %d, heat: %d)" % (affected, heat), taskdata.importance, taskdata.status, assignee, "%s/bugs/%s" % (self.url, id))] def get_bug_old(self, id): if id == 1: raise BugtrackerError, "https://bugs.launchpad.net/ubuntu/+bug/1 (Not reporting large bug)" try: | def get_bug(self, id): try: | df10ce98f833e71d2487be9595b618b5a3e450ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3124/df10ce98f833e71d2487be9595b618b5a3e450ba/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
925,
12,
2890,
16,
612,
4672,
775,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
925,
12,
2890,
16,
612,
4672,
775,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
database = config['PLC_DB_NAME'] archived_database = database + "_archived" | def usage(): print "Usage: %s [OPTION] UPGRADE_CONFIG_FILE " % sys.argv[0] print "Options:" print " -s, --schema=FILE Upgraded Database Schema" print " -t, --temp-dir=DIR Temp Directory" print " --help This message" sys.exit(1) | af98851618b632afb0a950644c796b7c633ace40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/af98851618b632afb0a950644c796b7c633ace40/upgrade-db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
30,
738,
87,
306,
7425,
65,
7376,
24554,
1639,
67,
7203,
67,
3776,
315,
738,
2589,
18,
19485,
63,
20,
65,
1172,
315,
1320,
2773,
1172,
315,
377,
300,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
30,
738,
87,
306,
7425,
65,
7376,
24554,
1639,
67,
7203,
67,
3776,
315,
738,
2589,
18,
19485,
63,
20,
65,
1172,
315,
1320,
2773,
1172,
315,
377,
300,
87,
... | |
EVT_LISTBOX(self.elementLb, wxID_STCSTYLEEDITDLGELEMENTLB, self.OnElementlbListbox) self.addCommonItemBtn = wxButton(id=wxID_STCSTYLEEDITDLGADDCOMMONITEMBTN, label='Add', name='addCommonItemBtn', parent=self, pos=wxPoint(8, 184), size=wxSize(80, 17), style=0) | self.elementLb.Bind(wx.EVT_LISTBOX, self.OnElementlbListbox, id=wxID_STCSTYLEEDITDLGELEMENTLB) self.addCommonItemBtn = wx.Button(id=wxID_STCSTYLEEDITDLGADDCOMMONITEMBTN, label='Add', name='addCommonItemBtn', parent=self, pos=wx.Point(8, 200), size=wx.Size(88, 17), style=0) | def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(True) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize) | 1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... |
amount = str(data.balance).replace ('.', '') | amount = unicode((data.balance * 100).to_integral()) | def prepareData(self, data): self.order = data # See tclink developer's guide for additional fields and info # convert amount to cents, no decimal point amount = str(data.balance).replace ('.', '') | 9890d1fffb02d5878b8c2afce339223835517edf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/171/9890d1fffb02d5878b8c2afce339223835517edf/processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
751,
12,
2890,
16,
501,
4672,
365,
18,
1019,
273,
501,
468,
2164,
268,
830,
754,
8751,
1807,
7343,
364,
3312,
1466,
471,
1123,
468,
1765,
3844,
358,
276,
4877,
16,
1158,
6970,
16... |
if x in self.ring(): | if x.parent() == self.ring(): | def _coerce_(self, x): if isinstance(x, fraction_field_element.FractionFieldElement) \ and x.parent() == self: return x if x in self.ring(): return self(x) raise TypeError, "no canonical coercion of x(=%s) into %s"%(x,self) | 59a8c8150ddc834f677d2370b3a893453d7e07c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/59a8c8150ddc834f677d2370b3a893453d7e07c3/fraction_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2894,
2765,
67,
12,
2890,
16,
619,
4672,
309,
1549,
12,
92,
16,
8330,
67,
1518,
67,
2956,
18,
13724,
974,
1046,
13,
521,
471,
619,
18,
2938,
1435,
422,
365,
30,
327,
619,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2894,
2765,
67,
12,
2890,
16,
619,
4672,
309,
1549,
12,
92,
16,
8330,
67,
1518,
67,
2956,
18,
13724,
974,
1046,
13,
521,
471,
619,
18,
2938,
1435,
422,
365,
30,
327,
619,
309,
... |
self.am_setModuleParam('shifterProxy','DataManager') self.am_setModuleParam('shifterProxyLocation',proxyLocation) | self.am_setModuleParam( 'shifterProxy', 'DataManager' ) self.am_setModuleParam( 'shifterProxyLocation', proxyLocation ) | def initialize(self): self.TransferDB = TransferDB() self.useProxies = self.am_getOption('UseProxies','True').lower() in ( "y", "yes", "true" ) proxyLocation = self.am_getOption('ProxyLocation',False) if self.useProxies: self.am_setModuleParam('shifterProxy','DataManager') self.am_setModuleParam('shifterProxyLocation',proxyLocation) return S_OK() | 75f9ff3f5f046181ee9f2e9b6a6d0d0b668c1251 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/75f9ff3f5f046181ee9f2e9b6a6d0d0b668c1251/FTSMonitorAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
365,
18,
5912,
2290,
273,
12279,
2290,
1435,
365,
18,
1202,
21488,
273,
365,
18,
301,
67,
588,
1895,
2668,
3727,
21488,
17023,
5510,
16063,
8167,
1435,
316,
261,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
365,
18,
5912,
2290,
273,
12279,
2290,
1435,
365,
18,
1202,
21488,
273,
365,
18,
301,
67,
588,
1895,
2668,
3727,
21488,
17023,
5510,
16063,
8167,
1435,
316,
261,
31... |
return ret | self.callback(ret) | def processAnswer_15(self, message): '''looking for Mail eXchanger for the domain | 6f47c1a0adeb35adc7a29f90a83a4050fca41779 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6f47c1a0adeb35adc7a29f90a83a4050fca41779/dns.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
13203,
67,
3600,
12,
2890,
16,
883,
4672,
9163,
7330,
310,
364,
11542,
425,
60,
343,
11455,
364,
326,
2461,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
13203,
67,
3600,
12,
2890,
16,
883,
4672,
9163,
7330,
310,
364,
11542,
425,
60,
343,
11455,
364,
326,
2461,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.debug("dict word(%s) err(%s) loc(%s)" % (word, msg, loc)) | self.Debug("dict word(%s) err(%s) loc(%s)" % (word, msg, loc)) | def lookup_ciba(self, word): connect = httplib.HTTPConnection('cb.kingsoft.com', 80) connect.request("GET", "/search?s=%s&t=word&lang=utf-8" % (word.encode("UTF-8"), )) response = connect.getresponse() if response.status != 200: msg = "%d:%s" % (response.status, response.reason) loc = response.getheader("location") self.debug("dict word(%s) err(%s) loc(%s)" % (word, msg, loc)) return "error" else: # Do the parsing here html = response.read().decode("UTF-8", "ignore") if self.rNx.search(html): return "" m = self.rCtoE.search(html) if m: m = self.rBlue.split(m.group(1))[1:] words = [] for i in m: words.append(i[:i.find("<")]) return word + ": " + ", ".join(words) m = self.rEtoC.search(html) if m: html = m.group(1) result = word + ":" m = self.rSpell.search(html) if m: spell = m.group(1) for k in self.cmap: spell = spell.replace(k, self.cmap[k]) result += " /" + spell + "/" m = self.rExpl.search(html) if m: html = m.group(1) html = self.rStrip.sub(" ", html) result += " " result += html return result return "" | d0f1bbac00a761b0016dc9bc88dc6f9f32432278 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10749/d0f1bbac00a761b0016dc9bc88dc6f9f32432278/weblookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
67,
71,
495,
69,
12,
2890,
16,
2076,
4672,
3077,
273,
15851,
6673,
18,
3693,
1952,
2668,
7358,
18,
79,
899,
4401,
18,
832,
2187,
8958,
13,
3077,
18,
2293,
2932,
3264,
3113,
2206,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
67,
71,
495,
69,
12,
2890,
16,
2076,
4672,
3077,
273,
15851,
6673,
18,
3693,
1952,
2668,
7358,
18,
79,
899,
4401,
18,
832,
2187,
8958,
13,
3077,
18,
2293,
2932,
3264,
3113,
2206,... |
address = imp_address)) | address = imp_address, hint_name_table_rva = hint_name_table_rva)) | def parse_imports(self, original_first_thunk, first_thunk, forwarder_chain): """Parse the imported symbols. It will fill a list, which will be avalable as the dictionary attribute "imports". Its keys will be the DLL names and the values all the symbols imported from that object. """ imported_symbols = [] imports_section = self.get_section_by_rva(first_thunk) if not imports_section: raise PEFormatError, 'Invalid/corrupt imports.' # Import Lookup Table. Contains ordinals or pointers to strings. ilt = self.get_import_table(original_first_thunk) # Import Address Table. May have identical content to ILT if # PE file is not bounded, Will contain the address of the # imported symbols once the binary is loaded or if it is already # bound. iat = self.get_import_table(first_thunk) | 492d8eddd70fdf3fe0ba324cb87b808ddd402897 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4177/492d8eddd70fdf3fe0ba324cb87b808ddd402897/pefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
21350,
12,
2890,
16,
2282,
67,
3645,
67,
451,
1683,
16,
1122,
67,
451,
1683,
16,
364,
20099,
67,
5639,
4672,
3536,
3201,
326,
9101,
7963,
18,
225,
2597,
903,
3636,
279,
666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
21350,
12,
2890,
16,
2282,
67,
3645,
67,
451,
1683,
16,
1122,
67,
451,
1683,
16,
364,
20099,
67,
5639,
4672,
3536,
3201,
326,
9101,
7963,
18,
225,
2597,
903,
3636,
279,
666,
... |
if account: if len(models.Account.get_accounts_for_nickname(account.nickname)) > 1: user_key = email else: user_key = nick cache_timeout = 300 | if (account and len(models.Account.get_accounts_for_nickname(account.nickname)) > 1): user_key = email | def show_user(email, arg=None, autoescape=None, memcache_results=None): """Render a link to the user's dashboard, with text being the nickname.""" if isinstance(email, users.User): email = email.email() if not arg: user = users.get_current_user() if user is not None and email == user.email(): return 'me' ret = None if memcache_results is not None: if email in memcache_results: ret = memcache_results[email] else: logging.debug('memcache miss for %r', email) if ret is None: nick = nickname(email, True) account = models.Account.get_account_for_email(email) if account: if len(models.Account.get_accounts_for_nickname(account.nickname)) > 1: # The nickname is not unique, fallback to email as key. user_key = email else: user_key = nick # Cache for a longer time, this is likely to remain valid. cache_timeout = 300 else: user_key = nick # Cache likely to become invalid due to user sign up. cache_timeout = 30 memcache.add('show_user:%s' % email, ret, cache_timeout) # populate the dict with the results, so same user in the list later # will have a memcache "hit" on "read". if memcache_results is not None: memcache_results[email] = ret ret = ('<a href="/user/%(key)s" onMouseOver="M_showUserInfoPopup(this)">' '%(key)s</a>' % {'key': cgi.escape(user_key)}) return django.utils.safestring.mark_safe(ret) | 19b3d737ff7c4d7ae891275966d796d7506780f7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/476/19b3d737ff7c4d7ae891275966d796d7506780f7/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1355,
12,
3652,
16,
1501,
33,
7036,
16,
3656,
6939,
33,
7036,
16,
20549,
67,
4717,
33,
7036,
4672,
3536,
3420,
279,
1692,
358,
326,
729,
1807,
11825,
16,
598,
977,
3832,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
67,
1355,
12,
3652,
16,
1501,
33,
7036,
16,
3656,
6939,
33,
7036,
16,
20549,
67,
4717,
33,
7036,
4672,
3536,
3420,
279,
1692,
358,
326,
729,
1807,
11825,
16,
598,
977,
3832,
326,... |
IEEEFormatTestCase, IEEEOperationsTestCase, ) | IEEEFormatTestCase) | def test_main(): test_support.run_unittest( FormatFunctionsTestCase, UnknownFormatTestCase, IEEEFormatTestCase, IEEEOperationsTestCase, ) | d9597241d7678ad0888b5d15319c8d7f56f3538a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d9597241d7678ad0888b5d15319c8d7f56f3538a/test_float.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
4077,
7503,
4709,
2449,
16,
9077,
1630,
4709,
2449,
16,
467,
9383,
41,
1630,
4709,
2449,
13,
225,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
1842,
67,
13261,
18,
2681,
67,
4873,
3813,
12,
4077,
7503,
4709,
2449,
16,
9077,
1630,
4709,
2449,
16,
467,
9383,
41,
1630,
4709,
2449,
13,
225,
2,
-100,
-100,
-... |
if gnode.parent: | if gnode.data['log'][-1][1] != 'root': | def sim_walk(gtree, snode, gnode, p, s_walk_time=0.0, g_walk_time=0.0, \ time_until_force=forcetime, eventlog=[]): | 9e666bd2e1ce79720a70adc6d8dc1bb739182c1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7683/9e666bd2e1ce79720a70adc6d8dc1bb739182c1c/sim_v2_2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
67,
11348,
12,
75,
3413,
16,
272,
2159,
16,
314,
2159,
16,
293,
16,
272,
67,
11348,
67,
957,
33,
20,
18,
20,
16,
314,
67,
11348,
67,
957,
33,
20,
18,
20,
16,
521,
813,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
67,
11348,
12,
75,
3413,
16,
272,
2159,
16,
314,
2159,
16,
293,
16,
272,
67,
11348,
67,
957,
33,
20,
18,
20,
16,
314,
67,
11348,
67,
957,
33,
20,
18,
20,
16,
521,
813,
67,
... |
def load(self, raw): list_loaded = list() pos = 0 load_2 = True while 1: regl = "(\"|\')(.*?)(\"|\')(, |\])" pl = re.compile(regl, re.UNICODE) xl = pl.search(raw, pos) if xl == None: if len(list_loaded) >= 1: return list_loaded break elif len(done) == 0: break pos = xl.end() word = xl.group(2) if word not in list_loaded: list_loaded.append(word) | def load(self, raw): list_loaded = list() pos = 0 load_2 = True while 1: regl = "(\"|\')(.*?)(\"|\')(, |\])" pl = re.compile(regl, re.UNICODE) xl = pl.search(raw, pos) if xl == None: if len(list_loaded) >= 1: return list_loaded break elif len(done) == 0: break pos = xl.end() word = xl.group(2) if word not in list_loaded: list_loaded.append(word) | def load(self, raw): list_loaded = list() pos = 0 load_2 = True # I search with a regex how many user have not the talk page # and i put them in a list (i find it more easy and secure) while 1: regl = "(\"|\')(.*?)(\"|\')(, |\])" pl = re.compile(regl, re.UNICODE) xl = pl.search(raw, pos) if xl == None: if len(list_loaded) >= 1: return list_loaded break elif len(done) == 0: break pos = xl.end() word = xl.group(2) if word not in list_loaded: list_loaded.append(word) | 81fef4c88acffaa26df691b3ebff2e48e9a2bdc9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/81fef4c88acffaa26df691b3ebff2e48e9a2bdc9/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
1831,
4672,
666,
67,
4230,
273,
666,
1435,
949,
273,
374,
1262,
67,
22,
273,
1053,
468,
467,
1623,
598,
279,
3936,
3661,
4906,
729,
1240,
486,
326,
26591,
1363,
468... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
1831,
4672,
666,
67,
4230,
273,
666,
1435,
949,
273,
374,
1262,
67,
22,
273,
1053,
468,
467,
1623,
598,
279,
3936,
3661,
4906,
729,
1240,
486,
326,
26591,
1363,
468... |
setup_requires = 'setupdocs', | setup_requires = 'setupdocs>=1.0', | def run(self): distbuild.run(self) self.run_command('build_docs') | 55b2cce4a4cb4feb0371f0e667be6203b0a6f152 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13168/55b2cce4a4cb4feb0371f0e667be6203b0a6f152/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2411,
3510,
18,
2681,
12,
2890,
13,
365,
18,
2681,
67,
3076,
2668,
3510,
67,
8532,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2411,
3510,
18,
2681,
12,
2890,
13,
365,
18,
2681,
67,
3076,
2668,
3510,
67,
8532,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
del os.environ['DYLD_BIND_AT_LAUNCH'] | def runTestCase(self): os.environ['DYLD_BIND_AT_LAUNCH'] = '1' fp = os.popen('/tmp/test.bin', 'r') del os.environ['DYLD_BIND_AT_LAUNCH'] data = fp.read() xit = fp.close() if xit != None: self.fail("Running failed[%s]"%(xit,)) return data | 4a12c9814f2002d2d55207d66cb9c82e2048b8a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/4a12c9814f2002d2d55207d66cb9c82e2048b8a0/dejagnu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
2449,
12,
2890,
4672,
1140,
18,
28684,
3292,
40,
61,
12069,
67,
2708,
67,
789,
67,
2534,
2124,
1792,
3546,
273,
296,
21,
11,
4253,
273,
1140,
18,
84,
3190,
2668,
19,
5645,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
2449,
12,
2890,
4672,
1140,
18,
28684,
3292,
40,
61,
12069,
67,
2708,
67,
789,
67,
2534,
2124,
1792,
3546,
273,
296,
21,
11,
4253,
273,
1140,
18,
84,
3190,
2668,
19,
5645,
... | |
else: was_on_both = False | elif left_protocol == 'irc': p.createDuplicateOnIRC() else: was_on_both = False | def removeParticipant(self, left_protocol, nickname, leave_message): """Remove the participant using nickname from the bridge. Raises a NoSuchParticipantException if nickname is not used in the bridge.""" was_on_both = None p = self.getParticipant(nickname) if p.protocol == 'xmpp': if left_protocol == 'irc': was_on_both = True elif left_protocol == 'xmpp': if p.irc_connection == 'both': was_on_both = True p.protocol = 'irc' p.createDuplicateOnXMPP() else: was_on_both = False elif p.protocol == 'irc': if left_protocol == 'xmpp': was_on_both = True elif left_protocol == 'irc': if p.xmpp_c == 'both': was_on_both = True p.protocol = 'xmpp' p.createDuplicateOnIRC() else: was_on_both = False else: raise Exception('[Internal Error] bad protocol') if was_on_both == True: self.bot.error('===> Debug: "'+nickname+'" was on both sides of bridge "'+str(self)+'" but left '+left_protocol, debug=True) elif was_on_both == False: self.lock.acquire() self.bot.error('===> Debug: removing participant "'+nickname+'" from bridge "'+str(self)+'"', debug=True) self.participants.remove(p) p.leave(leave_message) del p i = 0 for p in self.participants: if p.protocol == 'xmpp': i += 1 self.lock.release() if left_protocol == 'xmpp': if self.irc_connections_limit != -1 and self.irc_connections_limit > i: self.switchFromLimitedToNormalMode() if self.mode != 'normal': xmpp_participants_nicknames = self.get_participants_nicknames_list(protocols=['xmpp']) self.say('[Info] Participants on XMPP: '+' '.join(xmpp_participants_nicknames), on_xmpp=False) elif left_protocol == 'irc': if self.mode == 'minimal': irc_participants_nicknames = self.get_participants_nicknames_list(protocols=['irc']) self.say('[Info] Participants on IRC: '+' '.join(irc_participants_nicknames), on_irc=False) else: self.bot.error('=> Debug: Bad decision tree, p.protocol='+p.protocol+' left_protocol='+left_protocol+'\np.xmpp_c='+str(p.xmpp_c)+'\np.irc_connection='+str(p.irc_connection), debug=True) | 149dd43020f1e98a97573a2bc38f82171b550782 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9915/149dd43020f1e98a97573a2bc38f82171b550782/bridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
22540,
12,
2890,
16,
2002,
67,
8373,
16,
19570,
16,
8851,
67,
2150,
4672,
3536,
3288,
326,
14188,
1450,
19570,
628,
326,
10105,
18,
20497,
279,
5823,
22540,
503,
309,
19570,
353,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
22540,
12,
2890,
16,
2002,
67,
8373,
16,
19570,
16,
8851,
67,
2150,
4672,
3536,
3288,
326,
14188,
1450,
19570,
628,
326,
10105,
18,
20497,
279,
5823,
22540,
503,
309,
19570,
353,
4... |
spe.removeEntityByInstance(spe.ownsWeapon(self.userid, weapon)) | spe.removeEntityByInstance(pWeapons[weapon]["instance"]) | def strip(self, levelStrip=False, exceptions=[]): ''' * Strips/removes all weapons from the player minus the knife and their current levels weapon. | 02e919b0ad47effe0963368576895a6db2c8596f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4555/02e919b0ad47effe0963368576895a6db2c8596f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
12,
2890,
16,
1801,
16632,
33,
8381,
16,
4798,
33,
8526,
4672,
9163,
380,
3978,
7146,
19,
2764,
10829,
777,
732,
438,
7008,
628,
326,
7291,
12647,
326,
15516,
24723,
471,
3675,
783... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
12,
2890,
16,
1801,
16632,
33,
8381,
16,
4798,
33,
8526,
4672,
9163,
380,
3978,
7146,
19,
2764,
10829,
777,
732,
438,
7008,
628,
326,
7291,
12647,
326,
15516,
24723,
471,
3675,
783... |
self.client = self.user.createClient() | self.client = self.user.createClientWithCerts() | def testWhitelistAuthNOK(self): self.config["nuauth_tls_auth_by_cert"] = 0 self.config["session_authtype_whitelist_groups"] = "\"123\"" self.nuauth = Nuauth(self.config) | 43e708e0646709fc09702b0ecd4dc971eab58098 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10929/43e708e0646709fc09702b0ecd4dc971eab58098/test_session_authtype.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18927,
1730,
50,
3141,
12,
2890,
4672,
365,
18,
1425,
9614,
13053,
1944,
67,
17116,
67,
1944,
67,
1637,
67,
7593,
11929,
273,
374,
365,
18,
1425,
9614,
3184,
67,
5854,
647,
388,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18927,
1730,
50,
3141,
12,
2890,
4672,
365,
18,
1425,
9614,
13053,
1944,
67,
17116,
67,
1944,
67,
1637,
67,
7593,
11929,
273,
374,
365,
18,
1425,
9614,
3184,
67,
5854,
647,
388,
... |
print "TCM/ConfigFS storage object already exists: " + cfs_dev_path return -1 | tcm_err("TCM/ConfigFS storage object already exists: " + cfs_dev_path) | def tcm_createvirtdev(option, opt_str, value, parser): cfs_unsplit = str(value[0]) cfs_path_tmp = cfs_unsplit.split('/') hba_cfs = cfs_path_tmp[0] print " ConfigFS HBA: " + hba_cfs cfs_hba_path = tcm_get_cfs_prefix(hba_cfs) if (os.path.isdir(cfs_hba_path) == False): ret = os.mkdir(cfs_hba_path) if not ret: print "Successfully added TCM/ConfigFS HBA: " + hba_cfs else: print "Unable to create TCM/ConfigFS HBA: " + cfs_hba_path return -1 dev_vfs_alias = cfs_path_tmp[1] print " ConfigFS Device Alias: " + dev_vfs_alias cfs_dev_path = tcm_get_cfs_prefix(cfs_unsplit) if (os.path.isdir(cfs_dev_path)): print "TCM/ConfigFS storage object already exists: " + cfs_dev_path return -1 cfs_path = cfs_path_tmp[0] + "/" + cfs_path_tmp[1] tmp_params = str(value[1]) dev_params = tmp_params.split(' ') plugin_params = dev_params print "Device Params " + str(plugin_params) ret = os.mkdir(cfs_dev_path) if ret: print "Failed to create ConfigFS Storage Object: " + cfs_dev_path + " ret: " + ret | f87b5169f3cb5a25973c98c2566aee7c9ce7268f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8449/f87b5169f3cb5a25973c98c2566aee7c9ce7268f/tcm_node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1715,
81,
67,
2640,
14035,
5206,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
4672,
276,
2556,
67,
318,
4939,
273,
609,
12,
1132,
63,
20,
5717,
276,
2556,
67,
803,
67,
5645,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1715,
81,
67,
2640,
14035,
5206,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
4672,
276,
2556,
67,
318,
4939,
273,
609,
12,
1132,
63,
20,
5717,
276,
2556,
67,
803,
67,
5645,
273,
... |
self.do_val(val, singular, val == vals[-1]) | self.do_val(val, value_prefix, val == vals[-1]) | def do_enum(self, enum): singular = enum.getAttribute('singular') or \ enum.getAttribute('value-prefix') or \ enum.getAttribute('name') | 71c8ccfcbc2f9c0e09ff961af5df6058b31cd788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7593/71c8ccfcbc2f9c0e09ff961af5df6058b31cd788/qt4-constants-gen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
7924,
12,
2890,
16,
2792,
4672,
10048,
273,
2792,
18,
588,
1499,
2668,
17835,
6134,
578,
521,
2792,
18,
588,
1499,
2668,
1132,
17,
3239,
6134,
578,
521,
2792,
18,
588,
1499,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
7924,
12,
2890,
16,
2792,
4672,
10048,
273,
2792,
18,
588,
1499,
2668,
17835,
6134,
578,
521,
2792,
18,
588,
1499,
2668,
1132,
17,
3239,
6134,
578,
521,
2792,
18,
588,
1499,
2... |
EXAMPLES: These computations use pseudo-random numbers, so we set | EXAMPLES: These computations use pseudo-random numbers, so we set | def derived_series(self): """ Return the derived series of this group as a list of permutation groups. EXAMPLES: These computations use pseudo-random numbers, so we set the seed for reproducible testing. :: sage: set_random_seed(0) sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) sage: G.derived_series() # random output [Permutation Group with generators [(1,2,3)(4,5), (3,4)], Permutation Group with generators [(1,5)(3,4), (1,5)(2,4), (2,4)(3,5)]] """ current_randstate().set_seed_gap() ans = [] DS = self._gap_().DerivedSeries() n = DS.Length() for i in range(1,n+1): ans.append(PermutationGroup(DS[i].GeneratorsOfGroup())) return ans | f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10379,
67,
10222,
12,
2890,
4672,
3536,
2000,
326,
10379,
4166,
434,
333,
1041,
487,
279,
666,
434,
17440,
3252,
18,
225,
5675,
8900,
11386,
30,
225,
8646,
5305,
1012,
999,
12454,
17,
91... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10379,
67,
10222,
12,
2890,
4672,
3536,
2000,
326,
10379,
4166,
434,
333,
1041,
487,
279,
666,
434,
17440,
3252,
18,
225,
5675,
8900,
11386,
30,
225,
8646,
5305,
1012,
999,
12454,
17,
91... |
if w.score != 42: | if w.score != 69: | def remove_unreachable(self): """Remove unreachable nodes and dangling edges.""" # Mark reachable nodes from the end for w in self.reverse_breadth(): w.score = 42 # Find and remove unreachable ones begone = {} for i, w in enumerate(self.nodes): if w.score != 42: begone[w] = 1 self.nodes[i] = None self.nodes = [w for w in self.nodes if w != None] # Remove links to unreachable nodes for w in self.nodes: newexits = [] for x in w.exits: if x.dest in begone: pass else: newexits.append(x) w.exits = newexits newentries = [] for x in w.entries: if x.src in begone: pass else: newentries.append(x) w.entries = newentries | 3ca10ecb68dc5fa01bed239a079fe3e145ecdc1a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6303/3ca10ecb68dc5fa01bed239a079fe3e145ecdc1a/lattice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
318,
17246,
12,
2890,
4672,
3536,
3288,
25132,
2199,
471,
302,
539,
2456,
5231,
12123,
468,
6622,
19234,
2199,
628,
326,
679,
364,
341,
316,
365,
18,
9845,
67,
70,
25254,
13332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
318,
17246,
12,
2890,
4672,
3536,
3288,
25132,
2199,
471,
302,
539,
2456,
5231,
12123,
468,
6622,
19234,
2199,
628,
326,
679,
364,
341,
316,
365,
18,
9845,
67,
70,
25254,
13332... |
return [ins for _,ins in self.body if is_jcc(ins.op) or is_dynjump(ins.op)][0] | return [ins for _, ins in self.body if is_jcc(ins.op) or is_dynjump(ins.op)][0] | def get_branch(self): return [ins for _,ins in self.body if is_jcc(ins.op) or is_dynjump(ins.op)][0] | 63b309d6f3838e4cb5c2921faf3bb1472f46245c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4260/63b309d6f3838e4cb5c2921faf3bb1472f46245c/newslice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7500,
12,
2890,
4672,
327,
306,
2679,
364,
389,
16,
2679,
316,
365,
18,
3432,
309,
353,
67,
78,
952,
12,
2679,
18,
556,
13,
578,
353,
67,
28595,
24574,
12,
2679,
18,
556,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7500,
12,
2890,
4672,
327,
306,
2679,
364,
389,
16,
2679,
316,
365,
18,
3432,
309,
353,
67,
78,
952,
12,
2679,
18,
556,
13,
578,
353,
67,
28595,
24574,
12,
2679,
18,
556,
... |
raise ValueError("Block size should be 128, 256 or 256 bits") | raise ValueError("Blocksize should be 16, 24 or 32") | def __init__(self,key,mode,IV,counter,blocksize): if (len(key) not in (16,24,32)) and type(key) is not tuple: raise ValueError("Key should be 128, 256 or 256 bits") if blocksize not in (16,24,32): raise ValueError("Block size should be 128, 256 or 256 bits") cipher_module = rijndael args = {'block_size':blocksize} self.blocksize = blocksize BlockCipher.__init__(self,key,mode,IV,counter,cipher_module,args) | a690e15f692b9637614051020364bf4d64f8a403 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8009/a690e15f692b9637614051020364bf4d64f8a403/python_Rijndael.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
856,
16,
3188,
16,
8188,
16,
7476,
16,
2629,
1467,
4672,
309,
261,
1897,
12,
856,
13,
486,
316,
261,
2313,
16,
3247,
16,
1578,
3719,
471,
618,
12,
856,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
856,
16,
3188,
16,
8188,
16,
7476,
16,
2629,
1467,
4672,
309,
261,
1897,
12,
856,
13,
486,
316,
261,
2313,
16,
3247,
16,
1578,
3719,
471,
618,
12,
856,... |
result = pilotAgentsDB.getPilotInfo(pilotRefs) if not result['OK']: self.log.error('Failed to get pilots info: %s' % result['Message']) | result = pilotAgentsDB.getPilotInfo( pilotRefs ) if not result['OK']: self.log.error( 'Failed to get pilots info: %s' % result['Message'] ) | def updatePilotStatus(self): """ Update status of pilots in transient states """ for queue in self.queueDict: ce = self.queueDict[queue]['CE'] ceName = self.queueDict[queue]['CEName'] queueName = self.queueDict[queue]['QueueName'] result = pilotAgentsDB.selectPilots({'DestinationSite':ceName, 'Queue':queueName, 'GridType':'DIRAC', 'GridSite':self.siteName, 'Status':TRANSIENT_PILOT_STATUS}) if not result['OK']: self.log.error('Failed to select pilots: %s' % result['Message']) continue pilotRefs = result['Value'] if not pilotRefs: continue #print "AT >>> pilotRefs", pilotRefs result = pilotAgentsDB.getPilotInfo(pilotRefs) if not result['OK']: self.log.error('Failed to get pilots info: %s' % result['Message']) continue pilotDict = result['Value'] #print "AT >>> pilotDict", pilotDict result = ce.getJobStatus(pilotRefs) if not result['OK']: self.log.error('Failed to get pilots status from CE: %s' % result['Message']) continue pilotCEDict = result['Value'] #print "AT >>> pilotCEDict", pilotCEDict for pRef in pilotRefs: newStatus = '' oldStatus = pilotDict[pRef]['Status'] ceStatus = pilotCEDict[pRef] if oldStatus == ceStatus: # Status did not change, continue continue elif ceStatus == "Unknown" and not oldStatus in FINAL_PILOT_STATUS: # Pilot finished without reporting, consider it Aborted newStatus = 'Aborted' elif ceStatus != 'Unknown' : # Update the pilot status to the new value newStatus = ceStatus if newStatus: self.log.info('Updating status to %s for pilot %s' % (newStatus,pRef) ) result = pilotAgentsDB.setPilotStatus(pRef,newStatus,'','Updated by SiteDirector') # Retrieve the pilot output now if newStatus in FINAL_PILOT_STATUS: if pilotDict[pRef]['OutputReady'].lower() == 'false' and self.getOutput: self.log.info('Retrieving output for pilot %s' % pRef ) pilotStamp = pilotDict[pRef]['PilotStamp'] pRefStamp = pRef if pilotStamp: pRefStamp = pRef+':::'+pilotStamp result = ce.getJobOutput(pRefStamp) if not result['OK']: self.log.error('Failed to get pilot output: %s' % result['Message']) else: output,error = result['Value'] result = pilotAgentsDB.storePilotOutput(pRef,output,error) if not result['OK']: self.log.error('Failed to store pilot output: %s' % result['Message']) | fecf3d418a4e3a08002c58982e809e7e4b152546 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fecf3d418a4e3a08002c58982e809e7e4b152546/SiteDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
52,
22797,
1482,
12,
2890,
4672,
3536,
2315,
1267,
434,
24970,
6968,
316,
12315,
5493,
3536,
364,
2389,
316,
365,
18,
4000,
5014,
30,
5898,
273,
365,
18,
4000,
5014,
63,
4000,
2396... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
52,
22797,
1482,
12,
2890,
4672,
3536,
2315,
1267,
434,
24970,
6968,
316,
12315,
5493,
3536,
364,
2389,
316,
365,
18,
4000,
5014,
30,
5898,
273,
365,
18,
4000,
5014,
63,
4000,
2396... |
_ret = _reg + " ZEROFILL" | _ret = _ret + " ZEROFILL" | def addSQLAttrs(self, str): _ret = str if str is None or len(str) < 1: return None | 1d9d8f67ac058ee085a01493b02144d777ac7aed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6718/1d9d8f67ac058ee085a01493b02144d777ac7aed/col.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3997,
8262,
12,
2890,
16,
609,
4672,
389,
1349,
273,
609,
309,
609,
353,
599,
578,
562,
12,
701,
13,
411,
404,
30,
327,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3997,
8262,
12,
2890,
16,
609,
4672,
389,
1349,
273,
609,
309,
609,
353,
599,
578,
562,
12,
701,
13,
411,
404,
30,
327,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
It's also not necessary to set theses line as a Subject destructor: | It's also not necessary to set these lines as a Subject destructor: | def clean(self): """ Delete the contents that are stored on disk for this Subject. | fd060612ab239e1de4ad43f442ae9d23e661fbaf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/fd060612ab239e1de4ad43f442ae9d23e661fbaf/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
3536,
2504,
326,
2939,
716,
854,
4041,
603,
4234,
364,
333,
9912,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
3536,
2504,
326,
2939,
716,
854,
4041,
603,
4234,
364,
333,
9912,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
binlib = os.path.join(prefix, 'lib/python/lib') | binlib = os.path.join(exec_prefix, 'lib/python/lib') | def main(): # overridable context prefix = PREFIX # settable with -p option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a # locations derived from options binlib = os.path.join(prefix, 'lib/python/lib') incldir = os.path.join(prefix, 'include/Py') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DHAVE_CONFIG_H', '-DUSE_FROZEN', '-DNO_MAIN', '-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in config_c_in, makefile_in, frozenmain_c: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', config_c, frozen_c, frozenmain_c] + \ addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | bbf003ce64fe627cd70357565d8e6a46983244b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bbf003ce64fe627cd70357565d8e6a46983244b7/freeze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
4418,
273,
5378,
589,
273,
2589,
18,
803,
225,
468,
876,
1390,
12810,
67,
71,
273,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
4418,
273,
5378,
589,
273,
2589,
18,
803,
225,
468,
876,
1390,
12810,
67,
71,
273,
29... |
self.assertRaises(TypeError, list, imap(onearg, N(s))) | self.assertRaises(TypeError, imap, onearg, N(s)) | def test_imap(self): for s in (range(10), range(0), range(100), (7,11), xrange(20,50,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(imap(onearg, g(s))), map(onearg, g(s))) self.assertEqual(list(imap(operator.pow, g(s), g(s))), map(operator.pow, g(s), g(s))) self.assertRaises(TypeError, imap, onearg, X(s)) self.assertRaises(TypeError, list, imap(onearg, N(s))) self.assertRaises(ZeroDivisionError, list, imap(onearg, E(s))) | 5cb6bfcb86589e7d483f1ae2db98f69a231d8a0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/5cb6bfcb86589e7d483f1ae2db98f69a231d8a0b/test_itertools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12161,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
6625,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
3462,
16,
3361,
16,
25,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12161,
12,
2890,
4672,
364,
272,
316,
261,
3676,
12,
2163,
3631,
1048,
12,
20,
3631,
1048,
12,
6625,
3631,
261,
27,
16,
2499,
3631,
12314,
12,
3462,
16,
3361,
16,
25,
3719,
... |
self._cvariables.append(Var(name, descr, self._tmp_type[name])) | var.set_type(self._tmp_type[name]) | def __init__(self, cls, verbosity=0): self._tmp_ivar = {} self._tmp_cvar = {} self._tmp_type = {} ObjDoc.__init__(self, cls, verbosity) | d3395d508175517a8a8289ffc33bd81b4ee231c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/d3395d508175517a8a8289ffc33bd81b4ee231c2/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2028,
16,
11561,
33,
20,
4672,
365,
6315,
5645,
67,
22647,
273,
2618,
365,
6315,
5645,
67,
71,
1401,
273,
2618,
365,
6315,
5645,
67,
723,
273,
2618,
1876... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2028,
16,
11561,
33,
20,
4672,
365,
6315,
5645,
67,
22647,
273,
2618,
365,
6315,
5645,
67,
71,
1401,
273,
2618,
365,
6315,
5645,
67,
723,
273,
2618,
1876... |
print "T -> R:", hex_dump(TR) print "TR == Next(TN, 96):", (pycrypto1.bytes_to_long(TR) ^ TR_x) == crypto1.prng_next(TN_l, 96) | print "T -> R:", hex_dump(TR) print "TR == Next(TN, 96):", (pycrypto1.bytes_to_long(TR) ^ TR_x) == crypto1.prng_next(TN_l, 96) | def hex_dump(string): """Dumps data as hexstrings""" return ' '.join(["%0.2X" % ord(x) for x in string]) | 89bd4c113a22373a47f433c0b409d086180f9265 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4505/89bd4c113a22373a47f433c0b409d086180f9265/mifareauth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
8481,
12,
1080,
4672,
3536,
29225,
501,
487,
3827,
10219,
8395,
327,
296,
2418,
5701,
3816,
28385,
20,
18,
22,
60,
6,
738,
4642,
12,
92,
13,
364,
619,
316,
533,
5717,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
8481,
12,
1080,
4672,
3536,
29225,
501,
487,
3827,
10219,
8395,
327,
296,
2418,
5701,
3816,
28385,
20,
18,
22,
60,
6,
738,
4642,
12,
92,
13,
364,
619,
316,
533,
5717,
225,
... |
self.bind_tasks() | if tasks is None: tasks = self.bind_tasks() | def make_description(self): """ Returns the description of this project, in the context of the settings given. """ self.setup_config() self.bind_tasks() out = StringIO() title = self.title or self.name title = '%s (%s)' % (title, self.project_name) print >> out, underline(title) doc = self.__doc__ if doc == Project.__doc__: doc = '[No project description set]' print >> out, dedent(doc) print >> out print >> out, indent(underline('Settings', '='), ' ') ns = self.create_namespace() if not self.settings: print >> out, indent('No settings', ' ') else: for setting in self.settings: try: setting_value = getattr(ns['config'], setting.name) except Exception, e: setting_value = 'Cannot calculate value: %s %s' % (e.__class__.__name__, e) print >> out, indent(setting.description(value=setting_value), ' ') print >> out print >> out, indent(underline('Tasks', '='), ' ') for task in self.iter_actions(): desc = str(task) print >> out, indent(underline(task.title, '-'), ' ') print >> out, indent(desc, ' ') print >> out if self.depends_on_projects: print >> out, indent(underline('Dependencies', '='), ' ') for project in self.depends_on_projects: print >> out, indent('* %s' % project, ' ') return out.getvalue() | c04155dc1a840f082863591272eb5ee0abc79307 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12796/c04155dc1a840f082863591272eb5ee0abc79307/project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
3384,
12,
2890,
4672,
3536,
2860,
326,
2477,
434,
333,
1984,
16,
316,
326,
819,
434,
326,
1947,
864,
18,
3536,
365,
18,
8401,
67,
1425,
1435,
309,
4592,
353,
599,
30,
4592,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
3384,
12,
2890,
4672,
3536,
2860,
326,
2477,
434,
333,
1984,
16,
316,
326,
819,
434,
326,
1947,
864,
18,
3536,
365,
18,
8401,
67,
1425,
1435,
309,
4592,
353,
599,
30,
4592,
... |
Greene ''' | Greene 5th edition ''' if not exog is None: resid = sm.OLS(y, exog).fit() | def het_breushpagan(y,x): '''Lagrange Multiplier Heteroscedasticity Test by Breush-Pagan Notes ----- assumes x contains constant (for counting dof) need to check this again, is different in Greene p224 References ---------- http://en.wikipedia.org/wiki/Breusch%E2%80%93Pagan_test Greene ''' x = np.asarray(x) y = np.asarray(y)**2 nobs, nvars = x.shape resols = sm.OLS(y, x).fit() fval = resols.fvalue fpval = resols.f_pvalue lm = nobs * resols.rsquared # Note: degrees of freedom for LM test is nvars minus constant return lm, stats.chi2.sf(lm, nvars-1), fval, fpval | 65242e05db93602342fa77d2579bc8cae0fd6ea0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12658/65242e05db93602342fa77d2579bc8cae0fd6ea0/stattools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
278,
67,
6073,
1218,
9095,
304,
12,
93,
16,
92,
4672,
9163,
26093,
3676,
5991,
5742,
670,
847,
538,
3263,
8160,
560,
7766,
635,
605,
266,
1218,
17,
10156,
304,
225,
29584,
9135,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
278,
67,
6073,
1218,
9095,
304,
12,
93,
16,
92,
4672,
9163,
26093,
3676,
5991,
5742,
670,
847,
538,
3263,
8160,
560,
7766,
635,
605,
266,
1218,
17,
10156,
304,
225,
29584,
9135,
1... |
type = get_attr('type') | type = widget.attrib.get('type') | def readSkin(screen, skin, names, desktop): if not isinstance(names, list): names = [names] name = "<embedded-in-'%s'>" % screen.__class__.__name__ # try all skins, first existing one have priority for n in names: myscreen, path = lookupScreen(n) if myscreen is not None: # use this name for debug output name = n break # otherwise try embedded skin myscreen = myscreen or getattr(screen, "parsedSkin", None) # try uncompiled embedded skin if myscreen is None and getattr(screen, "skin", None): print "Looking for embedded skin" myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(screen.skin) #assert myscreen is not None, "no skin for screen '" + repr(names) + "' found!" if myscreen is None: print "No skin to read..." emptySkin = "<screen></screen>" myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(emptySkin) screen.skinAttributes = [ ] skin_path_prefix = getattr(screen, "skin_path", path) collectAttributes(screen.skinAttributes, myscreen, skin_path_prefix, ignore=["name"]) screen.additionalWidgets = [ ] screen.renderer = [ ] visited_components = set() # now walk all widgets for widget in myscreen.findall("widget"): get_attr = widget.attrib.get # ok, we either have 1:1-mapped widgets ('old style'), or 1:n-mapped # widgets (source->renderer). wname = get_attr('name') wsource = get_attr('source') if wname is None and wsource is None: print "widget has no name and no source!" continue if wname: #print "Widget name=", wname visited_components.add(wname) # get corresponding 'gui' object try: attributes = screen[wname].skinAttributes = [ ] except: raise SkinError("component with name '" + wname + "' was not found in skin of screen '" + name + "'!") #print "WARNING: component with name '" + wname + "' was not found in skin of screen '" + name + "'!" | 726a696a8d423d9f994767f2df01e135f07fca96 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/726a696a8d423d9f994767f2df01e135f07fca96/skin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
26827,
12,
9252,
16,
18705,
16,
1257,
16,
21304,
4672,
309,
486,
1549,
12,
1973,
16,
666,
4672,
1257,
273,
306,
1973,
65,
225,
508,
273,
3532,
20722,
17,
267,
6627,
9,
87,
28533,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
26827,
12,
9252,
16,
18705,
16,
1257,
16,
21304,
4672,
309,
486,
1549,
12,
1973,
16,
666,
4672,
1257,
273,
306,
1973,
65,
225,
508,
273,
3532,
20722,
17,
267,
6627,
9,
87,
28533,
... |
Stats.get_stats().inc("_get_bins_idxs") | def _get_bins_idxs(self, obj): Stats.get_stats().inc("_get_bins_idxs") pos = ( float(obj.pos[0]) / self.size[0] * self.cols, float(obj.pos[1]) / self.size[1] * self.rows ) bin_i = int(pos[0]) bin_j = int(pos[1]) i_pos = pos[0] - bin_i j_pos = pos[1] - bin_j | 9b09cf6ef07d2ee54bff2ed908465c95a67128b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4253/9b09cf6ef07d2ee54bff2ed908465c95a67128b1/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
11862,
67,
24156,
12,
2890,
16,
1081,
4672,
949,
273,
261,
1431,
12,
2603,
18,
917,
63,
20,
5717,
342,
365,
18,
1467,
63,
20,
65,
380,
365,
18,
6842,
16,
1431,
12,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
11862,
67,
24156,
12,
2890,
16,
1081,
4672,
949,
273,
261,
1431,
12,
2603,
18,
917,
63,
20,
5717,
342,
365,
18,
1467,
63,
20,
65,
380,
365,
18,
6842,
16,
1431,
12,
26... | |
self.__expiration_label.hide() self.__keep_link.hide() self.__dash.hide() | self._expiration_label.hide() self._keep_link.hide() self._dash.hide() | def handle_keep(widget): messages.KeepVideo(item_info.id).send_to_backend() self.__expiration_label.hide() self.__keep_link.hide() self.__dash.hide() | 70532af449886ebb611f8ff5ded0591d3fc90765 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/70532af449886ebb611f8ff5ded0591d3fc90765/video.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
10102,
12,
6587,
4672,
2743,
18,
11523,
10083,
12,
1726,
67,
1376,
18,
350,
2934,
4661,
67,
869,
67,
9993,
1435,
365,
16186,
19519,
67,
1925,
18,
11248,
1435,
365,
16186,
10102... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
10102,
12,
6587,
4672,
2743,
18,
11523,
10083,
12,
1726,
67,
1376,
18,
350,
2934,
4661,
67,
869,
67,
9993,
1435,
365,
16186,
19519,
67,
1925,
18,
11248,
1435,
365,
16186,
10102... |
if self.debugging: print '--- writing', file | if self.debugging: print '!'*self.debugging, '--- writing', file | def do_node(self, args): self.endnode() self.nodelineno = 0 parts = string.splitfields(args, ',') while len(parts) < 4: parts.append('') for i in range(4): parts[i] = string.strip(parts[i]) self.nodelinks = parts [name, next, prev, up] = parts[:4] file = self.dirname + '/' + makefile(name) if self.filenames.has_key(file): print '*** Filename already in use: ', file else: if self.debugging: print '--- writing', file self.filenames[file] = 1 # self.nodefp = open(file, 'w') self.nodename = name if self.cont and self.nodestack: self.nodestack[-1].cont = self.nodename if not self.topname: self.topname = name title = name if self.title: title = title + ' -- ' + self.title self.node = self.Node(self.dirname, self.nodename, self.topname, title, next, prev, up) | db6f5c4045c0343f80223a59ad6975c71dc11049 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/db6f5c4045c0343f80223a59ad6975c71dc11049/texi2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2159,
12,
2890,
16,
833,
4672,
365,
18,
409,
2159,
1435,
365,
18,
82,
1009,
267,
5764,
273,
374,
2140,
273,
533,
18,
4939,
2821,
12,
1968,
16,
3316,
13,
1323,
562,
12,
6019,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2159,
12,
2890,
16,
833,
4672,
365,
18,
409,
2159,
1435,
365,
18,
82,
1009,
267,
5764,
273,
374,
2140,
273,
533,
18,
4939,
2821,
12,
1968,
16,
3316,
13,
1323,
562,
12,
6019,... |
if not obj.isDownloaded() or obj.isNonVideoFile(): return False try: rv = newlyDownloadedMemory[obj.getID()] except KeyError: rv = (obj.getState() == u"newly-downloaded") newlyDownloadedMemory[obj.getID()] = rv return rv | return (obj.isDownloaded() and not obj.isNonVideoFile() and (obj.getState() == u"newly-downloaded")) | def newWatchableItems(obj): if not obj.isDownloaded() or obj.isNonVideoFile(): return False try: rv = newlyDownloadedMemory[obj.getID()] except KeyError: rv = (obj.getState() == u"newly-downloaded") newlyDownloadedMemory[obj.getID()] = rv return rv | 401a7c9b8d579876a4949bf19a7cd6caf6dfd61d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/401a7c9b8d579876a4949bf19a7cd6caf6dfd61d/filters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
5234,
429,
3126,
12,
2603,
4672,
327,
261,
2603,
18,
291,
4164,
4230,
1435,
471,
486,
1081,
18,
291,
3989,
10083,
812,
1435,
471,
261,
2603,
18,
588,
1119,
1435,
422,
582,
6,
2704... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
5234,
429,
3126,
12,
2603,
4672,
327,
261,
2603,
18,
291,
4164,
4230,
1435,
471,
486,
1081,
18,
291,
3989,
10083,
812,
1435,
471,
261,
2603,
18,
588,
1119,
1435,
422,
582,
6,
2704... |
Globals.app = self | Globals.application = self | def OnInit(self): """ Main application initialization. """ self.applicationResources=None self.association={} self.chandlerDirectory=None self.parcels={} self.storage=None self.model=None self.jabberClient = None self.presenceWindow = None self.chandlerDirectory = os.path.dirname (os.path.abspath (sys.argv[0])) | dd2e0936adb262b1b92258a24f1be45699c9ad8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/dd2e0936adb262b1b92258a24f1be45699c9ad8e/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2570,
12,
2890,
4672,
3536,
12740,
2521,
10313,
18,
3536,
365,
18,
3685,
3805,
33,
7036,
365,
18,
19358,
12938,
365,
18,
343,
464,
749,
2853,
33,
7036,
365,
18,
1065,
2183,
87,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2570,
12,
2890,
4672,
3536,
12740,
2521,
10313,
18,
3536,
365,
18,
3685,
3805,
33,
7036,
365,
18,
19358,
12938,
365,
18,
343,
464,
749,
2853,
33,
7036,
365,
18,
1065,
2183,
87,
1... |
items.append(Playlist(playlist=filename, parent=parent, build=True)) | items.append(Playlist(playlist=filename, parent=parent, display_type=display_type, build=True)) | def get(self, parent, files): """ return a list of items based on the files """ items = [] | d8e93ebc38b517084057c8d56a96856b53de42e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/d8e93ebc38b517084057c8d56a96856b53de42e7/playlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
982,
16,
1390,
4672,
3536,
327,
279,
666,
434,
1516,
2511,
603,
326,
1390,
3536,
1516,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
982,
16,
1390,
4672,
3536,
327,
279,
666,
434,
1516,
2511,
603,
326,
1390,
3536,
1516,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
newFrame.size.width = 824 | newFrame.size.height = 198 | def adjustContent(self, videoWindow, animate): newFrame = self.window().frame() if videoWindow.is_fullscreen: self.playbackControls.setHidden_(NO) newFrame.size.width = 824 else: self.playbackControls.setHidden_(YES) newFrame.size.width = 516 newFrame.origin.x = self.getHorizontalPosition(videoWindow, newFrame.size.width) self.window().setFrame_display_animate_(newFrame, YES, animate) | 89d9138373ff2ef66014f5b54b00c65e984fba71 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/89d9138373ff2ef66014f5b54b00c65e984fba71/overlay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5765,
1350,
12,
2890,
16,
6191,
3829,
16,
14671,
4672,
394,
3219,
273,
365,
18,
5668,
7675,
3789,
1435,
309,
6191,
3829,
18,
291,
67,
2854,
9252,
30,
365,
18,
1601,
823,
16795,
18,
542... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5765,
1350,
12,
2890,
16,
6191,
3829,
16,
14671,
4672,
394,
3219,
273,
365,
18,
5668,
7675,
3789,
1435,
309,
6191,
3829,
18,
291,
67,
2854,
9252,
30,
365,
18,
1601,
823,
16795,
18,
542... |
sysctls = setup_shm_sysctl(64*1048576) do_test("shm-perms") restore_shm_sysctl(sysctls) | do_shm_test("shm-perms", 64*1024*1024) | def functional_tests(): """ Run the set of functional tests. """ global linkhuge_wordsizes # Kernel background tests not requiring hugepage support do_test("zero_filesize_segment") # Library background tests not requiring hugepage support do_test("test_root") do_test("meminfo_nohuge") # Library tests requiring kernel hugepage support do_test("gethugepagesize") do_test("gethugepagesizes") do_test("empty_mounts", HUGETLB_VERBOSE="1") do_test("large_mounts", HUGETLB_VERBOSE="1") # Tests requiring an active and usable hugepage mount do_test("find_path") do_test("unlinked_fd") do_test("readback") do_test("truncate") do_test("shared") do_test("mprotect") do_test_with_rlimit(resource.RLIMIT_MEMLOCK, -1, "mlock") do_test("misalign") # Specific kernel bug tests do_test("ptrace-write-hugepage") do_test("icache-hygiene") do_test("slbpacaflush") do_test("straddle_4GB", bits=(64,)) do_test("huge_at_4GB_normal_below", bits=(64,)) do_test("huge_below_4GB_normal_above", bits=(64,)) do_test("map_high_truncate_2") do_test("misaligned_offset") do_test("truncate_above_4GB") do_test("brk_near_huge") do_test("task-size-overrun") do_test_with_rlimit(resource.RLIMIT_STACK, -1, "stack_grow_into_huge") if dangerous == 1: do_test("readahead_reserve") do_test("madvise_reserve") do_test("fadvise_reserve") else: do_test("readahead_reserve.sh") do_test("madvise_reserve.sh") do_test("fadvise_reserve.sh") sysctls = setup_shm_sysctl(64*1048576) do_test("shm-perms") restore_shm_sysctl(sysctls) # Tests requiring an active mount and hugepage COW do_test("private") do_test("fork-cow") do_test("direct") do_test("malloc") do_test("malloc", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes") do_test("malloc_manysmall") do_test("malloc_manysmall", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes") do_test("heapshrink") do_test("heapshrink", LD_PRELOAD="libheapshrink.so") do_test("heapshrink", LD_PRELOAD="libhugetlbfs.so", HUGETLB_MORECORE="yes") do_test("heapshrink", LD_PRELOAD="libhugetlbfs.so libheapshrink.so", HUGETLB_MORECORE="yes") do_test("heapshrink", LD_PRELOAD="libheapshrink.so", HUGETLB_MORECORE="yes", HUGETLB_MORECORE_SHRINK="es") do_test("heapshrink", LD_PRELOAD="libhugetlbfs.so libheapshrink.so", HUGETLB_MORECORE="yes", HUGETLB_MORECORE_SHRINK="yes") do_test("heap-overflow", HUGETLB_VERBOSE="1", HUGETLB_MORECORE="yes") # Run the remapping tests' up-front checks linkhuge_wordsizes = check_linkhuge_tests() # Original elflink tests elflink_test("linkhuge_nofd", HUGETLB_VERBOSE="0") elflink_test("linkhuge") # Original elflink sharing tests elfshare_test("linkshare") elflink_and_share_test("linkhuge") # elflink_rw tests elflink_rw_test("linkhuge_rw") # elflink_rw sharing tests elflink_rw_and_share_test("linkhuge_rw") # Accounting bug tests # reset free hpages because sharing will have held some # alternatively, use do_test("chunk-overcommit") do_test(("alloc-instantiate-race", "shared")) do_test(("alloc-instantiate-race", "private")) do_test("truncate_reserve_wraparound") do_test("truncate_sigbus_versus_oom") # Test direct allocation API do_test("get_huge_pages") # Test overriding of shmget() do_test("shmoverride_linked") do_test("shmoverride_unlinked", LD_PRELOAD="libhugetlbfs.so") # Test hugetlbfs filesystem quota accounting do_test("quota.sh") # Test accounting of HugePages_{Total|Free|Resv|Surp} # Alters the size of the hugepage pool so should probably be run last do_test("counters.sh") | c5f56f187505f039ebb692a615fefe766830b210 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3715/c5f56f187505f039ebb692a615fefe766830b210/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18699,
67,
16341,
13332,
3536,
1939,
326,
444,
434,
18699,
7434,
18,
3536,
2552,
1692,
76,
21627,
67,
3753,
3128,
225,
468,
14556,
5412,
7434,
486,
29468,
366,
637,
17600,
2865,
741,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18699,
67,
16341,
13332,
3536,
1939,
326,
444,
434,
18699,
7434,
18,
3536,
2552,
1692,
76,
21627,
67,
3753,
3128,
225,
468,
14556,
5412,
7434,
486,
29468,
366,
637,
17600,
2865,
741,
67,
... |
sage: R == loads(dumps(R)) True | sage: TestSuite(R).run() | def __init__(self, ct, base_ring, prefix, cache, style): """ EXAMPLES:: | 7fa05b949ce753ba0d48f2e6f5125e6333b0ed1c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7fa05b949ce753ba0d48f2e6f5125e6333b0ed1c/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5691,
16,
1026,
67,
8022,
16,
1633,
16,
1247,
16,
2154,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5691,
16,
1026,
67,
8022,
16,
1633,
16,
1247,
16,
2154,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
l = changed.items() l.sort() for propname, oldvalue in l: | changed_items = changed.items() changed_items.sort() for propname, oldvalue in changed_items: | def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ if not isinstance(oldvalues, type({})): raise TypeError("'oldvalues' must be dict-like, not %s."% type(oldvalues)) | 4fb45a00e50dd335e0ee2308edb4b7e10dc3d794 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4fb45a00e50dd335e0ee2308edb4b7e10dc3d794/roundupdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3043,
8067,
12,
2890,
16,
756,
350,
16,
1592,
2372,
4672,
3536,
4625,
279,
2549,
4721,
716,
6035,
1272,
3478,
3536,
309,
486,
1549,
12,
1673,
2372,
16,
618,
23506,
3719,
30,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
3043,
8067,
12,
2890,
16,
756,
350,
16,
1592,
2372,
4672,
3536,
4625,
279,
2549,
4721,
716,
6035,
1272,
3478,
3536,
309,
486,
1549,
12,
1673,
2372,
16,
618,
23506,
3719,
30,
1002,
... |
return self.indexmanager.index(props, path) | self.indexmanager.index(props, path) return uid | def create(self, props, filelike, can_move=False): if filelike: uid = self.indexmanager.index(props, None) if isinstance(filelike, basestring): # lets treat it as a filename filelike = open(filelike, "r") filelike.seek(0) path = self._writeContent(uid, filelike, replace=False, can_move=can_move) return self.indexmanager.index(props, path) else: return self.indexmanager.index(props) | 0a7e80f01ac0f96b15d1eeeda3386be40b8a9b7c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9394/0a7e80f01ac0f96b15d1eeeda3386be40b8a9b7c/backingstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
3458,
16,
661,
292,
2547,
16,
848,
67,
8501,
33,
8381,
4672,
309,
661,
292,
2547,
30,
4555,
273,
365,
18,
1615,
4181,
18,
1615,
12,
9693,
16,
599,
13,
309,
1549,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
3458,
16,
661,
292,
2547,
16,
848,
67,
8501,
33,
8381,
4672,
309,
661,
292,
2547,
30,
4555,
273,
365,
18,
1615,
4181,
18,
1615,
12,
9693,
16,
599,
13,
309,
1549,
... |
cPickle.dumps(C()) | cPickle.dumps(C(), 0) | def pickleslots(): if verbose: print("Testing pickling of classes with __slots__ ...") import pickle, pickle as cPickle # Pickling of classes with __slots__ but without __getstate__ should fail global B, C, D, E class B(object): pass for base in [object, B]: class C(base): __slots__ = ['a'] class D(C): pass try: pickle.dumps(C()) except TypeError: pass else: raise TestFailed, "should fail: pickle C instance - %s" % base try: cPickle.dumps(C()) except TypeError: pass else: raise TestFailed, "should fail: cPickle C instance - %s" % base try: pickle.dumps(C()) except TypeError: pass else: raise TestFailed, "should fail: pickle D instance - %s" % base try: cPickle.dumps(D()) except TypeError: pass else: raise TestFailed, "should fail: cPickle D instance - %s" % base # Give C a nice generic __getstate__ and __setstate__ class C(base): __slots__ = ['a'] def __getstate__(self): try: d = self.__dict__.copy() except AttributeError: d = {} for cls in self.__class__.__mro__: for sn in cls.__dict__.get('__slots__', ()): try: d[sn] = getattr(self, sn) except AttributeError: pass return d def __setstate__(self, d): for k, v in d.items(): setattr(self, k, v) class D(C): pass # Now it should work x = C() y = pickle.loads(pickle.dumps(x)) vereq(hasattr(y, 'a'), 0) y = cPickle.loads(cPickle.dumps(x)) vereq(hasattr(y, 'a'), 0) x.a = 42 y = pickle.loads(pickle.dumps(x)) vereq(y.a, 42) y = cPickle.loads(cPickle.dumps(x)) vereq(y.a, 42) x = D() x.a = 42 x.b = 100 y = pickle.loads(pickle.dumps(x)) vereq(y.a + y.b, 142) y = cPickle.loads(cPickle.dumps(x)) vereq(y.a + y.b, 142) # A subclass that adds a slot should also work class E(C): __slots__ = ['b'] x = E() x.a = 42 x.b = "foo" y = pickle.loads(pickle.dumps(x)) vereq(y.a, x.a) vereq(y.b, x.b) y = cPickle.loads(cPickle.dumps(x)) vereq(y.a, x.a) vereq(y.b, x.b) | 85def692392804d753756cd126aaeef97a432a2c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/85def692392804d753756cd126aaeef97a432a2c/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
1040,
80,
6968,
13332,
309,
3988,
30,
1172,
2932,
22218,
6002,
2456,
434,
3318,
598,
1001,
18875,
972,
1372,
7923,
1930,
13379,
16,
13379,
487,
276,
17968,
298,
468,
23038,
2456,
434... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
1040,
80,
6968,
13332,
309,
3988,
30,
1172,
2932,
22218,
6002,
2456,
434,
3318,
598,
1001,
18875,
972,
1372,
7923,
1930,
13379,
16,
13379,
487,
276,
17968,
298,
468,
23038,
2456,
434... |
(x1, y1)= real_item.get_canvas().convert_to_item_space(parent, bounds.x1, bounds.y1) (x2, y2)= real_item.get_canvas().convert_to_item_space(parent, bounds.x2, bounds.y2) | (x1, y1)= \ real_item.get_canvas().convert_to_item_space(parent, bounds.x1, bounds.y1) (x2, y2)= \ real_item.get_canvas().convert_to_item_space(parent, bounds.x2, bounds.y2) mx1 = min(x1, x2) my1 = min(y1, y2) x2 = max(x1, x2) y2 = max(y1, y2) x1 = mx1 y1 = my1 | def resize_item_event(self, item, target, event, anchor_type): if self.running: return | 7ff7be5bf755c0cd8d1824d7b1325b6c755ab74a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11306/7ff7be5bf755c0cd8d1824d7b1325b6c755ab74a/anim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
67,
1726,
67,
2575,
12,
2890,
16,
761,
16,
1018,
16,
871,
16,
6984,
67,
723,
4672,
309,
365,
18,
8704,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
67,
1726,
67,
2575,
12,
2890,
16,
761,
16,
1018,
16,
871,
16,
6984,
67,
723,
4672,
309,
365,
18,
8704,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
"Missing cif modification: data_mod_%s\n" % apply.data_mod | "Missing CIF modification: data_mod_%s\n" % apply.data_mod | def process_apply_cif_modification(self, mon_lib_srv, log): self.apply_cif_modifications = {} sel_cache = None aal = self.stage_1.atom_attributes_list for apply in self.params.apply_cif_modification: if (apply.data_mod is None): continue print >> log, " apply_cif_modification:" print >> log, " data_mod:", apply.data_mod mod = mon_lib_srv.mod_mod_id_dict.get(apply.data_mod) if (mod is None): print >> log raise Sorry( "Missing cif modification: data_mod_%s\n" % apply.data_mod + " Please check for spelling errors or specify the file name\n" + " with the modification as an additional argument.") print >> log, " residue_selection:", apply.residue_selection if (sel_cache is None): sel_cache = self.stage_1.selection_cache() iselection = self.phil_atom_selection( cache=sel_cache, scope_extract=apply, attr="residue_selection").iselection() unique_residue_keys = {} for i_seq in iselection: unique_residue_keys[aal[i_seq].residue_and_model_labels()] = None for key in unique_residue_keys: self.apply_cif_modifications.setdefault(key, []).append( apply.data_mod) | 9ee78a991c928e4e2fb605e620d5170ffb367aaf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/9ee78a991c928e4e2fb605e620d5170ffb367aaf/pdb_interpretation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
9010,
67,
30674,
67,
31064,
12,
2890,
16,
6921,
67,
2941,
67,
20818,
16,
613,
4672,
365,
18,
9010,
67,
30674,
67,
1711,
6640,
273,
2618,
357,
67,
2493,
273,
599,
279,
287,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
9010,
67,
30674,
67,
31064,
12,
2890,
16,
6921,
67,
2941,
67,
20818,
16,
613,
4672,
365,
18,
9010,
67,
30674,
67,
1711,
6640,
273,
2618,
357,
67,
2493,
273,
599,
279,
287,
... |
def save_float(self, object): self.write(FLOAT + `object` + '\n') | def save_float(self, object, pack=struct.pack): if self.bin: self.write(BINFLOAT + pack('>d', object)) else: self.write(FLOAT + `object` + '\n') | def save_float(self, object): self.write(FLOAT + `object` + '\n') | b71c45dff2998a741337d10d17805f110aef88be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b71c45dff2998a741337d10d17805f110aef88be/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
5659,
12,
2890,
16,
733,
4672,
365,
18,
2626,
12,
15640,
397,
1375,
1612,
68,
397,
2337,
82,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
5659,
12,
2890,
16,
733,
4672,
365,
18,
2626,
12,
15640,
397,
1375,
1612,
68,
397,
2337,
82,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return plot(funcs, tmin, tmax, parametric=True, **kwargs) | kwargs['parametric'] = True return plot(funcs, *args, **kwargs) | def parametric_plot(funcs, tmin, tmax, **kwargs): r""" \code{parametric_plot} takes two or three functions as a list or a tuple and makes a plot with the first function giving the $x$ coordinates, the second function giving the $y$ coordinates, and the third function (if present) giving the $z$ coordinates. INPUT: funcs -- 2 or 3-tuple of functions tmin -- start value of t tmax -- end value of t other options -- passed to plot. EXAMPLES: We draw some 2d parametric plots: sage: t = var('t') sage: parametric_plot( (sin(t), sin(2*t)), 0, 2*pi, rgbcolor=hue(0.6) ) sage: parametric_plot((1, t), 0, 4) sage: parametric_plot((t, t^2), -4, 4) We draw a 3d parametric plot: sage: parametric_plot3d( (5*cos(x), 5*sin(x), x), (-12, 12), plot_points=150, color="red") TESTS: sage: parametric_plot((x, t^2), -4, 4) Traceback (most recent call last): ... ValueError: there cannot be more than one free variable in funcs sage: parametric_plot((1, x+t), -4, 4) Traceback (most recent call last): ... ValueError: there cannot be more than one free variable in funcs """ if len(funcs) == 3: raise ValueError, "use parametric_plot3d for parametric plots in 3d dimensions." elif len(funcs) != 2: raise ValueError, "parametric plots only implemented in 2 and 3 dimensions." else: vars = [] f,g = funcs if hasattr(f, 'variables'): vars += list(f.variables()) if hasattr(g, 'variables'): vars += list(g.variables()) vars = [str(v) for v in vars] from sage.misc.misc import uniq if len(uniq(vars)) > 1: raise ValueError, "there cannot be more than one free variable in funcs" return plot(funcs, tmin, tmax, parametric=True, **kwargs) | 48280e868451e9ce9627c06c961c35617c602f61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/48280e868451e9ce9627c06c961c35617c602f61/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
579,
1591,
67,
4032,
12,
17728,
16,
268,
1154,
16,
28986,
16,
2826,
4333,
4672,
436,
8395,
521,
710,
95,
891,
1591,
67,
4032,
97,
5530,
2795,
578,
8925,
4186,
487,
279,
666,
578,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
579,
1591,
67,
4032,
12,
17728,
16,
268,
1154,
16,
28986,
16,
2826,
4333,
4672,
436,
8395,
521,
710,
95,
891,
1591,
67,
4032,
97,
5530,
2795,
578,
8925,
4186,
487,
279,
666,
578,
279,
... |
res = self.__getFileIDsForLfns(resDict['Successful'].keys(),connection=connection) if not res['OK']: return res fileIDs,lfnFilesIDs = res['Value'] | res = self.__getFileIDsForLfns( resDict['Successful'].keys(), connection = connection ) if not res['OK']: return res fileIDs, lfnFilesIDs = res['Value'] | def setFileUsedSEForTransformation(self,transName,usedSE,lfns,connection=False): """ Set the UsedSE for supplied files and the Status = 'Processed' """ res = self._getConnectionTransID(connection,transName) if not res['OK']: return res connection = res['Value']['Connection'] transID = res['Value']['TransformationID'] res = self.setFileStatusForTransformation(transID,'Processed',lfns,connection=connection) if not res['OK']: return res resDict = res['Value'] res = self.__getFileIDsForLfns(resDict['Successful'].keys(),connection=connection) if not res['OK']: return res fileIDs,lfnFilesIDs = res['Value'] updateUsedSE = [] for lfn,message in resDict['Successful'].items(): if message == 'Status updated to Processed': updateUsedSE.append(lfnFilesIDs[lfn]) if updateUsedSE: print self.__setTransformationFileUsedSE(updateUsedSE,usedSE,connection=connection) return S_OK(resDict) | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19658,
6668,
1090,
1290,
15292,
12,
2890,
16,
2338,
461,
16,
3668,
1090,
16,
20850,
2387,
16,
4071,
33,
8381,
4672,
3536,
1000,
326,
10286,
1090,
364,
4580,
1390,
471,
326,
2685,
273,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19658,
6668,
1090,
1290,
15292,
12,
2890,
16,
2338,
461,
16,
3668,
1090,
16,
20850,
2387,
16,
4071,
33,
8381,
4672,
3536,
1000,
326,
10286,
1090,
364,
4580,
1390,
471,
326,
2685,
273,
29... |
store.append([text]) | store.append(to_install_iter, [text]) | def alpm_install_targets(self, targets, repo = None): # TODO: check if there's something searched for or a repo selected, and # update the pkg_treeview accordingly self.busy_status_label = self.all_widgets.get_widget('busy_status_label') number_pkgs_to_download =\ self.alpm_get_number_of_packages_to_download(targets) | 406465af1625206c1b85268c2a144f8c51a0f1af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2759/406465af1625206c1b85268c2a144f8c51a0f1af/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
524,
7755,
67,
5425,
67,
11358,
12,
2890,
16,
5774,
16,
3538,
273,
599,
4672,
468,
2660,
30,
866,
309,
1915,
1807,
5943,
19242,
364,
578,
279,
3538,
3170,
16,
471,
468,
1089,
326,
3475... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
524,
7755,
67,
5425,
67,
11358,
12,
2890,
16,
5774,
16,
3538,
273,
599,
4672,
468,
2660,
30,
866,
309,
1915,
1807,
5943,
19242,
364,
578,
279,
3538,
3170,
16,
471,
468,
1089,
326,
3475... |
j = 0 | index = 0 | def _update_keymap(self, first_keycode, count): | 80f735cdc64cf9832b6079c69a006032251351c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8084/80f735cdc64cf9832b6079c69a006032251351c1/display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
856,
1458,
12,
2890,
16,
1122,
67,
856,
710,
16,
1056,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
856,
1458,
12,
2890,
16,
1122,
67,
856,
710,
16,
1056,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
default_name=' %s (Copy)' % data.name super(dm_campaign_proposition, self).write(cr, uid, proposition_id, {'name':default_name, 'date_start':False, 'initial_proposition_id':id}) | default_name = ' %s (Copy)' % data.name super(dm_campaign_proposition, self).write(cr, uid, proposition_id, {'name': default_name, 'date_start': False, 'initial_proposition_id': id}) | def copy(self, cr, uid, id, default=None, context={}): """ Function to duplicate segments only if 'keep_segments' is set to yes else not to duplicate segments """ proposition_id = super(dm_campaign_proposition, self).copy(cr, uid, id, default, context=context) if 'camp_id' in default and default['camp_id']: self.write(cr, uid, proposition_id, {'camp_id' : default['camp_id']}) | 7ee897432c7e7d5a5c8e889fc429c3c1b66627fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/7ee897432c7e7d5a5c8e889fc429c3c1b66627fd/dm_campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
819,
12938,
4672,
3536,
4284,
358,
6751,
5155,
1338,
309,
296,
10102,
67,
12838,
11,
353,
444,
358,
12465,
469,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
805,
33,
7036,
16,
819,
12938,
4672,
3536,
4284,
358,
6751,
5155,
1338,
309,
296,
10102,
67,
12838,
11,
353,
444,
358,
12465,
469,
486,... |
return | return None | def newJob(self): """ _newJob_ | b71b0eed54d6374c9d695e9c104870d495d8a924 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/b71b0eed54d6374c9d695e9c104870d495d8a924/ReqInjComponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2278,
12,
2890,
4672,
3536,
389,
2704,
2278,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2278,
12,
2890,
4672,
3536,
389,
2704,
2278,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return Task.cont | return task.cont | def listenerPoll(self, task): if self.qcl.newConnectionAvailable(): rendezvous = PointerToConnection() netAddress = NetAddress() newConnection = PointerToConnection() retVal = self.qcl.getNewConnection(rendezvous, netAddress, newConnection) if not retVal: return | b04679f9e6c82b4862638364e7c858736f7abeeb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/b04679f9e6c82b4862638364e7c858736f7abeeb/ServerRepository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2991,
19085,
12,
2890,
16,
1562,
4672,
309,
365,
18,
85,
830,
18,
2704,
1952,
5268,
13332,
1654,
323,
94,
90,
1481,
273,
7107,
774,
1952,
1435,
2901,
1887,
273,
8503,
1887,
1435,
394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2991,
19085,
12,
2890,
16,
1562,
4672,
309,
365,
18,
85,
830,
18,
2704,
1952,
5268,
13332,
1654,
323,
94,
90,
1481,
273,
7107,
774,
1952,
1435,
2901,
1887,
273,
8503,
1887,
1435,
394,
... |
""" Return a compact representation of a revision in the repos. """ | """Return a compact representation of a revision in the repos.""" | def short_rev(self, rev): """ Return a compact representation of a revision in the repos. """ return self.normalize_rev(rev) | 0091f73d9ddb2e28de9da1a025ba0c0cfaf2b458 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0091f73d9ddb2e28de9da1a025ba0c0cfaf2b458/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
67,
9083,
12,
2890,
16,
5588,
4672,
3536,
990,
279,
6739,
4335,
434,
279,
6350,
316,
326,
13686,
12123,
327,
365,
18,
12237,
67,
9083,
12,
9083,
13,
225,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
67,
9083,
12,
2890,
16,
5588,
4672,
3536,
990,
279,
6739,
4335,
434,
279,
6350,
316,
326,
13686,
12123,
327,
365,
18,
12237,
67,
9083,
12,
9083,
13,
225,
2,
-100,
-100,
-100,
-10... |
pass def update_visit(self, visit_key, expiry): pass def shutdown(self, timeout=None): pass def run(self): pass | '''Update the visit information on the server''' fas = BaseClient(self.fasURL, self.debug) for visit_key in queue: log.info("updating visit (%s)", visit_key) fas._sessionCookie = Cookie.SimpleCookie() fas._sessionCookie[self.cookieName] = visit_key data = fas.send_request('', auth=True) fas.send_request() | def update_queued_visits(self, queue): # Let the visit_manager on the FAS server manage this pass | 89251d7d57c5642c0d3984777ffb3e442526d505 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9952/89251d7d57c5642c0d3984777ffb3e442526d505/jsonfasvisit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
19499,
67,
3516,
1282,
12,
2890,
16,
2389,
4672,
468,
10559,
326,
3757,
67,
4181,
603,
326,
478,
3033,
1438,
10680,
333,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
19499,
67,
3516,
1282,
12,
2890,
16,
2389,
4672,
468,
10559,
326,
3757,
67,
4181,
603,
326,
478,
3033,
1438,
10680,
333,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
remove_set, add_set, replace_tags = googlecl.base.generate_tag_sets(tags) | from atom import Summary if tags is not None: remove_set, add_set, replace_tags = googlecl.base.generate_tag_sets(tags) | def tag_photos(self, photo_entries, tags): """Add or remove tags on a list of photos. | 60e1dd6903c0672676ed9ac2602940222c65a007 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/60e1dd6903c0672676ed9ac2602940222c65a007/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
67,
29121,
12,
2890,
16,
10701,
67,
8219,
16,
2342,
4672,
3536,
986,
578,
1206,
2342,
603,
279,
666,
434,
18185,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1047,
67,
29121,
12,
2890,
16,
10701,
67,
8219,
16,
2342,
4672,
3536,
986,
578,
1206,
2342,
603,
279,
666,
434,
18185,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
raise ExtractError, "could not change owner" | raise ExtractError("could not change owner") | def chown(self, tarinfo, targetpath): """Set owner of targetpath according to tarinfo. """ if pwd and hasattr(os, "geteuid") and os.geteuid() == 0: # We have to be root to do so. try: g = grp.getgrnam(tarinfo.gname)[2] except KeyError: try: g = grp.getgrgid(tarinfo.gid)[2] except KeyError: g = os.getgid() try: u = pwd.getpwnam(tarinfo.uname)[2] except KeyError: try: u = pwd.getpwuid(tarinfo.uid)[2] except KeyError: u = os.getuid() try: if tarinfo.issym() and hasattr(os, "lchown"): os.lchown(targetpath, u, g) else: if sys.platform != "os2emx": os.chown(targetpath, u, g) except EnvironmentError, e: raise ExtractError, "could not change owner" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
462,
995,
12,
2890,
16,
8232,
1376,
16,
1018,
803,
4672,
3536,
694,
3410,
434,
1018,
803,
4888,
358,
8232,
1376,
18,
3536,
309,
14720,
471,
3859,
12,
538,
16,
315,
588,
73,
1911,
7923,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
462,
995,
12,
2890,
16,
8232,
1376,
16,
1018,
803,
4672,
3536,
694,
3410,
434,
1018,
803,
4888,
358,
8232,
1376,
18,
3536,
309,
14720,
471,
3859,
12,
538,
16,
315,
588,
73,
1911,
7923,... |
MarkerInterface,\ | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) for child in contents: component = SplitQName(child.getTagName())[1] if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(child) continue break else: return if component == 'restriction': self.content = self.__class__.Restriction(self) elif component == 'list': self.content = self.__class__.List(self) elif component == 'union': self.content = self.__class__.Union(self) else: raise SchemaError, 'Unknown component (%s)' %(component) self.content.fromDom(child) | 6c6678d8443cc0ac1425216db36bdd74c2f8cb7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6c6678d8443cc0ac1425216db36bdd74c2f8cb7b/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
364,
1151,
316,
2939,
30,
1794,
273,
5385,
13688,
12,
3624,
18,
588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
364,
1151,
316,
2939,
30,
1794,
273,
5385,
13688,
12,
3624,
18,
588... | |
c['MOIN_ID']['path'] = path | c[cookie_name]['path'] = path | def makeCookie(request, moin_id, maxage, expires): """ calculate a MOIN_ID cookie """ c = Cookie.SimpleCookie() cfg = request.cfg c['MOIN_ID'] = moin_id c['MOIN_ID']['max-age'] = maxage if cfg.cookie_domain: c['MOIN_ID']['domain'] = cfg.cookie_domain if cfg.cookie_path: c['MOIN_ID']['path'] = cfg.cookie_path else: path = request.getScriptname() if not path: path = '/' c['MOIN_ID']['path'] = path # Set expires for older clients c['MOIN_ID']['expires'] = request.httpDate(when=expires, rfc='850') return c.output() | 52d72a54d36dd3229ef30015f18438b64a2efc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/52d72a54d36dd3229ef30015f18438b64a2efc64/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
6151,
12,
2293,
16,
312,
885,
67,
350,
16,
943,
410,
16,
7368,
4672,
3536,
4604,
279,
490,
6266,
67,
734,
3878,
3536,
276,
273,
10201,
18,
5784,
6151,
1435,
2776,
273,
590,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
6151,
12,
2293,
16,
312,
885,
67,
350,
16,
943,
410,
16,
7368,
4672,
3536,
4604,
279,
490,
6266,
67,
734,
3878,
3536,
276,
273,
10201,
18,
5784,
6151,
1435,
2776,
273,
590,
18,
... |
ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.3">'] | ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.4">'] | def buildXML(comments, email, optional, required): """ Given the possible fields in the error dialog, build an XML file of the data. """ ret = ['<feedback xmlns="http://osafoundation.org/xmlns/feedback" version="0.3">'] # The required field consists of field: value lines, followed by either # traceback or arbitrary output that was printed to stdout or stderr. lastElem = '' for line in required.GetValue().split('\n'): if lastElem == '': sep = line.find(':') if line.startswith('Traceback'): lastElem = 'traceback' ret.append('<%s>' % lastElem) ret.append(escape(line)) elif sep < 0: lastElem = 'output' ret.append('<%s>' % lastElem) ret.append(escape(line)) else: field = line[:sep].replace(' ', '-') value = line[sep + 1:].strip() ret.append('<%s>%s</%s>' % (field, escape(value), field)) else: ret.append(escape(line)) if lastElem != '': ret.append('</%s>' % lastElem) # Optional email ret.append('<email>%s</email>' % escape(email.GetValue())) # Optional comments ret.append('<comments>') ret.append(escape(comments.GetValue())) ret.append('</comments>') # Optional system information and logs for i in range(optional.GetItemCount()): field = optional.GetItem(i, 0).GetText() value = optional.GetItem(i, 1).GetText() ret.append('<%s>%s</%s>' % (field, escape(value), field)) ret.append('</feedback>') s = '\n'.join(ret) if isinstance(s, unicode): s = s.encode('utf8') return s | 9ba90be76cdb160407265d4d3334a370bc71f15a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/9ba90be76cdb160407265d4d3334a370bc71f15a/feedback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
4201,
12,
9231,
16,
2699,
16,
3129,
16,
1931,
4672,
3536,
16803,
326,
3323,
1466,
316,
326,
555,
6176,
16,
1361,
392,
3167,
585,
434,
326,
501,
18,
3536,
325,
273,
10228,
32,
125... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
4201,
12,
9231,
16,
2699,
16,
3129,
16,
1931,
4672,
3536,
16803,
326,
3323,
1466,
316,
326,
555,
6176,
16,
1361,
392,
3167,
585,
434,
326,
501,
18,
3536,
325,
273,
10228,
32,
125... |
s = s + '%s:%s,' % (k, self._properties[k]) | value = getattr( self, k, self._properties[k] ) if k == 'widget': value = value.__class__.__name__ s = s + '%s:%s,' % (k, value ) | def toString(self): """Utility method for converting a Field to a string for the purpose of comparing fields. This comparison is used for determining whether a schema has changed in the auto update function. Right now it's pretty crude.""" # XXX fixme s = '%s: {' % self.__class__.__name__ sorted_keys = self._properties.keys() sorted_keys.sort() for k in sorted_keys: s = s + '%s:%s,' % (k, self._properties[k]) s = s + '}' return s | ce18ea6851443c561d3f359843304d34e49b66e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/ce18ea6851443c561d3f359843304d34e49b66e9/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1762,
12,
2890,
4672,
3536,
6497,
707,
364,
14540,
279,
2286,
358,
279,
533,
364,
326,
13115,
434,
17553,
1466,
18,
225,
1220,
5826,
353,
1399,
364,
23789,
2856,
279,
1963,
711,
3550,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1762,
12,
2890,
4672,
3536,
6497,
707,
364,
14540,
279,
2286,
358,
279,
533,
364,
326,
13115,
434,
17553,
1466,
18,
225,
1220,
5826,
353,
1399,
364,
23789,
2856,
279,
1963,
711,
3550,
31... |
return "cannot use -d with -i or -o" | return "cannot use "+flag+" with -i or -o" | def change(ui, repo, *pats, **opts): """create or edit a change list Create or edit a change list. A change list is a group of files to be reviewed and submitted together, plus a textual description of the change. Change lists are referred to by simple alphanumeric names. Changes must be reviewed before they can be submitted. In the absence of options, the change command opens the change list for editing in the default editor. """ dirty = {} if len(pats) > 0 and GoodCLName(pats[0]): name = pats[0] if len(pats) != 1: return "cannot specify CL name and file patterns" pats = pats[1:] cl, err = LoadCL(ui, repo, name, web=True) if err != '': return err if not cl.local and (opts["stdin"] or not opts["stdout"]): return "cannot change non-local CL " + name else: name = "new" cl = CL("new") dirty[cl] = True files = ChangedFiles(ui, repo, pats, opts) taken = TakenFiles(ui, repo) files = Sub(files, taken) if opts["delete"]: if name == "new": return "cannot use -d with file patterns" if opts["stdin"] or opts["stdout"]: return "cannot use -d with -i or -o" if not cl.local: return "cannot change non-local CL " + name PostMessage(cl.name, "*** Abandoned ***", send_mail="checked") EditDesc(cl.name, closed="checked") cl.Delete(ui, repo) return if opts["stdin"]: s = sys.stdin.read() clx, line, err = ParseCL(s, name) if err != '': return "error parsing change list: line %d: %s" % (line, err) if clx.desc is not None: cl.desc = clx.desc; dirty[cl] = True if clx.reviewer is not None: cl.reviewer = clx.reviewer dirty[cl] = True if clx.cc is not None: cl.cc = clx.cc dirty[cl] = True if clx.files is not None: cl.files = clx.files dirty[cl] = True if not opts["stdin"] and not opts["stdout"]: if name == "new": cl.files = files err = EditCL(ui, repo, cl) if err != "": return err dirty[cl] = True for d, _ in dirty.items(): d.Flush(ui, repo) if opts["stdout"]: ui.write(cl.EditorText()) elif name == "new": if ui.quiet: ui.write(cl.name) else: ui.write("CL created: " + cl.url + "\n") return | 790c9b59d674768bafd1cd45ffe856ee7db3b8ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6483/790c9b59d674768bafd1cd45ffe856ee7db3b8ce/codereview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12,
4881,
16,
3538,
16,
380,
84,
2323,
16,
2826,
4952,
4672,
3536,
2640,
578,
3874,
279,
2549,
666,
225,
1788,
578,
3874,
279,
2549,
666,
18,
432,
2549,
666,
353,
279,
1041,
434,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12,
4881,
16,
3538,
16,
380,
84,
2323,
16,
2826,
4952,
4672,
3536,
2640,
578,
3874,
279,
2549,
666,
225,
1788,
578,
3874,
279,
2549,
666,
18,
432,
2549,
666,
353,
279,
1041,
434,... |
indent_level=indent_level+1)) | indent_level=indent_level+1)) | def getLocalFieldSpecs(self, element, indent_level=0): """aggregates the different field specifications.""" field_specs = [] aggregatedClasses = [] | aaa8dd12feab69fa4c32c6edec55ff12239613d8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11941/aaa8dd12feab69fa4c32c6edec55ff12239613d8/ArchetypesGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6993,
974,
15999,
12,
2890,
16,
930,
16,
3504,
67,
2815,
33,
20,
4672,
3536,
10751,
815,
326,
3775,
652,
21950,
12123,
652,
67,
15115,
273,
5378,
16165,
4818,
273,
5378,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6993,
974,
15999,
12,
2890,
16,
930,
16,
3504,
67,
2815,
33,
20,
4672,
3536,
10751,
815,
326,
3775,
652,
21950,
12123,
652,
67,
15115,
273,
5378,
16165,
4818,
273,
5378,
2,
-100,
-100,
... |
if ((self.inputs != other.inputs) or (self.outputs != other.outputs)): raise ValueError, "State space systems have different shapes." A = concatenate(( concatenate((self.A, zeros((self.A.shape[0], other.A.shape[-1]))), axis=1), concatenate((other.B * self.C, other.A), axis=1))) B = concatenate((self.B, other.B * self.D)) C = concatenate((other.D * self.C, other.C), axis=1) D = other.D * self.D | if (self.outputs != other.inputs): raise ValueError, "Number of first's outputs must match number \ of second's inputs." A = concatenate(( concatenate(( self.A, zeros((self.A.shape[0], other.A.shape[-1])) ),axis=1), concatenate(( other.B*self.C, other.A ),axis=1), ),axis=0) B = concatenate( (self.B, other.B*self.D), axis=0 ) C = concatenate( (other.D*self.C, other.C), axis=1 ) D = other.D*self.D | def __mul__(self, other): # Check for a couple of special cases if (isinstance(other, (int, long, float, complex))): # Just multiplying by a scalar; change the output A, B = self.A, self.B; C = self.C * other; D = self.D * other; | 62242c319538c8b49a700e601a613a17a607f82b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6610/62242c319538c8b49a700e601a613a17a607f82b/statesp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
468,
2073,
364,
279,
1825,
2268,
434,
4582,
6088,
309,
261,
291,
1336,
12,
3011,
16,
261,
474,
16,
1525,
16,
1431,
16,
7233,
3719,
4672,
468... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
468,
2073,
364,
279,
1825,
2268,
434,
4582,
6088,
309,
261,
291,
1336,
12,
3011,
16,
261,
474,
16,
1525,
16,
1431,
16,
7233,
3719,
4672,
468... |
sys.path.append(self.subtest_dir) | def initialize(self): # Make it possible to import modules from the subtest dir self.subtest_dir = os.path.join(self.bindir, 'tests') sys.path.append(self.subtest_dir) | 251fc3d793c5bda6dbfc8abfdf1bc498573600e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/251fc3d793c5bda6dbfc8abfdf1bc498573600e0/kvm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
468,
4344,
518,
3323,
358,
1930,
4381,
628,
326,
720,
3813,
1577,
365,
18,
1717,
3813,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4376,
481,
16,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
468,
4344,
518,
3323,
358,
1930,
4381,
628,
326,
720,
3813,
1577,
365,
18,
1717,
3813,
67,
1214,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4376,
481,
16,
296,
... | |
try: | def handlerB(self, *args): self.b_called = True if test_support.verbose: print "handlerB invoked", args raise HandlerBCalled(*args) | def force_test_exit(): # Sigh, both imports seem necessary to avoid errors. import os fork_pid = os.fork() if fork_pid: # In parent. return fork_pid # In child. import os, time try: # Wait 5 seconds longer than the expected alarm to give enough # time for the normal sequence of events to occur. This is # just a stop-gap to try to prevent the test from hanging. time.sleep(MAX_DURATION + 5) print >> sys.__stdout__, ' child should not have to kill parent' for signame in "SIGHUP", "SIGUSR1", "SIGUSR2", "SIGALRM": os.kill(pid, getattr(signal, signame)) print >> sys.__stdout__, " child sent", signame, "to", pid time.sleep(1) finally: os._exit(0) | 9f2b93e03ac1b79f2a25aeb2c3b094fbe816d1d4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/9f2b93e03ac1b79f2a25aeb2c3b094fbe816d1d4/test_signal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
67,
3813,
67,
8593,
13332,
468,
348,
2031,
16,
3937,
10095,
19264,
4573,
358,
4543,
1334,
18,
1930,
1140,
12515,
67,
6610,
273,
1140,
18,
23335,
1435,
309,
12515,
67,
6610,
30,
468... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
67,
3813,
67,
8593,
13332,
468,
348,
2031,
16,
3937,
10095,
19264,
4573,
358,
4543,
1334,
18,
1930,
1140,
12515,
67,
6610,
273,
1140,
18,
23335,
1435,
309,
12515,
67,
6610,
30,
468... |
return scal(div(gz, sqrt(x)), 0.5) | return scale(div(gz, sqrt(x)), 0.5) | def grad(x, gz): return scal(div(gz, sqrt(x)), 0.5) | 9b27c788e7d2134a6d684c944022349650aa3cb2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12438/9b27c788e7d2134a6d684c944022349650aa3cb2/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6058,
12,
92,
16,
14136,
4672,
327,
8292,
12,
2892,
12,
9764,
16,
5700,
12,
92,
13,
3631,
374,
18,
25,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6058,
12,
92,
16,
14136,
4672,
327,
8292,
12,
2892,
12,
9764,
16,
5700,
12,
92,
13,
3631,
374,
18,
25,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return color | fontsize = 10 if fontsize: attribs.append(("fontsize",fontsize)) if color: attribs.append(("color",color)) return attribs | def getNodeColor(classId): # return color according to size fsize = self._classes[classId]['size'] if fsize > 20000: color = "red" elif fsize > 5000: color = "green" else: color = "blue" return color | 4c9d6258dcb0b5a86a91298d76d20597a63c4664 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/4c9d6258dcb0b5a86a91298d76d20597a63c4664/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5973,
2957,
12,
1106,
548,
4672,
468,
14869,
273,
1728,
309,
14869,
30,
11460,
18,
6923,
12,
2932,
23055,
3113,
23055,
3719,
309,
2036,
30,
11460,
18,
6923,
12,
2932,
3266,
3113,
3266,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5973,
2957,
12,
1106,
548,
4672,
468,
14869,
273,
1728,
309,
14869,
30,
11460,
18,
6923,
12,
2932,
23055,
3113,
23055,
3719,
309,
2036,
30,
11460,
18,
6923,
12,
2932,
3266,
3113,
3266,
3... |
master_author = web.ctx.site.get(master) | master_author = web.ctx.site.get(master).dict() | def do_merge(self, master, old_keys): master_author = web.ctx.site.get(master) master_author['type']['key'] == '/type/author' edition_keys = set() work_keys = set() updates = [] master_needs_save = False for old in old_keys: q = { 'type': '/type/edition', 'authors': {'key': old}, 'works': None, 'limit': 10000, } editions = web.ctx.site.things(q) edition_keys.update(editions) for ekey in editions: e = web.ctx.site.get(ekey) work_keys.update(w['key'] for w in e.get('works', [])) q = { 'type': '/type/work', 'authors': {'author': {'key': old}}, 'limit': 10000, } work_keys.update(web.ctx.site.things(q)) old_author = web.ctx.site.get(old) if old_author.get('name', ''): if old_author['name'] not in master_author.setdefault('alternate_names', []): master_needs_save = True master_author['alternate_names'].append(old_author['name']) r = { 'key': old, 'type': {'key': '/type/redirect'}, 'location': master, 'limit': 10000, } updates.append(r) | 2c4bd4059bbb4e193e0cb7153899ee13096a81bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/2c4bd4059bbb4e193e0cb7153899ee13096a81bb/code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2702,
12,
2890,
16,
4171,
16,
1592,
67,
2452,
4672,
4171,
67,
4161,
273,
3311,
18,
5900,
18,
4256,
18,
588,
12,
7525,
2934,
1576,
1435,
4171,
67,
4161,
3292,
723,
21712,
856,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2702,
12,
2890,
16,
4171,
16,
1592,
67,
2452,
4672,
4171,
67,
4161,
273,
3311,
18,
5900,
18,
4256,
18,
588,
12,
7525,
2934,
1576,
1435,
4171,
67,
4161,
3292,
723,
21712,
856,
... |
DNS_requests = {'A': _A, 'NS': _NS, 'MX': _MX, 'PTR': _PTR} def __init__ ( self, servers, failover=1, timeout=2, precision=1, ip=None ): | DNS_requests = { 'A': Request_A, 'NS': Request_NS, 'MX': Request_MX, 'PTR': Request_PTR } dns_ip = None dns_sent = 0 dns_failover = 1 def __init__ (self, servers): | def dns_collect (self, datagram, pos): "unpack a PTR resource record at pos" if datagram[pos:pos+4]== '\000\014\000\001': self.dns_ttl = _unpack_ttl (datagram, pos+4) self.dns_resources.append ( _unpack_name (datagram, pos+10) ) return True | 79906933ee4150b4a6dc21c74f2849f7ab831a23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/79906933ee4150b4a6dc21c74f2849f7ab831a23/dns_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6605,
67,
14676,
261,
2890,
16,
1150,
17049,
16,
949,
4672,
315,
17309,
279,
453,
4349,
1058,
1409,
622,
949,
6,
309,
1150,
17049,
63,
917,
30,
917,
15,
24,
65,
631,
2337,
3784,
64,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6605,
67,
14676,
261,
2890,
16,
1150,
17049,
16,
949,
4672,
315,
17309,
279,
453,
4349,
1058,
1409,
622,
949,
6,
309,
1150,
17049,
63,
917,
30,
917,
15,
24,
65,
631,
2337,
3784,
64,
... |
line = f.readline() if not line: | line1 = f.readline() if not line1: | def _skip_to_nonblank(f, spacegroup): """Read lines from f until a nonblank line not starting with a hash (#) is encountered and returns the line.""" while True: line = f.readline() if not line: raise SpacegroupNotFoundError( 'invalid spacegroup %s, not found in data base'%spacegroup) line.strip() if line and not line.startswith('#'): break return line | 6f4c55ef5b482e5dd9b72e728a5ba02ca06ab5d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5572/6f4c55ef5b482e5dd9b72e728a5ba02ca06ab5d6/spacegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7457,
67,
869,
67,
5836,
12111,
12,
74,
16,
3476,
1655,
4672,
3536,
1994,
2362,
628,
284,
3180,
279,
1661,
12111,
980,
486,
5023,
598,
279,
1651,
23885,
13,
353,
9919,
471,
1135,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7457,
67,
869,
67,
5836,
12111,
12,
74,
16,
3476,
1655,
4672,
3536,
1994,
2362,
628,
284,
3180,
279,
1661,
12111,
980,
486,
5023,
598,
279,
1651,
23885,
13,
353,
9919,
471,
1135,
... |
state.exempt_ips.add(ad.ip) | self.exempt_ips.add(ad.ip) | def setDNSIPCache(self, data): | 7ecbfbb5047df6c87c2297fc449d5be835790dd5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8524/7ecbfbb5047df6c87c2297fc449d5be835790dd5/dtella_state.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
8609,
17739,
1649,
12,
2890,
16,
501,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
8609,
17739,
1649,
12,
2890,
16,
501,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifycollectiontree(colID, ln, move_up='', move_down='', move_from='', move_to='', delete='', rtype='', callback='yes', confirm=0): """to modify the collection tree: move a collection up and down, delete a collection, or change the father of the collection. colID - the main collection of the tree, the root move_up - move this collection up (is not the collection id, but the place in the tree) move_up - move this collection down (is not the collection id, but the place in the tree) move_from - move this collection from the current positon (is not the collection id, but the place in the tree) move_to - move the move_from collection and set this as it's father. (is not the collection id, but the place in the tree) delete - delete this collection from the tree (is not the collection id, but the place in the tree) rtype - the type of the collection in the tree, regular or virtual""" colID = int(colID) tree = get_col_tree(colID, rtype) col_dict = dict(get_def_name('', "collection")) subtitle = """Modify collection tree: %s <small>[<a title="See guide" href="%s/admin/websearch/guide.html#2.3">?</a>] <a href="%s/admin/websearch/websearchadmin.py/showtree?colID=%s&ln=%s">Printer friendly version</a></small>""" % (col_dict[colID], weburl, weburl, colID, ln) fin_output = "" output = "" try: if move_up: move_up = int(move_up) switch = find_last(tree, move_up) if switch and switch_col_treescore(tree[move_up], tree[switch]): output += """<b><span class="info">Moved the %s collection '%s' up and '%s' down.</span></b><br><br> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[move_up][0]], col_dict[tree[switch][0]]) else: output += """<b><span class="info">Could not move the %s collection '%s' up and '%s' down.</span></b><br><br> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[move_up][0]], col_dict[tree[switch][0]]) elif move_down: move_down = int(move_down) switch = find_next(tree, move_down) if switch and switch_col_treescore(tree[move_down], tree[switch]): output += """<b><span class="info">Moved the %s collection '%s' down and '%s' up.</span></b><br><br> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[move_down][0]], col_dict[tree[switch][0]]) else: output += """<b><span class="info">Could not move the %s collection '%s' up and '%s' down.</span></b><br><br> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[move_up][0]],col_dict[tree[switch][0]]) elif delete: delete = int(delete) if confirm in [0, "0"]: if col_dict[tree[delete][0]] != col_dict[tree[delete][3]]: text = """<b>Do you want to remove the %s collection '%s' and its subcollections in the %s collection '%s'.</b> """ % ((tree[delete][4]=="r" and 'regular' or 'virtual'), col_dict[tree[delete][0]], (rtype=="r" and 'regular' or 'virtual'), col_dict[tree[delete][3]]) else: text = """<b>Do you want to remove all subcollections of the %s collection '%s'.</b> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[delete][3]]) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/modifycollectiontree#tree" % weburl, text=text, button="Confirm", colID=colID, delete=delete, rtype=rtype, ln=ln, confirm=1) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/index?mtype=perform_modifycollectiontree#tree" % weburl, text="<b>To cancel</b>", button="Cancel", colID=colID, ln=ln) else: if remove_col_subcol(tree[delete][0], tree[delete][3], rtype): if col_dict[tree[delete][0]] != col_dict[tree[delete][3]]: output += """<b><span class="info">Removed the %s collection '%s' and its subcollections in subdirectory '%s'.</span></b><br><br> """ % ((tree[delete][4]=="r" and 'regular' or 'virtual'), col_dict[tree[delete][0]], col_dict[tree[delete][3]]) else: output += """<b><span class="info">Removed the subcollections of the %s collection '%s'.</span></b><br><br> """ % ((rtype=="r" and 'regular' or 'virtual'), col_dict[tree[delete][3]]) else: output += """<b><span class="info">Could not remove the collection from the tree.</span></b><br><br> """ delete = '' elif move_from and not move_to: move_from_rtype = move_from[0] move_from_id = int(move_from[1:len(move_from)]) text = """<b>Select collection to place the %s collection '%s' under.</b><br><br> """ % ((move_from_rtype=="r" and 'regular' or 'virtual'), col_dict[tree[move_from_id][0]]) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/index?mtype=perform_modifycollectiontree#tree" % weburl, text=text, button="Cancel", colID=colID, ln=ln) elif move_from and move_to: move_from_rtype = move_from[0] move_from_id = int(move_from[1:len(move_from)]) move_to_rtype = move_to[0] move_to_id = int(move_to[1:len(move_to)]) tree_from = get_col_tree(colID, move_from_rtype) tree_to = get_col_tree(colID, move_to_rtype) if confirm in [0, '0']: if move_from_id == move_to_id and move_from_rtype == move_to_rtype: output += """<b><span class="info">Cannot move to itself.</span></b><br><br> """ elif tree_from[move_from_id][3] == tree_to[move_to_id][0] and move_from_rtype==move_to_rtype: output += """<b><span class="info">The collection is already there.</span></b><br><br> """ elif check_col(tree_to[move_to_id][0], tree_from[move_from_id][0]) or (tree_to[move_to_id][0] == 1 and tree_from[move_from_id][3] == tree_to[move_to_id][0] and move_from_rtype != move_to_rtype): text = """<b>Move %s collection '%s' to the %s collection '%s'.</b> """ % ((tree_from[move_from_id][4]=="r" and 'regular' or 'virtual'), col_dict[tree_from[move_from_id][0]], (tree_to[move_to_id][4]=="r" and 'regular' or 'virtual'), col_dict[tree_to[move_to_id][0]]) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/modifycollectiontree#tree" % weburl, text=text, button="Confirm", colID=colID, move_from=move_from, move_to=move_to, ln=ln, rtype=rtype, confirm=1) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/index?mtype=perform_modifycollectiontree#tree" % weburl, text="""<b>To cancel</b>""", button="Cancel", colID=colID, ln=ln) else: output += """<b><span class="info">Cannot move the collection '%s' and set it as a subcollection of '%s' since it will create a loop.</span></b><br><br> """ % (col_dict[tree_from[move_from_id][0]], col_dict[tree_to[move_to_id][0]]) else: if (move_to_id != 0 and move_col_tree(tree_from[move_from_id], tree_to[move_to_id])) or (move_to_id == 0 and move_col_tree(tree_from[move_from_id], tree_to[move_to_id], move_to_rtype)): output += """<b><span class="info">Moved %s collection '%s' to the %s collection '%s'.</span></b><br><br> """ % ((move_from_rtype=="r" and 'regular' or 'virtual'), col_dict[tree_from[move_from_id][0]], (move_to_rtype=="r" and 'regular' or 'virtual'), col_dict[tree_to[move_to_id][0]]) else: output += """<b><span class="info">Could not move %s collection '%s' to the %s collection '%s'.</span></b><br><br> """ % ((move_from_rtype=="r" and 'regular' or 'virtual'), col_dict[tree_from[move_from_id][0]], (move_to_rtype=="r" and 'regular' or 'virtual'), col_dict[tree_to[move_to_id][0]]) move_from = '' move_to = '' else: output += """ """ except StandardError, e: return """<b><span class="info">An error occured.</span></b> """ output += """<table border ="0" width="100%"> <tr><td width="50%"> <b>Narrow by collection:</b> </td><td width="50%"> <b>Focus on...:</b> </td></tr><tr><td valign="top"> """ tree = get_col_tree(colID, 'r') output += create_colltree(tree, col_dict, colID, ln, move_from, move_to, 'r', "yes") output += """</td><td valign="top"> """ tree = get_col_tree(colID, 'v') output += create_colltree(tree, col_dict, colID, ln, move_from, move_to, 'v', "yes") output += """</td> </tr> </table> """ try: body = [output, extra] except NameError: body = [output] if callback: return perform_index(colID, ln, mtype="perform_modifycollectiontree", content=addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
5548,
3413,
12,
1293,
734,
16,
7211,
16,
3635,
67,
416,
2218,
2187,
3635,
67,
2378,
2218,
2187,
3635,
67,
2080,
2218,
2187,
3635,
67,
869,
2218,
2187,
1430,
2218,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
5548,
3413,
12,
1293,
734,
16,
7211,
16,
3635,
67,
416,
2218,
2187,
3635,
67,
2378,
2218,
2187,
3635,
67,
2080,
2218,
2187,
3635,
67,
869,
2218,
2187,
1430,
2218,
2187,
... |
- ``ct`` - The Cartan Type | - ``ct`` -- The Cartan Type | def WeylCharacterRing(ct, base_ring=ZZ, prefix=None, cache=False, style="lattice"): r""" A class for rings of Weyl characters. The Weyl character is a character of a semisimple (or reductive) Lie group or algebra. They form a ring, in which the addition and multiplication correspond to direct sum and tensor product of representations. INPUT: - ``ct`` - The Cartan Type OPTIONAL ARGUMENTS: - ``base_ring`` - (default: `\ZZ`) - ``prefix`` (default an automatically generated prefix based on Cartan type) - ``cache`` - (default False) setting cache = True is a substantial speedup at the expense of some memory. - ``style`` - (default "lattice") can be set style = "coroots" to obtain an alternative representation of the elements. If no prefix specified, one is generated based on the Cartan type. It is good to name the ring after the prefix, since then it can parse its own output. EXAMPLES:: sage: G2 = WeylCharacterRing(['G',2]) sage: [fw1,fw2] = G2.fundamental_weights() sage: 2*G2(2*fw1+fw2) 2*G2(4,-1,-3) sage: 2*G2(4,-1,-3) 2*G2(4,-1,-3) sage: G2(4,-1,-3).degree() 189 Note that since the ring was named `G_2` after its default prefix, it was able to parse its own output. You do not have to use the default prefix. Thus: EXAMPLES:: sage: R = WeylCharacterRing(['B',3], prefix='R') sage: chi = R(R.fundamental_weights()[3]); chi R(1/2,1/2,1/2) sage: R(1/2,1/2,1/2) == chi True You may choose an alternative style of labeling the elements. If you create the ring with the option style="coroots" then the integers in the label are not the components of the highest weight vector, but rather the coefficients when the highest weight vector is decomposed into a product of irreducibles. These coefficients are the values of the coroots on the highest weight vector. In the coroot style the Lie group or Lie algebra is treated as semisimple, so you lose the distinction between GL(n) and SL(n); you also some information about representations of E6 and E7 for the same reason. The coroot style gives you output that is comparable to that in Tables of Dimensions, Indices and Branching Rules for Representations of Simple Lie Algebras (Marcel Dekker, 1981). EXAMPLES:: sage: B3 = WeylCharacterRing("B3",style="coroots") sage: [fw1,fw2,fw3]=B3.fundamental_weights() sage: fw1+fw3 (3/2, 1/2, 1/2) sage: B3(fw1+fw3) B3(1,0,1) sage: B3(1,0,1) B3(1,0,1) For type ['A',r], the coroot representation carries less information, since elements of the weight lattice that are orthogonal to the coroots are represented as zero. This means that with the default style you can represent the determinant, but not in the coroot style. In the coroot style, elements of the Weyl character ring represent characters of SL(r+1,CC), while in the default style, they represent characters of GL(r+1,CC). EXAMPLES: sage: A2 = WeylCharacterRing("A2") sage: L = A2.space() sage: [A2(L.det()), A2(L(0))] [A2(1,1,1), A2(0,0,0)] sage: A2(L.det()) == A2(L(0)) False sage: A2 = WeylCharacterRing("A2", style="coroots") sage: [A2(L.det()), A2(L(0))] [A2(0,0), A2(0,0)] sage: A2(L.det()) == A2(L(0)) True The multiplication in a Weyl character ring corresponds to the product of characters, which you can use to determine the decomposition of tensor products into irreducibles. For example, let us compute the tensor product of the standard and spin representations of Spin(7). EXAMPLES:: sage: B3 = WeylCharacterRing("B3") sage: [fw1,fw2,fw3]=B3.fundamental_weights() sage: [B3(fw1).degree(),B3(fw3).degree()] [7, 8] sage: B3(fw1)*B3(fw3) B3(1/2,1/2,1/2) + B3(3/2,1/2,1/2) The name of the irreducible representation encodes the highest weight vector. TESTS:: sage: F4 = WeylCharacterRing(['F',4], cache = True) sage: [fw1,fw2,fw3,fw4] = F4.fundamental_weights() sage: chi = F4(fw4); chi, chi.degree() (F4(1,0,0,0), 26) sage: chi^2 F4(0,0,0,0) + F4(1,0,0,0) + F4(1,1,0,0) + F4(3/2,1/2,1/2,1/2) + F4(2,0,0,0) sage: [x.degree() for x in [F4(0,0,0,0), F4(1,0,0,0), F4(1,1,0,0), F4(3/2,1/2,1/2,1/2), F4(2,0,0,0)]] [1, 26, 52, 273, 324] You can produce a list of the irreducible elements of an irreducible character. EXAMPLES:: sage: R = WeylCharacterRing(['A',2], prefix = R) sage: sorted(R([2,1,0]).mlist()) [[(1, 1, 1), 2], [(1, 2, 0), 1], [(1, 0, 2), 1], [(2, 1, 0), 1], [(2, 0, 1), 1], [(0, 1, 2), 1], [(0, 2, 1), 1]] """ ct = cartan_type.CartanType(ct) return cache_wcr(ct, base_ring=base_ring, prefix=prefix, cache=cache, style=style) | 40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
678,
402,
80,
7069,
10369,
12,
299,
16,
1026,
67,
8022,
33,
27096,
16,
1633,
33,
7036,
16,
1247,
33,
8381,
16,
2154,
1546,
80,
24966,
6,
4672,
436,
8395,
432,
667,
364,
26537,
434,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
678,
402,
80,
7069,
10369,
12,
299,
16,
1026,
67,
8022,
33,
27096,
16,
1633,
33,
7036,
16,
1247,
33,
8381,
16,
2154,
1546,
80,
24966,
6,
4672,
436,
8395,
432,
667,
364,
26537,
434,
6... |
box2.onmouseout=kill_doclink; | box2.onmouseout=auto_kill_doclink; | def _colorize_re(tree, noparen=0): """ Recursively descend the given regexp parse tree to produce the HTML code for a colorized version of the regexp. @param tree: The regexp parse tree for the regexp that should be colorized. @type tree: L{sre_parse.SubPattern} @param noparen: If true, then don't include parenthases around the expression in C{tree}, even if it contains multiple elements. @type noparen: C{boolean} @return: The HTML code for a colorized version of C{tree} @rtype: C{string} """ result = [] out = result.append if len(tree) > 1 and not noparen: out('<span class="%s">(</span>' % PAREN_TAG) for elt in tree: op = elt[0] args = elt[1] if op == sre_constants.LITERAL: c = unichr(args) if c == '\t': out(r'<span class="%s">\t</span>' % ESCAPE_TAG) elif c == '\n': out(r'<span class="%s">\n</span>' % ESCAPE_TAG) elif c == '\r': out(r'<span class="%s">\r</span>' % ESCAPE_TAG) elif c == '\f': out(r'<span class="%s">\f</span>' % ESCAPE_TAG) elif c == '\v': out(r'<span class="%s">\v</span>' % ESCAPE_TAG) elif ord(c)<32 or ord(c)>=127: if c < 256: template = r'<span class="%s">\x%02x</span>' else: template = r'<span class="%s">\u%04x</span>' out(template % (ESCAPE_TAG,ord(c))) elif c in '.^$\\*+?{}[]|()': out(r'<span class="%s">\%c</span>' % (ESCAPE_TAG, c)) else: out(plaintext_to_html(unichr(args))) continue elif op == sre_constants.ANY: out('<span class="%s">.</span>' % ANY_TAG) elif op == sre_constants.BRANCH: if args[0] is not None: raise ValueError('Branch expected None arg but got %s' % args[0]) VBAR = '<span class="%s">|</span>' % BRANCH_TAG out(VBAR.join([_colorize_re(item,1) for item in args[1]])) elif op == sre_constants.IN: if (len(args) == 1 and args[0][0] == sre_constants.CATEGORY): out(_colorize_re(args)) else: out('<span class="%s">[</span>' % CHOICE_TAG) out(_colorize_re(args, 1)) out('<span class="%s">]</span>' % CHOICE_TAG) elif op == sre_constants.CATEGORY: out('<span class="%s">' % CATEGORY_TAG) if args == sre_constants.CATEGORY_DIGIT: out(r'\d') elif args == sre_constants.CATEGORY_NOT_DIGIT: out(r'\D') elif args == sre_constants.CATEGORY_SPACE: out(r'\s') elif args == sre_constants.CATEGORY_NOT_SPACE: out(r'\S') elif args == sre_constants.CATEGORY_WORD: out(r'\w') elif args == sre_constants.CATEGORY_NOT_WORD: out(r'\W') else: raise ValueError('Unknown category %s' % args) out('</span>') elif op == sre_constants.AT: out('<span class="%s">' % AT_TAG) if args == sre_constants.AT_BEGINNING_STRING: out(r'\A') elif args == sre_constants.AT_BEGINNING: out(r'^') elif args == sre_constants.AT_END: out(r'$') elif args == sre_constants.AT_BOUNDARY: out(r'\b') elif args == sre_constants.AT_NON_BOUNDARY: out(r'\B') elif args == sre_constants.AT_END_STRING: out(r'\Z') else: raise ValueError('Unknown position %s' % args) out('</span>') elif op == sre_constants.MAX_REPEAT: min = args[0] max = args[1] if max == sre_constants.MAXREPEAT: if min == 0: out(_colorize_re(args[2])) out('<span class="%s">*</span>' % STAR_TAG) elif min == 1: out(_colorize_re(args[2])) out('<span class="%s">+</span>' % PLUS_TAG) else: out(_colorize_re(args[2])) out('<span class="%s">{%d,}</span>' % (RNG_TAG, min)) elif min == 0: if max == 1: out(_colorize_re(args[2])) out('<span class="%s">?</span>' % QMRK_TAG) else: out(_colorize_re(args[2])) out('<span class="%s">{,%d}</span>' % (RNG_TAG, max)) elif min == max: out(_colorize_re(args[2])) out('<span class="%s">{%d}</span>' % (RNG_TAG, max)) else: out(_colorize_re(args[2])) out('<span class="%s">{%d,%d}</span>' % (RNG_TAG, min, max)) elif op == sre_constants.MIN_REPEAT: min = args[0] max = args[1] if max == sre_constants.MAXREPEAT: if min == 0: out(_colorize_re(args[2])) out('<span class="%s">*?</span>' % STAR_TAG) elif min == 1: out(_colorize_re(args[2])) out('<span class="%s">+?</span>' % PLUS_TAG) else: out(_colorize_re(args[2])) out('<span class="%s">{%d,}?</span>' % (RNG_TAG, min)) elif min == 0: if max == 1: out(_colorize_re(args[2])) out('<span class="%s">??</span>' % QMRK_TAG) else: out(_colorize_re(args[2])) out('<span class="%s">{,%d}?</span>' % (RNG_TAG, max)) elif min == max: out(_colorize_re(args[2])) out('<span class="%s">{%d}?</span>' % (RNG_TAG, max)) else: out(_colorize_re(args[2])) out('<span class="%s">{%d,%d}?</span>'%(RNG_TAG, min, max)) elif op == sre_constants.SUBPATTERN: if args[0] is None: out('<span class="%s">(?:</span>' % PAREN_TAG) elif isinstance(args[0], (int, long)): # This is cheating: out('<span class="%s">(</span>' % PAREN_TAG) else: out('<span class="%s">(?P<</span>' % PAREN_TAG) out('<span class="%s">%s</span>' % (REF_TAG, plaintext_to_html(args[0]))) out('<span class="%s">></span>' % PAREN_TAG) out(_colorize_re(args[1], 1)) out('<span class="%s">)</span>' % PAREN_TAG) elif op == sre_constants.GROUPREF: out('<span class="%s">\\%d</span>' % (REF_TAG, args)) elif op == sre_constants.RANGE: start = _colorize_re( ((sre_constants.LITERAL, args[0]),) ) end = _colorize_re( ((sre_constants.LITERAL, args[1]),) ) out('%s<span class="%s">-</span>%s' % (start, CHOICE_TAG, end)) elif op == sre_constants.NEGATE: out('<span class="%s">^</span>' % CHOICE_TAG) elif op == sre_constants.ASSERT: if args[0]: out('<span class="%s">(?=</span>' % ASSERT_TAG) else: out('<span class="%s">(?<=</span>' % ASSERT_TAG) out(''.join(_colorize_re(args[1], 1))) out('<span class="%s">)</span>' % ASSERT_TAG) elif op == sre_constants.ASSERT_NOT: if args[0]: out('<span class="%s">(?!</span>' % ASSERT_TAG) else: out('<span class="%s">(?<!</span>' % ASSERT_TAG) out(''.join(_colorize_re(args[1], 1))) out('<span class="%s">)</span>' % ASSERT_TAG) elif op == sre_constants.NOT_LITERAL: lit = _colorize_re( ((sre_constants.LITERAL, args),) ) out('<span class="%s">[^</span>%s<span class="%s">]</span>' % (CHOICE_TAG, lit, CHOICE_TAG)) else: log.error("Error colorizing regexp: unknown elt %r" % elt) if len(tree) > 1 and not noparen: out('<span class="%s">)</span>' % PAREN_TAG) return u''.join(result) | cd4d6e5fbca5f698866ebe3598f5c2ca592983e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/cd4d6e5fbca5f698866ebe3598f5c2ca592983e0/html_colorize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3266,
554,
67,
266,
12,
3413,
16,
28797,
7892,
33,
20,
4672,
3536,
31362,
10653,
326,
864,
7195,
1109,
2151,
358,
11402,
326,
3982,
981,
364,
279,
2036,
1235,
1177,
434,
326,
7195,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3266,
554,
67,
266,
12,
3413,
16,
28797,
7892,
33,
20,
4672,
3536,
31362,
10653,
326,
864,
7195,
1109,
2151,
358,
11402,
326,
3982,
981,
364,
279,
2036,
1235,
1177,
434,
326,
7195,
... |
temp = coo_matrix(s, ijnew, dims=(M, N), nzmax=nzmax, dtype=dtype) temp = temp.tocsr() | temp = coo_matrix(s, ijnew, dims=dims, nzmax=nzmax, dtype=dtype).tocsr() | def __init__(self, arg1, dims=(None,None), nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense matrix arg1 to CSR format if rank(arg1) == 2: s = asarray(arg1) ocsc = csc_matrix(transpose(s)) self.colind = ocsc.rowind self.indptr = ocsc.indptr self.data = ocsc.data self.shape = (ocsc.shape[1], ocsc.shape[0]) | 0b2d25691f3b5b478761024814ba8dc28534e0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/0b2d25691f3b5b478761024814ba8dc28534e0fb/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
28657,
7036,
16,
7036,
3631,
15062,
1896,
33,
6625,
16,
3182,
2218,
72,
2187,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1501,
21,
16,
9914,
28657,
7036,
16,
7036,
3631,
15062,
1896,
33,
6625,
16,
3182,
2218,
72,
2187,
1610,
33,
8381,
4672,
1694,
5667,
16186,
2738,
972,
12,
... |
str += epytext.to_html(freturn.descr()) | str += dom_to_html(freturn.descr(), container) | def _func_details(self, functions, cls, heading='Function Details'): """Return a detailed description of the functions in a class or module.""" functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</table>' | b1b93a7c8720ea1ae0c715da86bbf6fe1dbf094a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/b1b93a7c8720ea1ae0c715da86bbf6fe1dbf094a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
990,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
273,
365,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
990,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
273,
365,
6... |
if FetchBugReportsDebian.FetchBugsDebian(PackageName): | if FetchBugReportsDebian.FetchBugsDebian(PackageName) in [1,2]: | def run(request, response, func=find_first_match): '''Get items from the request Queue, process them with func(), put the results along with the Thread's name into the response Queue. Stop running when item is None.''' while 1: tuple_item_key = request.get() if tuple_item_key is None: break (key, item) = tuple_item_key (url, file, download_size, checksum) = stripper(item) thread_name = threading.currentThread().getName() if key == 'Update': temp_file = file.split("_") PackageName = temp_file[0] PackageName += " - " + temp_file[len(temp_file) - 1] del temp_file #INFO: We pass None as a filename here because we don't want to do a tree search of # update files. Update files are changed daily and there is no point in doing a search of # them in the cache_dir response.put(func(cache_dir, None) ) #INFO: exit_status here would be False because for updates there's no need to do a # find_first_match # This is more with the above statement where None is passed as the filename exit_status = response.get() if exit_status == False: log.msg("Downloading %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_update_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_update_file, LINE_OVERWRITE_MID) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_update_file, LINE_OVERWRITE_FULL) ) os.unlink(os.path.join(download_path, file) ) else: errlist.append(file) elif key == 'Upgrade': PackageName = file.split("_")[0] response.put(func(cache_dir, file) ) #INFO: find_first_match() returns False or a file name with absolute path full_file_path = response.get() #INFO: If we find the file in the local cache_dir, we'll execute this block. if full_file_path != False: # We'll first check for its md5 checksum if ArgumentOptions.disable_md5check is False: if FetcherInstance.CheckHashDigest(full_file_path, checksum) is True: log.verbose("md5checksum correct for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if ArgumentOptions.deb_bugs: bug_fetched = 0 log.verbose("Fetching bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) bug_fetched = 1 else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, full_file_path) is True: log.success("%s copied from local cache directory %s.%s\n" % (PackageName, cache_dir, LINE_OVERWRITE_MID) ) else: log.err("Couldn't add %s to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_MID) ) sys.exit(1) #INFO: If no zip option enabled, simply copy the downloaded package file # along with the downloaded bug reports. else: try: shutil.copy(full_file_path, download_path) log.success("%s copied from local cache directory %s.%s\n" % (PackageName, cache_dir, LINE_OVERWRITE_MID) ) except shutil.Error: log.verbose("%s already available in %s. Skipping copy!!!%s\n" % (file, download_path, LINE_OVERWRITE_MID) ) if bug_fetched == 1: for x in os.listdir(os.curdir): if (x.startswith(PackageName) and x.endswith(pypt_bug_file_format) ): shutil.move(x, download_path) log.verbose("Moved %s file to %s folder.%s\n" % (x, download_path, LINE_OVERWRITE_FULL) ) #INFO: Damn!! The md5chesum didn't match :-( # The file is corrupted and we need to download a new copy from the internet else: log.verbose("%s MD5 checksum mismatch. Skipping file.%s\n" % (file, LINE_OVERWRITE_FULL) ) log.msg("Downloading %s - %d KB%s\n" % (PackageName, download_size/1024, LINE_OVERWRITE_MID) ) if FetcherInstance.download_from_web(url, file, download_path) == True: log.success("\r%s done.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) #Add to cache_dir if possible if ArgumentOptions.cache_dir and os.access(ArgumentOptions.cache_dir, os.W_OK) == True: try: shutil.copy(file, cache_dir) log.verbose("%s copied to local cache directory %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID) ) except shutil.Error: log.verbose("Couldn't copy %s to %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_FULL) ) else: log.verbose("cache_dir %s is not writeable. Skipping copy to it.\n" % (ArgumentOptions.cache_dir) ) #Fetch bug reports if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) os.unlink(os.path.join(download_path, file) ) #INFO: You're and idiot. # You should NOT disable md5checksum for any files else: if ArgumentOptions.deb_bugs: bug_fetched = 0 if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) bug_fetched = 1 else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) #FIXME: Don't know why this was really required. If this has no changes, delete it. #file = full_file_path.split("/") #file = file[len(file) - 1] #file = download_path + "/" + file if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) os.unlink(os.path.join(download_path, file) ) else: # Since zip file option is not enabled let's copy the file to the target folder try: shutil.copy(full_file_path, download_path) log.success("%s copied from local cache directory %s.%s\n" % (file, cache_dir, LINE_OVERWRITE_SMALL) ) except shutil.Error: log.verbose("%s already available in dest_dir. Skipping copy!!!%s\n" % (file, LINE_OVERWRITE_SMALL) ) # And also the bug reports if bug_fetched == 1: for x in os.listdir(os.curdir): if (x.startswith(PackageName) and x.endswith(pypt_bug_file_format) ): shutil.move(x, download_path) log.verbose("Moved %s file to %s folder.%s\n" % (x, download_path, LINE_OVERWRITE_MID) ) else: #INFO: This block gets executed if the file is not found in local cache_dir or cache_dir is None # We go ahead and try to download it from the internet log.verbose("%s not available in local cache %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID) ) log.msg("Downloading %s - %d KB%s\n" % (PackageName, download_size/1024, LINE_OVERWRITE_MID) ) if FetcherInstance.download_from_web(url, file, download_path) == True: #INFO: This block gets executed if md5checksum is allowed if ArgumentOptions.disable_md5check is False: if FetcherInstance.CheckHashDigest(file, checksum) is True: if ArgumentOptions.cache_dir and os.access(ArgumentOptions.cache_dir, os.W_OK) == True: try: shutil.copy(file, ArgumentOptions.cache_dir) log.verbose("%s copied to local cache directory %s.%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID) ) except shutil.Error: log.verbose("%s already available in %s. Skipping copy!!!%s\n" % (file, ArgumentOptions.cache_dir, LINE_OVERWRITE_MID) ) else: log.verbose("cache_dir %s is not writeable. Skipping copy to it.\n" % (ArgumentOptions.cache_dir) ) if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) os.unlink(os.path.join(download_path, file) ) else: #INFO MD5 Checksum is incorrect. log.err("%s MD5 Checksum mismatch.\n" % (PackageName) ) errlist.append(PackageName) else: if ArgumentOptions.deb_bugs: if FetchBugReportsDebian.FetchBugsDebian(PackageName): log.verbose("Fetched bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) else: log.verbose("Couldn't fetch bug reports for package %s.%s\n" % (PackageName, LINE_OVERWRITE_MID) ) if ArgumentOptions.zip_it: if FetcherInstance.compress_the_file(zip_upgrade_file, file) != True: log.err("Couldn't archive %s to file %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) sys.exit(1) else: log.verbose("%s added to archive %s.%s\n" % (file, zip_upgrade_file, LINE_OVERWRITE_SMALL) ) os.unlink(os.path.join(download_path, file) ) log.success("\r%s done.%s\n" % (PackageName, LINE_OVERWRITE_FULL) ) else: #log.err("Couldn't find %s\n" % (PackageName) ) errlist.append(PackageName) else: raise FetchDataKeyError | dbe68c51c5eedd5b34b3221bde84ac25f8cc3e88 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12499/dbe68c51c5eedd5b34b3221bde84ac25f8cc3e88/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2293,
16,
766,
16,
1326,
33,
4720,
67,
3645,
67,
1916,
4672,
9163,
967,
1516,
628,
326,
590,
7530,
16,
1207,
2182,
598,
1326,
9334,
1378,
326,
1686,
7563,
598,
326,
4884,
180... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2293,
16,
766,
16,
1326,
33,
4720,
67,
3645,
67,
1916,
4672,
9163,
967,
1516,
628,
326,
590,
7530,
16,
1207,
2182,
598,
1326,
9334,
1378,
326,
1686,
7563,
598,
326,
4884,
180... |
self.callbacks["set_opt"](option, True) | self.callbacks["set_opt"](option, "True") | def _cfg_set_prompt(self, option, prompt): # Ensure the items are enumerated t = self.callbacks["get_opt"](option) self.callbacks["set_opt"](option, True) | 5799f4cc58d64e0a59114a54c172ecd0fb5a70c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12358/5799f4cc58d64e0a59114a54c172ecd0fb5a70c3/taglist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7066,
67,
542,
67,
13325,
12,
2890,
16,
1456,
16,
6866,
4672,
468,
7693,
326,
1516,
854,
3557,
690,
268,
273,
365,
18,
13316,
9614,
588,
67,
3838,
11929,
12,
3482,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7066,
67,
542,
67,
13325,
12,
2890,
16,
1456,
16,
6866,
4672,
468,
7693,
326,
1516,
854,
3557,
690,
268,
273,
365,
18,
13316,
9614,
588,
67,
3838,
11929,
12,
3482,
13,
365,
18,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.