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 |
|---|---|---|---|---|---|---|
print e.hdrs | def _post_url(self, event, url=None): "Posts a URL to delicious.com" | 0f3105d83ad2250e8e197a866aef24e5792300c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12048/0f3105d83ad2250e8e197a866aef24e5792300c8/urlgrab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
67,
718,
12,
2890,
16,
871,
16,
880,
33,
7036,
4672,
315,
24983,
279,
1976,
358,
1464,
28728,
18,
832,
6,
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,
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,
2767,
67,
718,
12,
2890,
16,
871,
16,
880,
33,
7036,
4672,
315,
24983,
279,
1976,
358,
1464,
28728,
18,
832,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
if os.path.isfile(fullname): self.current_objects[filename] = (info, os.stat(fullname)[stat.ST_MTIME]) else: self.current_objects[filename] = (info, 0) | self.current_objects[filename] = (info, os.stat(fullname)[stat.ST_MTIME]) print 'set: %s' % filename print self.current_cachefile | def set(self, filename, dirname, fullname, info): """ set a variable """ if dirname != self.current_cachedir: self.load_cache(dirname) if os.path.isfile(fullname): self.current_objects[filename] = (info, os.stat(fullname)[stat.ST_MTIME]) else: self.current_objects[filename] = (info, 0) self.cache_modified = True | 7d1ee5308379af6af14b0e7b2377c59f1fdef9c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/7d1ee5308379af6af14b0e7b2377c59f1fdef9c0/mediainfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
1544,
16,
4283,
16,
13321,
16,
1123,
4672,
3536,
444,
279,
2190,
3536,
309,
4283,
480,
365,
18,
2972,
67,
7097,
481,
30,
365,
18,
945,
67,
2493,
12,
12287,
13,
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,
444,
12,
2890,
16,
1544,
16,
4283,
16,
13321,
16,
1123,
4672,
3536,
444,
279,
2190,
3536,
309,
4283,
480,
365,
18,
2972,
67,
7097,
481,
30,
365,
18,
945,
67,
2493,
12,
12287,
13,
365... |
def port_fallbacks(): """Get the port fallback information. Returns: A dictionary mapping platform name to a list of other platforms to fall back on. All platforms fall back on 'base'. """ fallbacks = {_BASE_PLATFORM: []} for port_name in os.listdir(os.path.join('LayoutTests', 'platform')): try: platforms = port_factory.get(port_name).baseline_search_path() except NotImplementedError: _log.error("'%s' lacks baseline_search_path(), please fix." % port_name) fallbacks[port_name] = [_BASE_PLATFORM] continue fallbacks[port_name] = [os.path.basename(p) for p in platforms][1:] fallbacks[port_name].append(_BASE_PLATFORM) return fallbacks | class MockExecutive(object): last_run_command = [] response = '' class Executive(object): def run_command(self, args, cwd=None, input=None, error_handler=None, return_exit_code=False, return_stderr=True, decode_output=True): MockExecutive.last_run_command += [args] return MockExecutive.response | def port_fallbacks(): """Get the port fallback information. Returns: A dictionary mapping platform name to a list of other platforms to fall back on. All platforms fall back on 'base'. """ fallbacks = {_BASE_PLATFORM: []} for port_name in os.listdir(os.path.join('LayoutTests', 'platform')): try: platforms = port_factory.get(port_name).baseline_search_path() except NotImplementedError: _log.error("'%s' lacks baseline_search_path(), please fix." % port_name) fallbacks[port_name] = [_BASE_PLATFORM] continue fallbacks[port_name] = [os.path.basename(p) for p in platforms][1:] fallbacks[port_name].append(_BASE_PLATFORM) return fallbacks | 7673a64b67960bceb356d6d41836b16e41937677 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/7673a64b67960bceb356d6d41836b16e41937677/deduplicate_tests_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
667,
7867,
1905,
322,
688,
12,
1612,
4672,
1142,
67,
2681,
67,
3076,
273,
5378,
766,
273,
875,
225,
667,
3889,
322,
688,
12,
1612,
4672,
1652,
1086,
67,
3076,
12,
2890,
16,
833,
16,
7239,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
667,
7867,
1905,
322,
688,
12,
1612,
4672,
1142,
67,
2681,
67,
3076,
273,
5378,
766,
273,
875,
225,
667,
3889,
322,
688,
12,
1612,
4672,
1652,
1086,
67,
3076,
12,
2890,
16,
833,
16,
7239,
... |
self.pieces.append('&%(ref)s;' % locals()) | if name2codepoint.has_key(ref): self.pieces.append('&%(ref)s;' % locals()) else: self.pieces.append('&%(ref)s' % locals()) | def handle_entityref(self, ref): # called for each entity reference, e.g. for '©', ref will be 'copy' # Reconstruct the original entity reference. self.pieces.append('&%(ref)s;' % locals()) | 44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1096,
1734,
12,
2890,
16,
1278,
4672,
468,
2566,
364,
1517,
1522,
2114,
16,
425,
18,
75,
18,
364,
5183,
3530,
31,
2187,
1278,
903,
506,
296,
3530,
11,
468,
868,
10062,
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,
1640,
67,
1096,
1734,
12,
2890,
16,
1278,
4672,
468,
2566,
364,
1517,
1522,
2114,
16,
425,
18,
75,
18,
364,
5183,
3530,
31,
2187,
1278,
903,
506,
296,
3530,
11,
468,
868,
10062,
326,
... |
extra_params += [] if ((float(py)<=2.599) or (float(py)>=2.999)) else ["-3 -tt"] | extra_params += [] if ((float(py)<=2.599) or (float(py)>=2.999)) else ["-3"] | def do_matrix_check() : python_versions=("2.3","2.4","2.5","2.6","2.7","3.1","3.2") berkeleydb_versions=("4.1","4.2","4.3","4.4","4.5","4.6","4.7","4.8","5.0") warning_level=(["-Wdefault"], ["-Werror"])[1] import subprocess for py in python_versions : for bdb in berkeleydb_versions : print print "*** Testing bindings for Python %s and Berkeley DB %s" %(py,bdb) extra_params = warning_level # Extra flags for 3.x extra_params += [] if float(py)<=2.999 else ["-bb -tt"] # Extra flags for >=2.6 extra_params += [] if ((float(py)<=2.599) or (float(py)>=2.999)) else ["-3 -tt"] params = extra_params + ["setup.py", "-q", \ "--berkeley-db=/usr/local/BerkeleyDB."+bdb,"build", "-f"] params = ["/usr/local/bin/python"+py] + params print "EXECUTING:", " ".join(params) ret=subprocess.call(params) if ret : print print ">>> Testsuite skipped" print else : params = ["/usr/local/bin/python"+py] + extra_params + ["test.py","-p"] print "EXECUTING:", " ".join(params) subprocess.call(params) | 470ffe42527e6b62b77e9d3a4541c3702aa1a497 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1929/470ffe42527e6b62b77e9d3a4541c3702aa1a497/test-full_prerelease.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5667,
67,
1893,
1435,
294,
5790,
67,
10169,
33,
2932,
22,
18,
23,
15937,
22,
18,
24,
15937,
22,
18,
25,
15937,
22,
18,
26,
15937,
22,
18,
27,
15937,
23,
18,
21,
15937,
23,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5667,
67,
1893,
1435,
294,
5790,
67,
10169,
33,
2932,
22,
18,
23,
15937,
22,
18,
24,
15937,
22,
18,
25,
15937,
22,
18,
26,
15937,
22,
18,
27,
15937,
23,
18,
21,
15937,
23,... |
sage: for i in range(-5,5) ... for j in range(-5,5) | sage: for i in range(-5,5): ... for j in range(-5,5): | def list_plot3d(v, interpolation_type='default', texture="automatic", point_list=None,**kwds): """ A 3-dimensional plot of a surface defined by the list $v$ of points in 3-dimensional space. INPUT: v -- something that defines a set of points in 3 space, for example: * a matrix * a list of 3-tuples * a list of lists (all of the same length) -- this is treated the same as a matrix. texture -- (default: "automatic"), solid light blue OPTIONAL KEYWORDS: interpolation_type - 'linear', 'nn' (nearest neighbor), 'spline' 'linear' will perform linear interpolation The option 'nn' will interpolate by averaging the value of the nearest neighbors, this produces an interpolating function that is smoother than a linear interpolation, it has one derivative everywhere except at the sample points. The option 'spline' interpolates using a bivariate B-spline. When v is a matrix the default is to use linear interpolation, when v is a list of points the default is nearest neighbor. degree - an integer between 1 and 5, controls the degree of spline used for spline interpolation. For data that is highly oscillatory use higher values point_list - If point_list=True is passed, then if the array is a list of lists of length three, it will be treated as an array of points rather than a 3xn array. num_points - Number of points to sample interpolating function in each direction. By default for an nxn array this is n. **kwds -- all other arguments are passed to the surface function OUTPUT: a 3d plot EXAMPLES: We plot a matrix that illustrates summation modulo $n$. sage: n = 5; list_plot3d(matrix(RDF,n,[(i+j)%n for i in [1..n] for j in [1..n]])) We plot a matrix of values of sin. sage: pi = float(pi) sage: m = matrix(RDF, 6, [sin(i^2 + j^2) for i in [0,pi/5,..,pi] for j in [0,pi/5,..,pi]]) sage: list_plot3d(m, texture='yellow', frame_aspect_ratio=[1,1,1/3]) Though it doesn't change the shap of the graph, increasing num_points can increase the clarity of the graph sage: list_plot3d(m, texture='yellow', frame_aspect_ratio=[1,1,1/3],num_points=40) We can change the interpolation type sage: list_plot3d(m, texture='yellow', interpolation_type='nn',frame_aspect_ratio=[1,1,1/3]) We can make this look better by increasing the number of samples sage: list_plot3d(m, texture='yellow', interpolation_type='nn',frame_aspect_ratio=[1,1,1/3],num_points=40) Lets try a spline sage: list_plot3d(m, texture='yellow', interpolation_type='spline',frame_aspect_ratio=[1,1,1/3]) That spline doesn't capture the oscillation very well, lets try a higher degree spline sage: list_plot3d(m, texture='yellow', interpolation_type='spline', degree=5, frame_aspect_ratio=[1,1,1/3]) We plot a list of lists: sage: show(list_plot3d([[1, 1, 1, 1], [1, 2, 1, 2], [1, 1, 3, 1], [1, 2, 1, 4]])) We plot a list of points: As a first example we can extract the (x,y,z) coordinates from the above example and make a list plot out of it. By default we do linear interpolation. sage: l=[] sage: for i in range(6): ... for j in range(6): ... l.append((float(i*pi/5),float(j*pi/5),m[i,j])) sage: list_plot3d(l,texture='yellow') Note that the points do not have to be regularly sampled. For example sage: l=[] sage: T=Random() sage: for i in range(-5,5) ... for j in range(-5,5) ... l.append((T.normalvariate(0,1),T.normalvariate(0,1),T.normalvariate(0,1))) sage: list_plot3d(l,interpolation_type='nn',texture='yellow',num_points=100) """ import numpy if texture == "automatic": texture = "lightblue" if is_Matrix(v): if interpolation_type=='default' or interpolation_type=='linear' and not kwds.has_key('num_points'): return list_plot3d_matrix(v, texture=texture, **kwds) else: l=[] for i in xrange(v.nrows()): for j in xrange(v.ncols()): l.append((i,j,v[i,j])) return list_plot3d_tuples(l,interpolation_type,texture,**kwds) if type(v)==numpy.ndarray: return list_plot3d(matrix(v),interpolation_type,texture,**kwds) if isinstance(v, list): if len(v) == 0: # return empty 3d graphic from base import Graphics3d return Graphics3d() elif isinstance(v[0],tuple) or point_list==True and len(v[0]) == 3: return list_plot3d_tuples(v,interpolation_type,texture=texture, **kwds) else: return list_plot3d_array_of_arrays(v, interpolation_type,texture, **kwds) raise TypeError, "v must be a matrix or list" | 292a253ce08cb384e7577458166b516aa28346a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/292a253ce08cb384e7577458166b516aa28346a6/list_plot3d.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
4032,
23,
72,
12,
90,
16,
12851,
67,
723,
2218,
1886,
2187,
11428,
1546,
5854,
4941,
3113,
1634,
67,
1098,
33,
7036,
16,
636,
25577,
4672,
3536,
432,
890,
17,
31236,
3207,
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,
666,
67,
4032,
23,
72,
12,
90,
16,
12851,
67,
723,
2218,
1886,
2187,
11428,
1546,
5854,
4941,
3113,
1634,
67,
1098,
33,
7036,
16,
636,
25577,
4672,
3536,
432,
890,
17,
31236,
3207,
434... |
for v in Version.select(self.__env): | for v in Version.select(self.env_open()): | def _do_version_list(self): data = [] for v in Version.select(self.__env): data.append((v.name, v.time and self._format_date(v.time))) self.print_listing(['Name', 'Time'], data) | 132f03448459e7c8907500129479bb5f6c5bc47a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/132f03448459e7c8907500129479bb5f6c5bc47a/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
1589,
67,
1098,
12,
2890,
4672,
501,
273,
5378,
364,
331,
316,
4049,
18,
4025,
12,
2890,
18,
3074,
67,
3190,
1435,
4672,
501,
18,
6923,
12443,
90,
18,
529,
16,
331,
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,
389,
2896,
67,
1589,
67,
1098,
12,
2890,
4672,
501,
273,
5378,
364,
331,
316,
4049,
18,
4025,
12,
2890,
18,
3074,
67,
3190,
1435,
4672,
501,
18,
6923,
12443,
90,
18,
529,
16,
331,
18... |
a little longer and uses more memory. | a little longer and uses more memory. | def _pickle_DebugMode_Maker(maker): raise NotImplementedError('DebugMode is not picklable (yet)') | 9b4af0ce9c47ac8d047e3343176029ad0ec512da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/9b4af0ce9c47ac8d047e3343176029ad0ec512da/debugmode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
20847,
67,
2829,
2309,
67,
12373,
12,
29261,
4672,
1002,
11206,
2668,
2829,
2309,
353,
486,
6002,
80,
429,
261,
24404,
2506,
13,
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,
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,
20847,
67,
2829,
2309,
67,
12373,
12,
29261,
4672,
1002,
11206,
2668,
2829,
2309,
353,
486,
6002,
80,
429,
261,
24404,
2506,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if con.name == connector_name: | if con.getName() == connector_name: | def getConnector(self, connector_name): for con in self.connector_list: if con.name == connector_name: return con return None | 961821a20ae2dbd3026d4f99905a647760874cd0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6393/961821a20ae2dbd3026d4f99905a647760874cd0/connectormanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
7487,
12,
2890,
16,
8703,
67,
529,
4672,
364,
356,
316,
365,
18,
23159,
67,
1098,
30,
309,
356,
18,
17994,
1435,
422,
8703,
67,
529,
30,
327,
356,
327,
599,
2,
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,
1,
1,
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,
7487,
12,
2890,
16,
8703,
67,
529,
4672,
364,
356,
316,
365,
18,
23159,
67,
1098,
30,
309,
356,
18,
17994,
1435,
422,
8703,
67,
529,
30,
327,
356,
327,
599,
2,
-100,
-100,
-100,... |
res = self.__checkIntegrity(storageElement,pfnRepIDs,allReplicaInfo) | res = self.__checkIntegrity( storageElement, pfnRepIDs, allReplicaInfo ) | def __issuePrestageRequests(self,storageElement,seReplicaIDs,allReplicaInfo): # First select which files can be eligible for prestaging based on the available space usedSpace = 0 if self.storageElementUsage.has_key(storageElement): usedSpace = self.storageElementUsage[storageElement]['TotalSize'] totalSpace = gConfig.getValue("/Resources/StorageElements/%s/CacheSize" % storageElement,0) if not totalSpace: gLogger.info("StageRequest__issuePrestageRequests: No space restriction at %s" % (storageElement)) selectedReplicaIDs = seReplicaIDs elif (totalSpace > usedSpace): gLogger.info("StageRequest__issuePrestageRequests: %.2f GB available at %s" % ((totalSpace-usedSpace)/(1000*1000*1000.0),storageElement)) selectedReplicaIDs = [] for replicaID in seReplicaIDs: if totalSpace > usedSpace: usedSpace += allReplicaInfo[replicaID]['Size'] selectedReplicaIDs.append(replicaID) else: gLogger.info("StageRequest__issuePrestageRequests: %.2f GB used at %s (limit %2.f GB)" % ((usedSpace)/(1000*1000*1000.0),storageElement,totalSpace/(1000*1000*1000.0))) return gLogger.info("StageRequest__issuePrestageRequests: Selected %s files eligible for staging at %s." % (len(selectedReplicaIDs),storageElement)) | 87d9e4a612b5cfd0ddcec58ce5dded533250cdc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/87d9e4a612b5cfd0ddcec58ce5dded533250cdc2/StageRequestAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13882,
1386,
12869,
6421,
12,
2890,
16,
5697,
1046,
16,
307,
14222,
5103,
16,
454,
14222,
966,
4672,
468,
5783,
2027,
1492,
1390,
848,
506,
21351,
364,
675,
334,
5755,
2511,
603,
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,
1001,
13882,
1386,
12869,
6421,
12,
2890,
16,
5697,
1046,
16,
307,
14222,
5103,
16,
454,
14222,
966,
4672,
468,
5783,
2027,
1492,
1390,
848,
506,
21351,
364,
675,
334,
5755,
2511,
603,
3... |
if self.selCmp.designer: sb = self.selCmp.designer.model.editor.statusBar.progress | if self.selDesgn: sb = self.selDesgn.model.editor.statusBar.progress | def selectObject(self, compn, selectInContainment = true): """ Select an object in the inspector by populating the property pages. This method is called from the InspectableObjectCollection derived classes """ | 2b9c9a7f639bf2f46c9322e4d29e991a0cf665a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2b9c9a7f639bf2f46c9322e4d29e991a0cf665a6/Inspector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
921,
12,
2890,
16,
1161,
82,
16,
2027,
382,
22928,
475,
273,
638,
4672,
3536,
6766,
392,
733,
316,
326,
22700,
635,
3650,
1776,
326,
1272,
4689,
18,
1220,
707,
353,
2566,
628,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2027,
921,
12,
2890,
16,
1161,
82,
16,
2027,
382,
22928,
475,
273,
638,
4672,
3536,
6766,
392,
733,
316,
326,
22700,
635,
3650,
1776,
326,
1272,
4689,
18,
1220,
707,
353,
2566,
628,
32... |
security.declareProtected(ManageVersioningPolicies, 'manage_setPolicies') | security.declareProtected(ManageVersioningPolicies, 'manage_setTypePolicies') | def hasPolicy(self, obj): content_type = obj.portal_type return bool(self._version_policy_mapping.get(content_type, None)) | 1c21bc6d2473c434e8517c9780f9476f92878f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11952/1c21bc6d2473c434e8517c9780f9476f92878f61/CopyModifyMergeRepositoryTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
2582,
12,
2890,
16,
1081,
4672,
913,
67,
723,
273,
1081,
18,
24386,
67,
723,
327,
1426,
12,
2890,
6315,
1589,
67,
5086,
67,
6770,
18,
588,
12,
1745,
67,
723,
16,
599,
3719,
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,
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,
711,
2582,
12,
2890,
16,
1081,
4672,
913,
67,
723,
273,
1081,
18,
24386,
67,
723,
327,
1426,
12,
2890,
6315,
1589,
67,
5086,
67,
6770,
18,
588,
12,
1745,
67,
723,
16,
599,
3719,
2,
... |
FileObjList = [] for dirpath, dirnames, filenames in os.walk(sys.argv[1]): for d in dirnames: if d.startswith('.'): dirnames.remove(d) for f in filenames: FullName = os.path.join(dirpath, f) if os.path.splitext(f)[1] in ('.h', '.c'): model = f.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H collector = CodeFragmentCollector.CodeFragmentCollector(FullName) collector.ParseFile() collector.PrintFragments() BaseName = os.path.basename(f) DirName = os.path.dirname(FullName) Ext = os.path.splitext(f)[1].lstrip('.') ModifiedTime = os.path.getmtime(FullName) FileObj = DataClass.FileClass(-1, BaseName, Ext, DirName, FullName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), []) FileObjList.append(FileObj) collector.CleanFileProfileBuffer() | if __name__ == '__main__': | def GetFunctionList(): FuncObjList = [] for FuncDef in FileProfile.FunctionDefinitionList: ParamIdList = [] DeclSplitList = FuncDef.Declarator.split('(') FuncName = DeclSplitList[0] ParamStr = DeclSplitList[1].rstrip(')') FuncNameLine = FuncDef.NamePos[0] FuncNameOffset = FuncDef.NamePos[1] LineSkipped = 0 OffsetSkipped = 0 Start = 0 while FuncName.find('\n', Start) != -1: LineSkipped += 1 OffsetSkipped = 0 Start += FuncName.find('\n', Start) Start += 1 OffsetSkipped += len(FuncName[Start:]) OffsetSkipped += 1 #skip '(' ParamBeginLine = FuncNameLine + LineSkipped ParamBeginOffset = OffsetSkipped for p in ParamStr.split(','): ListP = p.split() ParamName = ListP[-1] RightSpacePos = p.rfind(ParamName) ParamModifier = p[0:RightSpacePos] Start = 0 while p.find('\n', Start) != -1: LineSkipped += 1 OffsetSkipped = 0 Start += p.find('\n', Start) Start += 1 OffsetSkipped += len(p[Start:]) ParamEndLine = ParamBeginLine + LineSkipped ParamEndOffset = OffsetSkipped IdParam = DataClass.IdentifierClass(-1, ParamModifier, '', ParamName, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -1, -1, ParamBeginLine, ParamBeginOffset, ParamEndLine, ParamEndOffset) ParamIdList.append(IdParam) ParamBeginLine = ParamEndLine ParamBeginOffset = OffsetSkipped + 1 #skip ',' FuncObj = DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDef.Modifier, FuncName.strip(), '', FuncDef.StartPos[0],FuncDef.StartPos[1],FuncDef.EndPos[0],FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, ParamIdList, []) FuncObjList.append(FuncObj) return FuncObjList | b67e74c2ce7f3a1f1ae5003eada4673af7e62ae9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/914/b67e74c2ce7f3a1f1ae5003eada4673af7e62ae9/c.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2083,
682,
13332,
6165,
2675,
682,
273,
5378,
364,
6165,
3262,
316,
1387,
4029,
18,
2083,
1852,
682,
30,
3014,
22117,
273,
5378,
16110,
5521,
682,
273,
6165,
3262,
18,
31419,
18,
49... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
968,
2083,
682,
13332,
6165,
2675,
682,
273,
5378,
364,
6165,
3262,
316,
1387,
4029,
18,
2083,
1852,
682,
30,
3014,
22117,
273,
5378,
16110,
5521,
682,
273,
6165,
3262,
18,
31419,
18,
49... |
returncode = shtools.execute(ctxt, executable=executable, args=args) | returncode = shtools.execute(ctxt, executable=executable, args=margs) | def make(ctxt, target=None, file_=None, keep_going=False): """Execute a Makefile target. :param ctxt: the build context :type ctxt: `Context` :param file\_: name of the Makefile :param keep_going: whether make should keep going when errors are encountered """ executable = ctxt.config.get_filepath('make.path') or 'make' args = ['--directory', ctxt.basedir] if file_: args += ['--file', ctxt.resolve(file_)] if keep_going: args.append('--keep-going') if target: args.append(target) from bitten.build import shtools returncode = shtools.execute(ctxt, executable=executable, args=args) if returncode != 0: ctxt.error('make failed (%s)' % returncode) | a8229bf1cb2f568adce3c329c24ddc8f0387f30e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4547/a8229bf1cb2f568adce3c329c24ddc8f0387f30e/ctools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
12,
20364,
16,
1018,
33,
7036,
16,
585,
67,
33,
7036,
16,
3455,
67,
8162,
33,
8381,
4672,
3536,
5289,
279,
4344,
768,
1018,
18,
225,
294,
891,
14286,
30,
326,
1361,
819,
294,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
20364,
16,
1018,
33,
7036,
16,
585,
67,
33,
7036,
16,
3455,
67,
8162,
33,
8381,
4672,
3536,
5289,
279,
4344,
768,
1018,
18,
225,
294,
891,
14286,
30,
326,
1361,
819,
294,
7... |
global prevtime | global prevtime, incdir | def backup_final_init(rpout): """Open the backup log and the error log, create increments dir""" global prevtime if Log.verbosity > 0: Log.open_logfile(Globals.rbdir.append("backup.log")) checkdest_if_necessary(rpout) prevtime = backup_get_mirrortime() if prevtime >= Time.curtime: Log.FatalError( | 4275530cc4703b385bb9ee6795aa7071cdf0b832 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6202/4275530cc4703b385bb9ee6795aa7071cdf0b832/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5114,
67,
6385,
67,
2738,
12,
13832,
659,
4672,
3536,
3678,
326,
5114,
613,
471,
326,
555,
613,
16,
752,
17071,
1577,
8395,
2552,
2807,
957,
16,
7290,
1214,
309,
1827,
18,
16629,
8807,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5114,
67,
6385,
67,
2738,
12,
13832,
659,
4672,
3536,
3678,
326,
5114,
613,
471,
326,
555,
613,
16,
752,
17071,
1577,
8395,
2552,
2807,
957,
16,
7290,
1214,
309,
1827,
18,
16629,
8807,
... |
super(virtual_wizard,self).exp_create(db, uid, 'module.upgrade', datas) | if wiz_id == 1: wiz_name ='base_setup.base_setup' if wiz_id == 2: wiz_name ='module.upgrade' super(virtual_wizard,self).exp_create(db, uid, wiz_name, datas) | def exp_execute(self, db, uid, wiz_id, datas, action='init', context=None): if wiz_id not in self.wiz_uid: super(virtual_wizard,self).exp_create(db, uid, 'module.upgrade', datas) new_ids = [] if 'id' in datas: datas['id'] = caldevIDs2readIDs(datas['id']) for id in datas['ids']: new_ids.append(caldevIDs2readIDs(id)) datas['ids'] = new_ids res=super(virtual_wizard, self).exp_execute(db, uid, wiz_id, datas, action, context) return res | 6ff8fbdabbad88d8add9b13e689aa6d24c731fad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/6ff8fbdabbad88d8add9b13e689aa6d24c731fad/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1329,
67,
8837,
12,
2890,
16,
1319,
16,
4555,
16,
341,
452,
67,
350,
16,
5386,
16,
1301,
2218,
2738,
2187,
819,
33,
7036,
4672,
309,
341,
452,
67,
350,
486,
316,
365,
18,
91,
452,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1329,
67,
8837,
12,
2890,
16,
1319,
16,
4555,
16,
341,
452,
67,
350,
16,
5386,
16,
1301,
2218,
2738,
2187,
819,
33,
7036,
4672,
309,
341,
452,
67,
350,
486,
316,
365,
18,
91,
452,
... |
try: return nget(self.images, name)['contributors'] | ns, partial, full = self.nshandler.splitname(name, defaultns=nshandling.NS_FILE) try: return nget(self.images, partial)['contributors'] | def getContributors(self, name, wikidb=None): try: return nget(self.images, name)['contributors'] except KeyError: return [] | f9d625b27f84327061ee7997c5179b1b01c70479 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/f9d625b27f84327061ee7997c5179b1b01c70479/zipwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
442,
665,
13595,
12,
2890,
16,
508,
16,
341,
1766,
350,
70,
33,
7036,
4672,
3153,
16,
4702,
16,
1983,
273,
365,
18,
82,
674,
464,
749,
18,
4939,
529,
12,
529,
16,
805,
2387,
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,
336,
442,
665,
13595,
12,
2890,
16,
508,
16,
341,
1766,
350,
70,
33,
7036,
4672,
3153,
16,
4702,
16,
1983,
273,
365,
18,
82,
674,
464,
749,
18,
4939,
529,
12,
529,
16,
805,
2387,
3... |
(str(callable), str(e))) | (callable_name, str(e))) | def wrapper(%s): # no *args - no GIL for mallocing the tuple if after: after() # from now on we hold the GIL try: result = callable(%s) except Exception, e: os.write(2, "Warning: uncaught exception in callback: %%s %%s\n" %% (str(callable), str(e))) result = errorcode if before: before() # here we don't hold the GIL any more. As in the wrapper() produced # by llexternal, it is essential that no exception checking occurs # after the call to before(). return result | 291a37db9b6702ac1bc167cb4a4d310f3a5da14a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/291a37db9b6702ac1bc167cb4a4d310f3a5da14a/rffi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
9275,
87,
4672,
565,
468,
1158,
380,
1968,
300,
1158,
611,
2627,
364,
312,
9853,
310,
326,
3193,
309,
1839,
30,
1839,
1435,
468,
628,
2037,
603,
732,
6887,
326,
611,
2627,
775,
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,
4053,
9275,
87,
4672,
565,
468,
1158,
380,
1968,
300,
1158,
611,
2627,
364,
312,
9853,
310,
326,
3193,
309,
1839,
30,
1839,
1435,
468,
628,
2037,
603,
732,
6887,
326,
611,
2627,
775,
3... |
base_filter['geo_type'] = geo_types | if geo_types is not None: base_filter['geo_type'] = geo_types | def build_geo_filters(self, path='', meta_types=None, geo_types=[], approved=True, landscape_type=[], administrative_level=[], lat_min=-90., lat_max=90., lon_min=-180., lon_max=180., query='', country='', languages=None, first_letter=None): base_filter = {} | f0ca280d9726e865084434bd19a22ad2d8267eed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/f0ca280d9726e865084434bd19a22ad2d8267eed/GeoMapTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
12376,
67,
6348,
12,
2890,
16,
589,
2218,
2187,
2191,
67,
2352,
33,
7036,
16,
7856,
67,
2352,
22850,
6487,
20412,
33,
5510,
16,
19193,
12476,
67,
723,
22850,
6487,
30162,
1535,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
12376,
67,
6348,
12,
2890,
16,
589,
2218,
2187,
2191,
67,
2352,
33,
7036,
16,
7856,
67,
2352,
22850,
6487,
20412,
33,
5510,
16,
19193,
12476,
67,
723,
22850,
6487,
30162,
1535,... |
buf = BIO.MemoryBuffer(cleartext) | buf = BIO.MemoryBuffer(self.cleartext) | def check_5_signEncrypt(self): global signedEncrypted s = SMIME.SMIME() buf = BIO.MemoryBuffer(cleartext) s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf) x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) s.set_cipher(SMIME.Cipher('des_ede3_cbc')) tmp = BIO.MemoryBuffer() s.write(tmp, p7) p7 = s.encrypt(tmp) # XXX Hmm, how to get PKCS7_SIGNED_ENVELOPED? assert p7.type() == SMIME.PKCS7_ENVELOPED, p7.type() out = BIO.MemoryBuffer() s.write(out, p7) signedEncrypted = out | 8d88bcc39abdc6db218e3a485dc691c215692d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/8d88bcc39abdc6db218e3a485dc691c215692d64/test_smime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
25,
67,
2977,
13129,
12,
2890,
4672,
2552,
6726,
14678,
225,
272,
273,
12014,
3114,
18,
7303,
3114,
1435,
225,
1681,
273,
605,
4294,
18,
6031,
1892,
12,
2890,
18,
2131,
485,
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,
866,
67,
25,
67,
2977,
13129,
12,
2890,
4672,
2552,
6726,
14678,
225,
272,
273,
12014,
3114,
18,
7303,
3114,
1435,
225,
1681,
273,
605,
4294,
18,
6031,
1892,
12,
2890,
18,
2131,
485,
4... |
for rtp in [audio_rtp]: self.waiting_for.append(rtp) self.notification_center.add_observer(self, "SCRTPTransportDidInitialize", rtp) self.notification_center.add_observer(self, "SCRTPTransportDidFail", rtp) rtp.set_INIT() | if audio_rtp is not None: self.waiting_for.append(audio_rtp) self.notification_center.add_observer(self, "SCRTPTransportDidInitialize", audio_rtp) self.notification_center.add_observer(self, "SCRTPTransportDidFail", audio_rtp) audio_rtp.set_INIT() | def __init__(self, session, continuation_func, failure_func, audio_rtp, msrp_chat): self.continuation_func = continuation_func self.failure_func = failure_func self.audio_rtp = audio_rtp self.msrp_chat = msrp_chat self.notification_center = NotificationCenter() self.waiting_for = [] self._lock = allocate_lock() with self._lock: for rtp in [audio_rtp]: self.waiting_for.append(rtp) self.notification_center.add_observer(self, "SCRTPTransportDidInitialize", rtp) self.notification_center.add_observer(self, "SCRTPTransportDidFail", rtp) rtp.set_INIT() if msrp_chat is not None: self.waiting_for.append(msrp_chat) self.notification_center.add_observer(self, "MSRPChatDidInitialize", msrp_chat) self.notification_center.add_observer(self, "MSRPChatDidFail", msrp_chat) msrp_chat.initialize(session.msrp_options["local_ip"], session.msrp_options["local_port"], session.msrp_options["local_use_tls"]) self._check_done() | db32412a9d0019f9248c848b4c506600510ed7da /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/db32412a9d0019f9248c848b4c506600510ed7da/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
17378,
67,
644,
16,
5166,
67,
644,
16,
7447,
67,
3797,
84,
16,
4086,
13832,
67,
10880,
4672,
365,
18,
1213,
23946,
67,
644,
273,
17378,
67,
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,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
17378,
67,
644,
16,
5166,
67,
644,
16,
7447,
67,
3797,
84,
16,
4086,
13832,
67,
10880,
4672,
365,
18,
1213,
23946,
67,
644,
273,
17378,
67,
6... |
base['subarches'] = subarches | base['subarches'] = featuresets | def _readArch(self, arch): config = ConfigParser(self.schemas) config.read(self.getFiles("%s/%s" % (arch, self.config_name))) | 4fce5d1f110fa164dbdea466ff857ee6aec6f31a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5794/4fce5d1f110fa164dbdea466ff857ee6aec6f31a/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
12269,
12,
2890,
16,
6637,
4672,
642,
273,
25076,
12,
2890,
18,
17928,
13,
642,
18,
896,
12,
2890,
18,
588,
2697,
27188,
87,
5258,
87,
6,
738,
261,
991,
16,
365,
18,
1425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
12269,
12,
2890,
16,
6637,
4672,
642,
273,
25076,
12,
2890,
18,
17928,
13,
642,
18,
896,
12,
2890,
18,
588,
2697,
27188,
87,
5258,
87,
6,
738,
261,
991,
16,
365,
18,
1425,
... |
def axes_range(self, xmin=None, xmax=None, ymin=None, ymax=None): | def get_axes_range(self): """ Returns a dictionary of the range of the axes for this graphics object. This is fall back to the ranges in get_minmax_data() for any value which the user has not explicitly set. WARNING: Changing the dictionary returned by this function does not change the axes range for this object. To do that, use the set_axes_range function. EXAMPLES: sage: L = line([(1,2), (3,-4), (2, 5), (1,2)]) sage: list(sorted(L.get_axes_range().items())) [('xmax', 3.0), ('xmin', 1.0), ('ymax', 5.0), ('ymin', -4.0)] sage: L.set_axes_range(xmin=-1) sage: list(sorted(L.get_axes_range().items())) [('xmax', 3.0), ('xmin', -1.0), ('ymax', 5.0), ('ymin', -4.0)] """ axes_range = self.get_minmax_data() axes_range.update(self._get_axes_range_dict()) return axes_range def set_axes_range(self, xmin=None, xmax=None, ymin=None, ymax=None): | def axes_range(self, xmin=None, xmax=None, ymin=None, ymax=None): """ Set the ranges of the $x$ and $y$ axes. | acd1446765c851ba4fd5c80c2948dac5c51da03b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/acd1446765c851ba4fd5c80c2948dac5c51da03b/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10855,
67,
3676,
12,
2890,
4672,
3536,
2860,
279,
3880,
434,
326,
1048,
434,
326,
6515,
364,
333,
17313,
733,
18,
225,
1220,
353,
4159,
1473,
358,
326,
7322,
316,
336,
67,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10855,
67,
3676,
12,
2890,
4672,
3536,
2860,
279,
3880,
434,
326,
1048,
434,
326,
6515,
364,
333,
17313,
733,
18,
225,
1220,
353,
4159,
1473,
358,
326,
7322,
316,
336,
67,
115... |
self.pack_start(box_type_frame, False, False) | self.contents.pack_start(box_type_frame, False, False) | def __init__(self, image_width = 0, image_height = 0, pixbuf = 0, x = 0, y = 0, width = 0, height = 0, ocr_engines_list = []): super(BoxEditor, self).__init__() self.pixbuf = pixbuf self.image_window = gtk.ScrolledWindow() self.image_window.set_size_request(200, 200) self.image_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.x_spin_button = gtk.SpinButton(gtk.Adjustment(0,0,0,1), 1.0, 0) self.setX(x) self.y_spin_button = gtk.SpinButton(gtk.Adjustment(0,0,0,1), 1.0, 0) self.setY(y) self.width_spin_button = gtk.SpinButton(gtk.Adjustment(0,0,0,1), 1.0, 0) self.setWidth(width) self.height_spin_button = gtk.SpinButton(gtk.Adjustment(0,0,0,1), 1.0, 0) self.setHeight(height) self.make_text_button = self.__makeRadioButton(_('Text'), 'gnome-mime-text') self.make_image_button = self.__makeRadioButton(_('Image'), 'gnome-mime-image', self.make_text_button) box_type_frame = gtk.Frame(_('Type')) box_type_table = gtk.Table(1, 2, True) box_type_table.attach(self.make_text_button, 0, 1, 0, 1) box_type_table.attach(self.make_image_button, 1, 2, 0, 1) box_type_frame.add(box_type_table) self.pack_start(box_type_frame, False, False) self.image_width = image_width self.image_height = image_height self.pack_start(self.image_window, False, False) dimensions_frame = gtk.Frame(_('Bounds')) dimensions_table = gtk.Table(2, 4, True) dimensions_table.attach(gtk.Label(_('X')), 0, 1, 0, 1) dimensions_table.attach(self.x_spin_button, 1, 2, 0, 1) dimensions_table.attach(gtk.Label(_('Y')), 2, 3, 0, 1) dimensions_table.attach(self.y_spin_button, 3, 4, 0, 1) dimensions_table.attach(gtk.Label(_('Width')), 0, 1, 1, 2) dimensions_table.attach(self.width_spin_button, 1, 2, 1, 2) dimensions_table.attach(gtk.Label(_('Height')), 2, 3, 1, 2) dimensions_table.attach(self.height_spin_button, 3, 4, 1, 2) dimensions_frame.add(dimensions_table) self.pack_start(dimensions_frame, False, False) self.setXRange() self.setYRange() self.setWidthRange() self.setHeightRange() self.text_properties_frame = self.__makeOcrProperties(ocr_engines_list) self.add(self.text_properties_frame) self.set_spacing(10) self.show_all() | 0aaed0a9481d2dc56c4287a7a5e7804d4fe8ab22 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3764/0aaed0a9481d2dc56c4287a7a5e7804d4fe8ab22/widgetPresenter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1316,
67,
2819,
273,
374,
16,
1316,
67,
4210,
273,
374,
16,
11871,
4385,
273,
374,
16,
619,
273,
374,
16,
677,
273,
374,
16,
1835,
273,
374,
16,
2072,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1316,
67,
2819,
273,
374,
16,
1316,
67,
4210,
273,
374,
16,
11871,
4385,
273,
374,
16,
619,
273,
374,
16,
677,
273,
374,
16,
1835,
273,
374,
16,
2072,
... |
"""Testing recfrom() over UDP.""" | """Testing recvfrom() over UDP.""" | def testRecvFrom(self): """Testing recfrom() over UDP.""" msg, addr = self.serv.recvfrom(len(MSG)) hostname, port = addr ##self.assertEqual(hostname, socket.gethostbyname('localhost')) self.assertEqual(msg, MSG) | dfad1a9039df367c9a403e2b777fe2690f3b5b88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dfad1a9039df367c9a403e2b777fe2690f3b5b88/test_socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
28470,
1265,
12,
2890,
4672,
3536,
22218,
10665,
2080,
1435,
1879,
16230,
12123,
1234,
16,
3091,
273,
365,
18,
23039,
18,
18334,
2080,
12,
1897,
12,
11210,
3719,
5199,
16,
1756,
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,
1842,
28470,
1265,
12,
2890,
4672,
3536,
22218,
10665,
2080,
1435,
1879,
16230,
12123,
1234,
16,
3091,
273,
365,
18,
23039,
18,
18334,
2080,
12,
1897,
12,
11210,
3719,
5199,
16,
1756,
273,... |
['::', '', 1, ['', '', '', '', ''], 0.0, 0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-::', '', 1, ['-', '', '', '', ''], -0.0, -0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-0:00:00.01', '', 1, ['-', '0', '00', '00', '.01'], -2.77777777778e-06, -0.01, '-0:00:00.01', ['-0:00:00', '-0:00:00.0', '-0:00:00.01']], [' +1', '', 1, ['+', '1', ''], 1.0, 1.0, '1', ['1:00:00', '1:00:00.0', '1:00:00.00']], ['-1.2345', '', 1, ['-', '1', '.2345'], -1.2345, -1.2345, '-1.2345', ['-1:14:04', '-1:14:04.2', '-1:14:04.20']], ['-123::', '', 1, ['-', '123', '', '', ''], -123.0, -442800.0, '-123:00:00', ['-123:00:00', '-123:00:00.0', '-123:00:00.00']], ['-123:4', '', 1, ['-', '123', '4', ''], -123.066666666667, -7384.0, '-123:04', ['-123:03:60', '-123:03:60.0', '-123:03:60.00']], ['-123:45', '', 1, ['-', '123', '45', ''], -123.75, -7425.0, '-123:45', ['-123:45:00', '-123:45:00.0', '-123:45:00.00']], ['-123:4.56789', '', 1, ['-', '123', '4', '.56789'], -123.0761315, -7384.56789, '-123:04.56789', ['-123:04:34', '-123:04:34.1', '-123:04:34.07']], ['-123:45.6789', '', 1, ['-', '123', '45', '.6789'], -123.761315, -7425.6789, '-123:45.6789', ['-123:45:41', '-123:45:40.7', '-123:45:40.73']], ['1:2:', '', 1, ['', '1', '2', '', ''], 1.0333333333, 3720.0, '1:02:00', ['1:02:00', '1:02:00.0', '1:02:00.00']], ['1:2:3', '', 1, ['', '1', '2', '3', ''], 1.03416666667, 3723.0, '1:02:03', ['1:02:03', '1:02:03.0', '1:02:03.00']], ['1:2:3.456789', '', 1, ['', '1', '2', '3', '.456789'], 1.0342935525, 3723.456789, '1:02:03.456789', ['1:02:03', '1:02:03.5', '1:02:03.46']], ['1:23:4', '', 1, ['', '1', '23', '4', ''], 1.3844444444, 4984.0, '1:23:04', ['1:23:04', '1:23:04.0', '1:23:04.00']], ['1:23:45', '', 1, ['', '1', '23', '45', ''], 1.3958333333, 5025.0, '1:23:45', ['1:23:45', '1:23:45.0', '1:23:45.00']], ['123:45:6.789', '', 1, ['', '123', '45', '6', '.789'], 123.7518858333, 445506.789, '123:45:06.789', ['123:45:07', '123:45:06.8', '123:45:06.79']], ['123:45:56.789', '', 1, ['', '123', '45', '56', '.789'], 123.765774722, 445556.789, '123:45:56.789', ['123:45:57', '123:45:56.8', '123:45:56.79']], ['-0::12.34', 'bug test; the sign must be retained', 1, ['-', '0', '', '12', '.34'], -0.00342777778, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['-::12.34', 'a weird gray area, but it works', 1, ['-', '', '', '12', '.34'], -0.00342777778, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['::12.34', '', 1, ['', '', '', '12', '.34'], 0.00342777778, 12.34, '0:00:12.34', ['0:00:12', '0:00:12.3', '0:00:12.34']], ['1:23.4567', '', 1, ['', '1', '23', '.4567'], 1.390945, 83.4567, '1:23.4567', ['1:23:27', '1:23:27.4', '1:23:27.40']], ['-1.234567', '', 1, ['-', '1', '.234567'], -1.234567, -1.234567, '-1.234567', ['-1:14:04', '-1:14:04.4', '-1:14:04.44']], ['-1:abadstr', 'invalid characters', 0, None, None, None, None, None], ['-1:2343:24', 'too many minutes digits', 0, None, None, None, None, None], ['1:-1:24', 'minus sign in wrong place', 0, None, None, None, None, None], | ['::', '', True, ['' , '', '', '', ''], 0.0, 0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-::', '', True, ['-', '', '', '', ''], -0.0, -0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-0:00:00.01', '', True, ['-', '0', '00', '00', '.01'], -2.7777777777777775e-06, -0.01, '-0:00:00.01', ['-0:00:00', '-0:00:00.0', '-0:00:00.01']], [' +1', '', True, ['+', '1', ''], 1.0, 1.0, '1', ['1:00:00', '1:00:00.0', '1:00:00.00']], ['-1.2345', '', True, ['-', '1', '.2345'], -1.2344999999999999, -1.2344999999999999, '-1.2345', ['-1:14:04', '-1:14:04.2', '-1:14:04.20']], ['-123::', '', True, ['-', '123', '', '', ''], -123.0, -442800.0, '-123:00:00', ['-123:00:00', '-123:00:00.0', '-123:00:00.00']], ['-123:4', 'make sure seconds field is not 60 from dmsStrFromDeg', True, ['-', '123', '4', ''], -123.06666666666666, -7384.0, '-123:04', ['-123:04:00', '-123:04:00.0', '-123:04:00.00']], ['-123:45', '', True, ['-', '123', '45', ''], -123.75, -7425.0, '-123:45', ['-123:45:00', '-123:45:00.0', '-123:45:00.00']], ['-123:4.56789', '', True, ['-', '123', '4', '.56789'], -123.0761315, -7384.5678900000003, '-123:04.56789', ['-123:04:34', '-123:04:34.1', '-123:04:34.07']], ['-123:45.6789', '', True, ['-', '123', '45', '.6789'], -123.761315, -7425.6788999999999, '-123:45.6789', ['-123:45:41', '-123:45:40.7', '-123:45:40.73']], ['1:2:', '', True, ['', '1', '2', '', ''], 1.0333333333333334, 3720.0, '1:02:00', ['1:02:00', '1:02:00.0', '1:02:00.00']], ['1:2:3', '', True, ['', '1', '2', '3', ''], 1.0341666666666667, 3723.0, '1:02:03', ['1:02:03', '1:02:03.0', '1:02:03.00']], ['1:2:3.456789', '', True, ['', '1', '2', '3', '.456789'], 1.0342935525000001, 3723.4567889999998, '1:02:03.456789', ['1:02:03', '1:02:03.5', '1:02:03.46']], ['1:23:4', '', True, ['', '1', '23', '4', ''], 1.3844444444444444, 4984.0, '1:23:04', ['1:23:04', '1:23:04.0', '1:23:04.00']], ['1:23:45', '', True, ['', '1', '23', '45', ''], 1.3958333333333333, 5025.0, '1:23:45', ['1:23:45', '1:23:45.0', '1:23:45.00']], ['123:45:6.789', '', True, ['', '123', '45', '6', '.789'], 123.75188583333333, 445506.78899999999, '123:45:06.789', ['123:45:07', '123:45:06.8', '123:45:06.79']], ['123:45:56.789', '', True, ['', '123', '45', '56', '.789'], 123.76577472222222, 445556.78899999999, '123:45:56.789', ['123:45:57', '123:45:56.8', '123:45:56.79']], ['-0::12.34', 'bug test; the sign must be retained', True, ['-', '0', '', '12', '.34'], -0.0034277777777777779, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['-::12.34', 'a weird gray area, but it works', True, ['-', '', '', '12', '.34'], -0.0034277777777777779, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['::12.34', '', True, ['', '', '', '12', '.34'], 0.0034277777777777779, 12.34, '0:00:12.34', ['0:00:12', '0:00:12.3', '0:00:12.34']], ['1:23.4567', '', True, ['', '1', '23', '.4567'], 1.3909450000000001, 83.456699999999998, '1:23.4567', ['1:23:27', '1:23:27.4', '1:23:27.40']], ['-1.234567', '', True, ['-', '1', '.234567'], -1.234567, -1.234567, '-1.234567', ['-1:14:04', '-1:14:04.4', '-1:14:04.44']], ['-1:abadstr', 'invalid characters', False, None, None, None, None, None], ['-1:2343:24', 'too many minutes digits', False, None, None, None, None, None], ['1:-1:24', 'minus sign in wrong place', False, None, None, None, None, None], | def _assertTest(): """Runs a test by comparing results to those expected and only failing if something is wrong. """ testSet = ( ['::', '', 1, ['', '', '', '', ''], 0.0, 0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-::', '', 1, ['-', '', '', '', ''], -0.0, -0.0, '0:00:00', ['0:00:00', '0:00:00.0', '0:00:00.00']], ['-0:00:00.01', '', 1, ['-', '0', '00', '00', '.01'], -2.77777777778e-06, -0.01, '-0:00:00.01', ['-0:00:00', '-0:00:00.0', '-0:00:00.01']], [' +1', '', 1, ['+', '1', ''], 1.0, 1.0, '1', ['1:00:00', '1:00:00.0', '1:00:00.00']], ['-1.2345', '', 1, ['-', '1', '.2345'], -1.2345, -1.2345, '-1.2345', ['-1:14:04', '-1:14:04.2', '-1:14:04.20']], ['-123::', '', 1, ['-', '123', '', '', ''], -123.0, -442800.0, '-123:00:00', ['-123:00:00', '-123:00:00.0', '-123:00:00.00']], ['-123:4', '', 1, ['-', '123', '4', ''], -123.066666666667, -7384.0, '-123:04', ['-123:03:60', '-123:03:60.0', '-123:03:60.00']], ['-123:45', '', 1, ['-', '123', '45', ''], -123.75, -7425.0, '-123:45', ['-123:45:00', '-123:45:00.0', '-123:45:00.00']], ['-123:4.56789', '', 1, ['-', '123', '4', '.56789'], -123.0761315, -7384.56789, '-123:04.56789', ['-123:04:34', '-123:04:34.1', '-123:04:34.07']], ['-123:45.6789', '', 1, ['-', '123', '45', '.6789'], -123.761315, -7425.6789, '-123:45.6789', ['-123:45:41', '-123:45:40.7', '-123:45:40.73']], ['1:2:', '', 1, ['', '1', '2', '', ''], 1.0333333333, 3720.0, '1:02:00', ['1:02:00', '1:02:00.0', '1:02:00.00']], ['1:2:3', '', 1, ['', '1', '2', '3', ''], 1.03416666667, 3723.0, '1:02:03', ['1:02:03', '1:02:03.0', '1:02:03.00']], ['1:2:3.456789', '', 1, ['', '1', '2', '3', '.456789'], 1.0342935525, 3723.456789, '1:02:03.456789', ['1:02:03', '1:02:03.5', '1:02:03.46']], ['1:23:4', '', 1, ['', '1', '23', '4', ''], 1.3844444444, 4984.0, '1:23:04', ['1:23:04', '1:23:04.0', '1:23:04.00']], ['1:23:45', '', 1, ['', '1', '23', '45', ''], 1.3958333333, 5025.0, '1:23:45', ['1:23:45', '1:23:45.0', '1:23:45.00']], ['123:45:6.789', '', 1, ['', '123', '45', '6', '.789'], 123.7518858333, 445506.789, '123:45:06.789', ['123:45:07', '123:45:06.8', '123:45:06.79']], ['123:45:56.789', '', 1, ['', '123', '45', '56', '.789'], 123.765774722, 445556.789, '123:45:56.789', ['123:45:57', '123:45:56.8', '123:45:56.79']], ['-0::12.34', 'bug test; the sign must be retained', 1, ['-', '0', '', '12', '.34'], -0.00342777778, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['-::12.34', 'a weird gray area, but it works', 1, ['-', '', '', '12', '.34'], -0.00342777778, -12.34, '-0:00:12.34', ['-0:00:12', '-0:00:12.3', '-0:00:12.34']], ['::12.34', '', 1, ['', '', '', '12', '.34'], 0.00342777778, 12.34, '0:00:12.34', ['0:00:12', '0:00:12.3', '0:00:12.34']], ['1:23.4567', '', 1, ['', '1', '23', '.4567'], 1.390945, 83.4567, '1:23.4567', ['1:23:27', '1:23:27.4', '1:23:27.40']], ['-1.234567', '', 1, ['-', '1', '.234567'], -1.234567, -1.234567, '-1.234567', ['-1:14:04', '-1:14:04.4', '-1:14:04.44']], ['-1:abadstr', 'invalid characters', 0, None, None, None, None, None], ['-1:2343:24', 'too many minutes digits', 0, None, None, None, None, None], ['1:-1:24', 'minus sign in wrong place', 0, None, None, None, None, None], ) def locAssert(fmt, res, func, *args, **kargs): assert fmt % (res,) == fmt % (func(*args, **kargs),), "%r != %r = %s(*%r, **%r)" % (res, func(*args, **kargs), func.__name__, args, kargs) nErrors = 0 for testStr, commentStr, isOK, splitStr, degVal, secVal, neatStr, dmsStr02 in testSet: try: locAssert("%r", splitStr, splitDMSStr, testStr) locAssert("%.8g", degVal, degFromDMSStr, testStr) locAssert("%.8g", secVal, secFromDMSStr, testStr) locAssert("%r", neatStr, neatenDMSStr, testStr) locAssert("%r", dmsStr02[0], dmsStrFromDeg, degVal, 3, 0) locAssert("%r", dmsStr02[1], dmsStrFromDeg, degVal, 3, 1) locAssert("%r", dmsStr02[2], dmsStrFromDeg, degVal, 3, 2) if not isOK: print "unexpected success on %r" % testStr nErrors += 1 except StandardError, e: if isOK: print "unexpected failure on %r\n\t%s\nskipping other tests on this value" % (testStr, e) nErrors += 1 if nErrors == 0: print "RO.StringUtil passed" else: print "RO.StringUtil failed with %d errors" % nErrors | 994804867e88210e2f2f130afe9f155048fe038b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6236/994804867e88210e2f2f130afe9f155048fe038b/StringUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11231,
4709,
13332,
3536,
9361,
279,
1842,
635,
17553,
1686,
358,
5348,
2665,
471,
1338,
21311,
309,
5943,
353,
7194,
18,
3536,
1842,
694,
273,
261,
10228,
2866,
2187,
10226,
1053,
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,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11231,
4709,
13332,
3536,
9361,
279,
1842,
635,
17553,
1686,
358,
5348,
2665,
471,
1338,
21311,
309,
5943,
353,
7194,
18,
3536,
1842,
694,
273,
261,
10228,
2866,
2187,
10226,
1053,
16... |
self.model.refinement_flags.individual_adp): | self.model.refinement_flags.individual_adp and self.solvent_selection.count(True) > 0): | def __init__(self, fmodel, fmodels, model, solvent_selection, params = master_params.extract(), find_peaks_params = None, log = None): adopt_init_args(self, locals()) if(self.params is None): self.params = master_params.extract() if(self.find_peaks_params is None): self.find_peaks_params = find_peaks.master_params.extract() if(self.params.mode == "filter_only"): self.filter_only = True else: self.filter_only = False if(self.log is None): self.log = sys.stdout self.xray_structure = self.fmodel.xray_structure.deep_copy_scatterers() self.sites = None self.heights = None if(self.find_peaks_params.max_number_of_peaks is None): if(self.solvent_selection.count(False) > 0): self.find_peaks_params.max_number_of_peaks = \ self.solvent_selection.count(False) else: self.find_peaks_params.max_number_of_peaks = \ self.xray_structure.scatterers().size() solsel = flex.bool(self.solvent_selection.count(False), False) solsel.extend(flex.bool(self.solvent_selection.count(True), True)) self.reset_solvent( solvent_selection = solsel, solvent_xray_structure = self.xray_structure.select(self.solvent_selection)) self.show(message = "Start model:") self.filter_solvent() if(self.filter_only == False): peaks = self.find_peaks( map_type = self.params.primary_map_type, map_cutoff = self.params.primary_map_cutoff).peaks_mapped() self.sites, self.heights = peaks.sites, peaks.heights self.add_new_solvent() self.filter_solvent() self.find_peaks_2fofc() self.show(message = "2Fo-Fc map selection:") # if(not self.filter_only and self.params.refine_adp and self.model.refinement_flags.individual_adp): self.fmodels.update_xray_structure( xray_structure = self.xray_structure, update_f_calc = True, update_f_mask = True) from mmtbx.refinement import minimization import scitbx.lbfgs if(self.params.new_solvent == "anisotropic"): selection_aniso = flex.bool( self.model.refinement_flags.adp_individual_aniso[0].size(), False) for sel in self.model.refinement_flags.adp_individual_aniso: selection_aniso = selection_aniso | sel selection_aniso.set_selected(~self.solvent_selection, False) self.model.set_refine_individual_adp(selection_aniso = selection_aniso) else: selection_iso = flex.bool( self.model.refinement_flags.adp_individual_iso[0].size(), False) for sel in self.model.refinement_flags.adp_individual_iso: selection_iso = selection_iso | sel selection_iso.set_selected(~self.solvent_selection, False) self.model.set_refine_individual_adp(selection_iso = selection_iso) lbfgs_termination_params = scitbx.lbfgs.termination_parameters( max_iterations = 25) minimized = minimization.lbfgs( restraints_manager = None, fmodels = fmodels, model = model, refine_adp = True, lbfgs_termination_params = lbfgs_termination_params) | 1408d5a5aa55de0d64056926818ee0d7f46a947a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/1408d5a5aa55de0d64056926818ee0d7f46a947a/ordered_solvent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
284,
2284,
16,
284,
7665,
16,
938,
16,
3704,
616,
67,
10705,
16,
859,
273,
4171,
67,
2010,
18,
8004,
9334,
1104,
67,
22736,
67,
2010,
273,
599,
16,
613... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
284,
2284,
16,
284,
7665,
16,
938,
16,
3704,
616,
67,
10705,
16,
859,
273,
4171,
67,
2010,
18,
8004,
9334,
1104,
67,
22736,
67,
2010,
273,
599,
16,
613... |
ret += ["--pure-happens-before=yes"]; | ret += ["--pure-happens-before=yes"] if not self.EvalBoolFlag(self._options.ignore_in_dtor): ret += ["--ignore-in-dtor=no"] | def ToolSpecificFlags(self): ret = [] | 0e71026b3e6a04297c2ed1b65616e83b74508bf8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/0e71026b3e6a04297c2ed1b65616e83b74508bf8/valgrind_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13288,
9969,
5094,
12,
2890,
4672,
325,
273,
5378,
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,
13288,
9969,
5094,
12,
2890,
4672,
325,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if not success: print "release_vessels : " + str(ret) | else: if not success: print "release_vessels : " + str(ret) | def release_vessels(vessels): """ <Purpose> 'Releases' a list of vessels by performing a changeusers on each vessel and setting the user pubkeys list to [] on each vessel. <Arguments> vessels: a list of vessels to release <Exceptions> None -- exceptions triggered by change users are caught and ignored. The idea is to release as many vessels as possible. <Side Effects> Changes the user keys on vessels to [] <Returns> True """ # this must not fail -- it can however miss nodes that are offline # at the time when we are releasing them for v in vessels: try: success, ret = acquire_vessel([], v) except: print "exception raised in release_vessels" if not success: print "release_vessels : " + str(ret) return True | 30562171f47415e0b8325423b768dfff4ba7e3e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/30562171f47415e0b8325423b768dfff4ba7e3e6/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3992,
67,
90,
403,
10558,
12,
90,
403,
10558,
4672,
3536,
411,
10262,
4150,
34,
296,
26217,
11,
279,
666,
434,
331,
403,
10558,
635,
14928,
279,
2549,
5577,
603,
1517,
331,
403,
292,
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,
3992,
67,
90,
403,
10558,
12,
90,
403,
10558,
4672,
3536,
411,
10262,
4150,
34,
296,
26217,
11,
279,
666,
434,
331,
403,
10558,
635,
14928,
279,
2549,
5577,
603,
1517,
331,
403,
292,
4... |
if self.name == "select": for argument in self.arguments[1:4]: argument.format() elif self.name in ("execve", "clone"): for argument in self.arguments: | if self.name in PREFORMAT_ARGUMENTS: for index in PREFORMAT_ARGUMENTS[self.name]: argument = self.arguments[index] | def enter(self, regs=None): if not regs: regs = self.process.getregs() argument_values = self.readArgumentValues(regs) self.readArguments(argument_values) | 6e67561213daca9438eb55f38fc3d0873193ff47 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/296/6e67561213daca9438eb55f38fc3d0873193ff47/ptrace_syscall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
12,
2890,
16,
17518,
33,
7036,
4672,
309,
486,
17518,
30,
17518,
273,
365,
18,
2567,
18,
588,
266,
564,
1435,
1237,
67,
2372,
273,
365,
18,
896,
1379,
1972,
12,
266,
564,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
12,
2890,
16,
17518,
33,
7036,
4672,
309,
486,
17518,
30,
17518,
273,
365,
18,
2567,
18,
588,
266,
564,
1435,
1237,
67,
2372,
273,
365,
18,
896,
1379,
1972,
12,
266,
564,
13,
3... |
for collgrp in collapse_groups: | for collidx in sorted(collapse_groups.keys()): collgrp = collapse_groups[collidx] self._console.debug("Collapse group %d %r" % (collidx, [x.name for x in collgrp])) self._console.indent() | def mergeCommonPackages(collapse_group, parts, packages): return parts, packages | c92a3153627a6f6e14175f817d5482f3e7d44879 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c92a3153627a6f6e14175f817d5482f3e7d44879/PartBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
6517,
11425,
12,
21405,
67,
1655,
16,
2140,
16,
5907,
4672,
327,
2140,
16,
5907,
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,
... | [
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2691,
6517,
11425,
12,
21405,
67,
1655,
16,
2140,
16,
5907,
4672,
327,
2140,
16,
5907,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def FindThirdPartyDirs(): """Find all third_party directories underneath the current directory.""" third_party_dirs = [] for path, dirs, files in os.walk('.'): path = path[len('./'):] if path in PRUNE_PATHS: dirs[:] = [] continue for skip in PRUNE_DIRS: if skip in dirs: dirs.remove(skip) if os.path.basename(path) == 'third_party': for dir in dirs: dirpath = os.path.join(path, dir) if dirpath not in PRUNE_PATHS: third_party_dirs.append(dirpath) dirs[:] = [] continue return third_party_dirs | return len(errors) == 0 def GenerateCredits(): """Generate about:credits, dumping the result to stdout.""" def EvaluateTemplate(template, env, escape=True): """Expand a template with variables like {{foo}} using a dictionary of expansions.""" for key, val in env.items(): if escape: val = cgi.escape(val) template = template.replace('{{%s}}' % key, val) return template third_party_dirs = FindThirdPartyDirs() entry_template = open('chrome/browser/resources/about_credits_entry.tmpl', 'rb').read() entries = [] for path in sorted(third_party_dirs): metadata = ParseDir(path) env = { 'name': metadata['Name'], 'url': metadata['URL'], 'license': open(metadata['License File'], 'rb').read(), } entries.append(EvaluateTemplate(entry_template, env)) file_template = open('chrome/browser/resources/about_credits.tmpl', 'rb').read() print EvaluateTemplate(file_template, {'entries': '\n'.join(entries)}, escape=False) | def ScanThirdPartyDirs(third_party_dirs): """Scan a list of directories and report on any problems we find.""" errors = [] for path in sorted(third_party_dirs): try: metadata = ParseDir(path) except LicenseError, e: errors.append((path, e.args[0])) continue for path, error in sorted(errors): print path + ": " + error | 8283b10cafab170f6dfd7f266163aefc223892fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/8283b10cafab170f6dfd7f266163aefc223892fe/licenses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8361,
31918,
9872,
12,
451,
6909,
67,
21214,
67,
8291,
4672,
3536,
7972,
279,
666,
434,
6402,
471,
2605,
603,
1281,
9688,
732,
1104,
12123,
1334,
273,
5378,
364,
589,
316,
3115,
12,
451,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8361,
31918,
9872,
12,
451,
6909,
67,
21214,
67,
8291,
4672,
3536,
7972,
279,
666,
434,
6402,
471,
2605,
603,
1281,
9688,
732,
1104,
12123,
1334,
273,
5378,
364,
589,
316,
3115,
12,
451,... |
if _debug: print "\t%s: Called Axes.__init__()" % rendererName pass | """ Initialisation of Axes object """ debugMsg("Called Axes.__init__()") | def __init__(self): if _debug: print "\t%s: Called Axes.__init__()" % rendererName pass | 66718e2a0e7861cb971702bd5efead38e01b72cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/66718e2a0e7861cb971702bd5efead38e01b72cc/axes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
389,
4148,
30,
1172,
1548,
88,
9,
87,
30,
11782,
22516,
281,
16186,
2738,
972,
10031,
738,
5690,
461,
1342,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
309,
389,
4148,
30,
1172,
1548,
88,
9,
87,
30,
11782,
22516,
281,
16186,
2738,
972,
10031,
738,
5690,
461,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'ia' : lambda v: dh_dayOfMnth( v, u'%d de decembre' ), | 'ia' : lambda v: dh_dayOfMnth( v, u'%d de Decembre' ), | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalToDigits) # Convert return dh_noConv( tmp, u'%d' ) else: raise ValueError("string contains regular digits") | c63f7936273a9e20f9ecd868127b6fb80f5e823e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/c63f7936273a9e20f9ecd868127b6fb80f5e823e/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... |
s = marshal.dumps(f) | s = marshal.dumps(f, 2) | def test_floats(self): # Test a few floats small = 1e-25 n = sys.maxint * 3.7e250 while n > small: for expected in (-n, n): f = float(expected) s = marshal.dumps(f) got = marshal.loads(s) self.assertEqual(f, got) marshal.dump(f, file(test_support.TESTFN, "wb")) got = marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(f, got) n /= 123.4567 | 9cf5b29e59cb7896b75e1d9aeb4214ed57725336 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9cf5b29e59cb7896b75e1d9aeb4214ed57725336/test_marshal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5659,
87,
12,
2890,
4672,
468,
7766,
279,
11315,
19172,
5264,
273,
404,
73,
17,
2947,
290,
273,
2589,
18,
1896,
474,
380,
890,
18,
27,
73,
26520,
1323,
290,
405,
5264,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5659,
87,
12,
2890,
4672,
468,
7766,
279,
11315,
19172,
5264,
273,
404,
73,
17,
2947,
290,
273,
2589,
18,
1896,
474,
380,
890,
18,
27,
73,
26520,
1323,
290,
405,
5264,
30,
... |
'fi': [u'uudelleenohjaus', u'ohjaus', u'OHJAUS'], | 'fi': [u'ohjaus', u'uudelleenohjaus'], | def category_namespaces(self, code): return self.namespace(code, 14, all = True) | 28cee05735016c28cc1090ad6c80b8ab01b50a6e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/28cee05735016c28cc1090ad6c80b8ab01b50a6e/family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3150,
67,
16078,
12,
2890,
16,
981,
4672,
327,
365,
18,
4937,
12,
710,
16,
5045,
16,
777,
273,
1053,
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,
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,
3150,
67,
16078,
12,
2890,
16,
981,
4672,
327,
365,
18,
4937,
12,
710,
16,
5045,
16,
777,
273,
1053,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spunode.appendChild(node) | spunode.appendChild(node) | def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.dom.minidom.parse( os.path.join(getItemTempPath(itemnum),"info.xml") ) #Error out if its the wrong XML if infoDOM.documentElement.tagName != "fileinfo": fatalError("The info.xml file (%s) doesn't look right" % os.path.join(getItemTempPath(itemnum),"info.xml")) #boundarybox holds the max and min dimensions for this item so we can auto build a menu highlight box boundarybox=9999,9999,0,0 wantHighlightBox = True #Loop through all the nodes inside this menu item for node in menuitem.childNodes: #Process each type of item to add it onto the background image if node.nodeName=="graphic": #Overlay graphic image onto background #if this graphic item is a movie thumbnail then we dont process it here if node.attributes["filename"].value == "%movie": #this is a movie item but we must still update the boundary box boundarybox=checkBoundaryBox(boundarybox, node) else: imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage, chapternumber, chapterlist) if doesFileExist(imagefilename) == False: if imagefilename == node.attributes["filename"].value: imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if doesFileExist(imagefilename): picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") #see if an image mask exists imagemaskfilename = None if node.hasAttribute("mask"): if node.attribute["mask"].value <> "": imagemaskfilename = getThemeFile(themeName, node.attributes["mask"].value) if imagemaskfilename <> None and doesFileExist(imagemaskfilename): maskpicture = Image.open(imagemaskfilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) maskpicture = maskpicture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), maskpicture) del maskpicture else: bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added image %s" % imagefilename) boundarybox=checkBoundaryBox(boundarybox, node) else: write( "Image file does not exist '%s'" % imagefilename) elif node.nodeName=="text": #Apply some text to the background, including wordwrap if required. text=expandItemText(infoDOM,node.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if node.hasAttribute("colour"): color = node.attributes["colour"].value elif node.hasAttribute("color"): color = node.attributes["color"].value else: color = None if text>"": paintText( draw, bgimage, getScaledAttribute(node, "x"), getScaledAttribute(node, "y"), getScaledAttribute(node, "w"), getScaledAttribute(node, "h"), text, themeFonts[node.attributes["font"].value], color, node.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text elif node.nodeName=="previous": if page>1: #Overlay previous graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for previous button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for previous button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","previous") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="next": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for next button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for next button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","next") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="playall": #Overlay playall graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for playall button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for playall button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added playall button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added playall button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","playall") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="titlemenu": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for titlemenu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for titlemenu button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","titlemenu") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="button": wantHighlightBox = False #Overlay item graphic/text button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for menu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for menu button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textnormal") if textnode.length > 0: textnode = textnode[0] text=expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if node.hasAttribute("colour"): color = node.attributes["colour"].value elif node.hasAttribute("color"): color = node.attributes["color"].value else: color = None if text > "": paintText( draw, bgimage, getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[textnode.attributes["font"].value], color, textnode.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text write( "Added button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")),picture) #del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textselected") if textnode.length > 0: textnode = textnode[0] text = expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) textImage = Image.new("RGBA",picture.size) textDraw = ImageDraw.Draw(textImage) if text > "": paintText(textDraw, textImage, getScaledAttribute(node, "x") - getScaledAttribute(textnode, "x"), getScaledAttribute(node, "y") - getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[textnode.attributes["font"].value], "white", textnode.attributes["align"].value ) #convert the RGB image to a 1 bit image (width, height) = textImage.size for y in range(height): for x in range(width): if textImage.getpixel((x,y)) < (100, 100, 100, 255): textImage.putpixel((x,y), (0, 0, 0, 0)) else: textImage.putpixel((x,y), (255, 255, 255, 255)) if textnode.hasAttribute("colour"): color = textnode.attributes["colour"].value elif textnode.hasAttribute("color"): color = textnode.attributes["color"].value else: color = "white" bgimagemask.paste(color, (getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y")), textImage) boundarybox=checkBoundaryBox(boundarybox, node) del text, textImage, textDraw del picture elif node.nodeName=="#text" or node.nodeName=="#comment": #Do nothing assert True else: write( "Dont know how to process %s" % node.nodeName) if drawmask == None: return #Draw the mask for this item if wantHighlightBox == True: # Make the boundary box bigger than the content to avoid over writing it boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) # Draw another line to make the box thicker - PIL does not support linewidth boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) node = spumuxdom.createElement("button") #Fiddle this for chapter marks.... if chapternumber>0: node.setAttribute("name","%s" % chapternumber) else: node.setAttribute("name","%s" % itemnum) node.setAttribute("x0","%d" % int(boundarybox[0])) node.setAttribute("y0","%d" % int(boundarybox[1])) node.setAttribute("x1","%d" % int(boundarybox[2] + 1)) node.setAttribute("y1","%d" % int(boundarybox[3] + 1)) spunode.appendChild(node) | 3b621623397009015c837134fe56f0ca3f353bed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/3b621623397009015c837134fe56f0ca3f353bed/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
8335,
1180,
12,
2433,
16,
761,
816,
2211,
2433,
16,
761,
2107,
16,
3824,
1726,
16,
7611,
2730,
16,
3724,
16,
7611,
15374,
351,
835,
16,
3724,
4455,
16,
8839,
3266,
16,
1694,
379,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
8335,
1180,
12,
2433,
16,
761,
816,
2211,
2433,
16,
761,
2107,
16,
3824,
1726,
16,
7611,
2730,
16,
3724,
16,
7611,
15374,
351,
835,
16,
3724,
4455,
16,
8839,
3266,
16,
1694,
379,... |
check = (rw>rf or abs(rw-rf) <= rwrf_delta or rw > 45. or abs(r_work-rw) <= 5.) | check = (rw>rf or abs(rw-rf) <= rwrf_delta or rw > 45.) | def update_solvent_and_scale(fmodel, pdb, hkl, out): try: status = None params = bss.solvent_and_scale_params() params.b_sol_min=0.0 params.b_sol_max=200.0 params.k_sol_min=0.0 params.k_sol_max=1.5 fmodel.update_solvent_and_scale(params = params, verbose = -1) r_work = fmodel.r_work()*100 r_free = fmodel.r_free()*100 rwrf_delta = 1.5 if(fmodel.f_obs.d_min() < 1.2): rwrf_delta = 0.5 if(r_work > r_free or abs(r_work - r_free) <= rwrf_delta or r_work > 45.0): status = "bad" else: status = "good" except KeyboardInterrupt: raise except: print >> out, "ERROR_(update_solvent_and_scale1): %s"%pdb[-11:], hkl[:-4] status = None fmodel = None convert_to_intensities = False convert_to_amplitudes = False if([status, fmodel].count(None) == 0 and status == "bad"): fmodel_dc = fmodel.deep_copy() rw, rf = update_solvent_and_scale_helper(fmodel = fmodel_dc, params = params, out=out,pdb=pdb,hkl=hkl) if([rw, rf].count(None) > 0): return None, None check = (rw>rf or abs(rw-rf) <= rwrf_delta or rw > 45. or abs(r_work-rw) <= 5.) if(check): status = "bad" else: status = "good" if([status, fmodel].count(None) == 0 and status == "bad"): fmodel_dc = fmodel.deep_copy() f_obs = fmodel_dc.f_obs f_obs = f_obs.set_observation_type(observation_type = None) f_obs = f_obs.f_sq_as_f() fmodel_dc.update(f_obs = f_obs) rw, rf = update_solvent_and_scale_helper(fmodel = fmodel_dc, params = params, out=out,pdb=pdb,hkl=hkl) if([rw, rf].count(None) > 0): return None, None check = (rw>rf or abs(rw-rf) <= rwrf_delta or rw > 45. or abs(r_work-rw) <= 5.) if(check): status = "bad" else: status = "good" convert_to_amplitudes = True if([status, fmodel].count(None) == 0 and status == "bad"): fmodel_dc = fmodel.deep_copy() f_obs = fmodel_dc.f_obs f_obs = f_obs.set_observation_type(observation_type = None) f_obs = f_obs.f_as_f_sq() fmodel_dc.update(f_obs = f_obs) rw, rf = update_solvent_and_scale_helper(fmodel = fmodel_dc, params = params, out=out,pdb=pdb,hkl=hkl) if([rw, rf].count(None) > 0): return None, None check = (rw>rf or abs(rw-rf) <= rwrf_delta or rw > 45. or abs(r_work-rw) <= 5.) if(check): status = "bad" else: status = "good" convert_to_intensities = True if(status == "good" and [convert_to_intensities, convert_to_amplitudes].count(True) > 0): fmodel.f_obs.set_observation_type(observation_type = None) if(convert_to_intensities): fmodel.update(k_sol=0, b_sol=0, b_cart=[0,0,0,0,0,0], f_obs = fmodel.f_obs.f_as_f_sq()) if(convert_to_amplitudes): fmodel.update(k_sol=0, b_sol=0, b_cart=[0,0,0,0,0,0], f_obs = fmodel.f_obs.f_sq_as_f()) fmodel.f_obs.set_observation_type_xray_amplitude() fmodel.update_solvent_and_scale(params = params, verbose = -1) if(status == "bad"): print >> out, "ERROR_(status=bad): %s"%pdb[-11:], hkl[:-4] status = None fmodel = None return status, fmodel | 2c220ddd53d23ebc88a4c0420b37c64ef8a33770 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/2c220ddd53d23ebc88a4c0420b37c64ef8a33770/pdb_refl_cif_to_mtz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
18281,
616,
67,
464,
67,
5864,
12,
74,
2284,
16,
10892,
16,
366,
16391,
16,
596,
4672,
775,
30,
1267,
273,
599,
859,
273,
324,
1049,
18,
18281,
616,
67,
464,
67,
5864,
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,
1089,
67,
18281,
616,
67,
464,
67,
5864,
12,
74,
2284,
16,
10892,
16,
366,
16391,
16,
596,
4672,
775,
30,
1267,
273,
599,
859,
273,
324,
1049,
18,
18281,
616,
67,
464,
67,
5864,
67,
... |
_Option(["-B"], ["input"], None, 0, | _Option(["-B", "num_concatenated_queries"], ["input"], None, 0, | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast program to use (e.g. blastp, blastn).", False), _Option(["-q", "nuc_mismatch"], ["input"], None, 0, "Penalty for a nucleotide mismatch (blastn only).", False), _Option(["-r", "nuc_match"], ["input"], None, 0, "Reward for a nucleotide match (blastn only).", False), _Option(["-Q", "query_genetic_code"], ["input"], None, 0, "Query Genetic code to use.", False), _Option(["-D", "db_genetic_code"], ["input"], None, 0, "DB Genetic code (for tblast[nx] only).", False), _Option(["-M", "matrix"], ["input"], None, 0, "Matrix to use", False), _Option(["-S", "strands"], ["input"], None, 0, "Query strands to search against database (for blast[nx], " + \ "and tblastx). 3 is both, 1 is top, 2 is bottom.", False), _Option(["-l", "restrict_gi"], ["input"], None, 0, "Restrict search of database to list of GI's.", False), _Option(["-R", "checkpoint"], ["input", "file"], None, 0, "PSI-TBLASTN checkpoint input file.", False), _Option(["-n", "megablast"], ["input"], None, 0, "MegaBlast search T/F.", False), #The old name "region_length" is for consistency with our #old blastall function wrapper: _Option(["-L", "region_length", "range_restriction"], ["input"], None, 0, """Location on query sequence (string format start,end). | ef8167a56c5339e619ca5865c481a5e1e0183cf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/ef8167a56c5339e619ca5865c481a5e1e0183cf2/Applications.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1797,
1546,
30901,
454,
3113,
636,
4333,
4672,
365,
18,
3977,
273,
306,
521,
468,
11739,
316,
326,
1967,
1353,
487,
326,
876,
628,
19047,
454,
1493,
5201,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1797,
1546,
30901,
454,
3113,
636,
4333,
4672,
365,
18,
3977,
273,
306,
521,
468,
11739,
316,
326,
1967,
1353,
487,
326,
876,
628,
19047,
454,
1493,
5201,
... |
vertexAttr.parm( "name" ).set( "floatPoint" ) vertexAttr.parm( "class" ).set( 1 ) | vertexAttr.parm( "name" ).set( "floatVert" ) vertexAttr.parm( "class" ).set( 3 ) | def testConvertingOverExistingAttribsWithDifferentTypes( self ) : mesh = self.mesh() sop = self.emptySop() detailAttr = sop.createOutputNode( "attribcreate" ) detailAttr.parm( "name" ).set( "floatDetail" ) detailAttr.parm( "class" ).set( 0 ) # detail detailAttr.parm( "type" ).set( 1 ) # int detailAttr.parm( "size" ).set( 3 ) # 3 elements detailAttr.parm( "value1" ).set( 10 ) detailAttr.parm( "value2" ).set( 11 ) detailAttr.parm( "value3" ).set( 12 ) pointAttr = detailAttr.createOutputNode( "attribcreate" ) pointAttr.parm( "name" ).set( "floatPoint" ) pointAttr.parm( "class" ).set( 1 ) # point pointAttr.parm( "type" ).set( 1 ) # int pointAttr.parm( "size" ).set( 3 ) # 3 elements pointAttr.parm( "value1" ).set( 10 ) pointAttr.parm( "value2" ).set( 11 ) pointAttr.parm( "value3" ).set( 12 ) primAttr = pointAttr.createOutputNode( "attribcreate" ) primAttr.parm( "name" ).set( "floatPoint" ) primAttr.parm( "class" ).set( 1 ) # point primAttr.parm( "type" ).set( 1 ) # int primAttr.parm( "size" ).set( 3 ) # 3 elements primAttr.parm( "value1" ).set( 10 ) primAttr.parm( "value2" ).set( 11 ) primAttr.parm( "value3" ).set( 12 ) vertexAttr = primAttr.createOutputNode( "attribcreate" ) vertexAttr.parm( "name" ).set( "floatPoint" ) vertexAttr.parm( "class" ).set( 1 ) # point vertexAttr.parm( "type" ).set( 1 ) # int vertexAttr.parm( "size" ).set( 3 ) # 3 elements vertexAttr.parm( "value1" ).set( 10 ) vertexAttr.parm( "value2" ).set( 11 ) vertexAttr.parm( "value3" ).set( 12 ) | 9d6bba136bd655f93d305bb211bff70eeeff025c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9042/9d6bba136bd655f93d305bb211bff70eeeff025c/ToHoudiniPolygonsConverter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2723,
310,
4851,
9895,
31292,
1190,
26270,
2016,
12,
365,
262,
294,
6986,
273,
365,
18,
15557,
1435,
272,
556,
273,
365,
18,
5531,
55,
556,
1435,
7664,
3843,
273,
272,
556,
18,
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,
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,
2723,
310,
4851,
9895,
31292,
1190,
26270,
2016,
12,
365,
262,
294,
6986,
273,
365,
18,
15557,
1435,
272,
556,
273,
365,
18,
5531,
55,
556,
1435,
7664,
3843,
273,
272,
556,
18,
2... |
nr_reduces = nr_reduces or max(nr_maps / 2, 1) | nr_reduces = nr_reduces or min(max(nr_maps / 2, 1), 100) | def _run(self, **kw): d = lambda x: kw.get(x, Job.defaults[x]) | 5b9e69243db0106102e6819916c9a85b62e78cbc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/373/5b9e69243db0106102e6819916c9a85b62e78cbc/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
2826,
9987,
4672,
302,
273,
3195,
619,
30,
5323,
18,
588,
12,
92,
16,
3956,
18,
7606,
63,
92,
5717,
2,
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,
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,
389,
2681,
12,
2890,
16,
2826,
9987,
4672,
302,
273,
3195,
619,
30,
5323,
18,
588,
12,
92,
16,
3956,
18,
7606,
63,
92,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
QtCore.QVariant(self.__server_address)).toList() | QtCore.QVariant(self.__server_address)).toString() | def __init__(self, p_parent = None): # initialisiere Objekt QtCore.QObject.__init__(self, p_parent) | 1f5f8c6bcbd88f3a0bd90ffedebcf294a0c9ef51 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4919/1f5f8c6bcbd88f3a0bd90ffedebcf294a0c9ef51/Settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
293,
67,
2938,
273,
599,
4672,
468,
2172,
291,
77,
822,
18760,
3839,
88,
20193,
18,
53,
921,
16186,
2738,
972,
12,
2890,
16,
293,
67,
2938,
13,
2,
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,
1,
1,
1,
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,
293,
67,
2938,
273,
599,
4672,
468,
2172,
291,
77,
822,
18760,
3839,
88,
20193,
18,
53,
921,
16186,
2738,
972,
12,
2890,
16,
293,
67,
2938,
13,
2,
-100... |
self.efficiency = rate.BinnedRatios(rate.Bins(min(self.injected_x), max(self.injected_x), 64, min(self.injected_y), max(self.injected_y), 64, spacing = ["log", "log"])) | self.efficiency = rate.BinnedRatios(rate.Bins(min(self.injected_x), max(self.injected_x), 256, min(self.injected_y), max(self.injected_y), 256, spacing = ["log", "log"])) | def finish(self): self.efficiency = rate.BinnedRatios(rate.Bins(min(self.injected_x), max(self.injected_x), 64, min(self.injected_y), max(self.injected_y), 64, spacing = ["log", "log"])) map(self.efficiency.incdenominator, zip(self.injected_x, self.injected_y)) map(self.efficiency.incnumerator, zip(self.found_x, self.found_y)) | f3ba0d91bedf986cc563d5aff052ed5a700db54c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/f3ba0d91bedf986cc563d5aff052ed5a700db54c/SimBurstUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
2890,
4672,
365,
18,
73,
22217,
273,
4993,
18,
9913,
11748,
29635,
7441,
12,
5141,
18,
38,
2679,
12,
1154,
12,
2890,
18,
267,
6059,
67,
92,
3631,
943,
12,
2890,
18,
267,
60... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4076,
12,
2890,
4672,
365,
18,
73,
22217,
273,
4993,
18,
9913,
11748,
29635,
7441,
12,
5141,
18,
38,
2679,
12,
1154,
12,
2890,
18,
267,
6059,
67,
92,
3631,
943,
12,
2890,
18,
267,
60... |
self.mesgType = INIT_CLIENT | self.mesgType = MULTIPLEXER_INIT_CLIENT | def initClientFrame(self,requestedID, remotehost, remoteport, localip, localport): """ <Purpose> Makes the frame a INIT_CLIENT frame | 992246c633c09fe5d066f537c0640421e414afac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/992246c633c09fe5d066f537c0640421e414afac/Multiplexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
1227,
3219,
12,
2890,
16,
19065,
734,
16,
2632,
2564,
16,
2632,
655,
16,
1191,
625,
16,
1191,
655,
4672,
3536,
411,
10262,
4150,
34,
490,
3223,
326,
2623,
279,
12584,
67,
11935,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1208,
1227,
3219,
12,
2890,
16,
19065,
734,
16,
2632,
2564,
16,
2632,
655,
16,
1191,
625,
16,
1191,
655,
4672,
3536,
411,
10262,
4150,
34,
490,
3223,
326,
2623,
279,
12584,
67,
11935,
... |
makefile[i] = makefile[i].rstrip() + ' ' + cflags + '\n' | makefile[i] = makefile[i].rstrip() + ' ' + cflags.strip() + '\n' | def patch_makefile(source_dir, build_dir): makefile_name = os.path.join(build_dir, 'Local', 'Makefile') makefile = open(makefile_name, 'r').readlines() cfg = distutils.sysconfig.get_config_var cflags = '-I%s %s' % (cfg('INCLUDEPY'), cfg('CFLAGSFORSHARED')) lib = os.path.join(cfg('LIBPL'), cfg('LIBRARY')) extralibs = ' '.join([cfg('LIBM'), cfg('LIBS'), cfg('LDFLAGS'), lib, cfg('LINKFORSHARED')]) source = os.path.join('Local', SOURCE_FILE) has_options = 1 # # Look for existing CFLAGS and EXTRALIBS lines, and append info. # Note if this has been done by setting cflags and extralibs to None # for i in range(len(makefile)): if makefile[i].startswith('CFLAGS=') and cflags: makefile[i] = makefile[i].rstrip() + ' ' + cflags + '\n' cflags = None if makefile[i].startswith('EXTRALIBS=') and extralibs: makefile[i] = makefile[i].rstrip() + ' ' + extralibs + '\n' extralibs = None if makefile[i].startswith('LOCAL_SCAN_SOURCE='): makefile[i] = 'LOCAL_SCAN_SOURCE=' + source + '\n' source = None if makefile[i].startswith('LOCAL_SCAN_HAS_OPTIONS='): makefile[i] = 'LOCAL_SCAN_HAS_OPTIONS=yes\n' has_options = 0 # # Didn't update existing lines? append new ones # if cflags: makefile.append('CFLAGS=%s\n' % cflags) if extralibs: makefile.append('EXTRALIBS=%s\n' % extralibs) if source: makefile.append('LOCAL_SCAN_SOURCE=%s\n' % source) if has_options: makefile.append('LOCAL_SCAN_HAS_OPTIONS=yes\n') # # Write out updated makefile # makefile = ''.join(makefile) open(makefile_name, 'w').write(makefile) # # Symlink in C sourcefile # os.symlink(os.path.join(source_dir, SOURCE_FILE), os.path.join(build_dir, 'Local', SOURCE_FILE)) | 420697a087e15a5dcd0741644ac286079274b8f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5780/420697a087e15a5dcd0741644ac286079274b8f7/patch_exim_makefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
67,
6540,
768,
12,
3168,
67,
1214,
16,
1361,
67,
1214,
4672,
1221,
768,
67,
529,
273,
1140,
18,
803,
18,
5701,
12,
3510,
67,
1214,
16,
296,
2042,
2187,
296,
6464,
768,
6134,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4729,
67,
6540,
768,
12,
3168,
67,
1214,
16,
1361,
67,
1214,
4672,
1221,
768,
67,
529,
273,
1140,
18,
803,
18,
5701,
12,
3510,
67,
1214,
16,
296,
2042,
2187,
296,
6464,
768,
6134,
22... |
"""returns the current version graph. if there is not one, returns the terse graph instead""" | """getCurrentGraph() -> Graph returns the current version graph. if there is not one, returns the terse graph instead """ | def getCurrentGraph(self): """returns the current version graph. if there is not one, returns the terse graph instead""" if not self.currentGraph: self.currentGraph=self.getTerseGraph().__copy__() return self.currentGraph | 0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6341/0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5175,
4137,
12,
2890,
4672,
3536,
588,
3935,
4137,
1435,
317,
5601,
1135,
326,
783,
1177,
2667,
18,
309,
1915,
353,
486,
1245,
16,
1135,
326,
19272,
307,
2667,
3560,
225,
3536,
309,
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,
5175,
4137,
12,
2890,
4672,
3536,
588,
3935,
4137,
1435,
317,
5601,
1135,
326,
783,
1177,
2667,
18,
309,
1915,
353,
486,
1245,
16,
1135,
326,
19272,
307,
2667,
3560,
225,
3536,
309,
486,... |
... ['localhost', 48080]) | ... [('localhost', 48080)]) | def doctest_load_options(): """Tests for load_options(). We will use a sample configuration file that comes with these tests. >>> import os >>> from schoolbell.app import tests >>> test_dir = os.path.dirname(tests.__file__) >>> sample_config_file = os.path.join(test_dir, 'sample.conf') >>> empty_config_file = os.path.join(test_dir, 'empty.conf') load_options will report errors to stderr. We need to temporarily redirect stderr to stdout, because otherwise doctests will not see the output. >>> import sys >>> old_stderr = sys.stderr >>> sys.stderr = sys.stdout Load options parses command line arguments and the configuration file. Warnings about obsolete options are shown. >>> from schoolbell.app.main import load_options >>> o = load_options(['sb.py', '-c', sample_config_file]) Reading configuration from ...sample.conf sb.py: warning: ignored configuration option 'module' sb.py: warning: ignored configuration option 'domain' sb.py: warning: ignored configuration option 'lang' sb.py: warning: ignored configuration option 'path' sb.py: warning: ignored configuration option 'app_log_file' Some options come from the command line >>> o.config_file '...sample.conf' >>> o.daemon False Some come from the config file >>> o.config.web in ([('', 48080)], # Unix ... ['localhost', 48080]) # Windows True >>> o.config.listen [('...', 123), ('10.20.30.40', 9999)] Note that "listen 123" in config.py produces ('localhost', 123) on Windows, but ('', 123) on other platforms. `load_options` can also give you a nice help message and exit with status code 0. >>> try: ... o = load_options(['sb.py', '-h']) ... except SystemExit, e: ... print '[exited with status %s]' % e Usage: sb.py [options] Options: -c, --config xxx use this configuration file instead of the default -h, --help show this help message -d, --daemon go to background after starting [exited with status 0] Here's what happens, when you use an unknown command line option. >>> try: ... o = load_options(['sb.py', '-q']) ... except SystemExit, e: ... print '[exited with status %s]' % e sb.py: option -q not recognized Run sb.py -h for help. [exited with status 1] Here's what happens when the configuration file cannot be found >>> try: ... o = load_options(['sb.py', '-c', 'nosuchfile']) ... except SystemExit, e: ... print '[exited with status %s]' % e Reading configuration from nosuchfile sb.py: error opening file ...nosuchfile: ... [exited with status 1] Here's what happens if you do not specify a storage section in the configuration file. >>> try: ... o = load_options(['sb.py', '-c', empty_config_file]) ... except SystemExit, e: ... print '[exited with status %s]' % e Reading configuration from ...empty.conf sb.py: No storage defined in the configuration file. <BLANKLINE> If you're using the default configuration file, please edit it now and uncomment one of the ZODB storage sections. [exited with status 1] Cleaning up. >>> sys.stderr = old_stderr """ | 89101cc467cec91dd61e636f9c637231137cc80d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/89101cc467cec91dd61e636f9c637231137cc80d/test_main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
395,
67,
945,
67,
2116,
13332,
3536,
14650,
364,
1262,
67,
2116,
7675,
225,
1660,
903,
999,
279,
3296,
1664,
585,
716,
14535,
598,
4259,
7434,
18,
225,
4080,
1930,
1140,
4080,
628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31263,
395,
67,
945,
67,
2116,
13332,
3536,
14650,
364,
1262,
67,
2116,
7675,
225,
1660,
903,
999,
279,
3296,
1664,
585,
716,
14535,
598,
4259,
7434,
18,
225,
4080,
1930,
1140,
4080,
628... |
@arg('-r', '--recursive', dest='recursive', default=False, help='monitors the directories recursively') | @arg('-R', '--recursive', dest='recursive', default=False, help='monitors the directories recursively') | def log(args): from watchdog.tricks import LoggerTrick patterns, ignore_patterns = parse_patterns(args.patterns, args.ignore_patterns) event_handler = LoggerTrick(patterns=patterns, ignore_patterns=ignore_patterns, ignore_directories=args.ignore_directories) if args.debug_force_polling: from watchdog.observers.polling_observer import PollingObserver as Observer elif args.debug_force_kqueue: from watchdog.observers.kqueue_observer import KqueueObserver as Observer elif args.debug_force_win32: from watchdog.observers.win32_observer import Win32Observer as Observer elif args.debug_force_win32ioc: from watchdog.observers.win32ioc_observer import Win32IOCObserver as Observer elif args.debug_force_inotify: from watchdog.observers.inotify_observer import InotifyObserver as Observer elif args.debug_force_fsevents: from watchdog.observers.fsevents_observer import FSEventsObserver as Observer else: from watchdog import Observer observer = Observer() observe_with(observer, 'logger', event_handler, args.directories, args.recursive) | e153510969035537501468356fcad6be04b9923b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14346/e153510969035537501468356fcad6be04b9923b/watchmedo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
1968,
4672,
628,
4267,
20330,
18,
313,
20642,
1930,
4242,
1070,
1200,
6884,
16,
2305,
67,
13317,
273,
1109,
67,
13317,
12,
1968,
18,
13317,
16,
833,
18,
6185,
67,
13317,
13,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
613,
12,
1968,
4672,
628,
4267,
20330,
18,
313,
20642,
1930,
4242,
1070,
1200,
6884,
16,
2305,
67,
13317,
273,
1109,
67,
13317,
12,
1968,
18,
13317,
16,
833,
18,
6185,
67,
13317,
13,
8... |
for test in tests: args_tuple = ( (test, verbose, quiet, testdir), dict(huntrleaks=huntrleaks, use_resources=use_resources) ) pending.append((test, args_tuple)) | def tests_and_args(): for test in tests: args_tuple = ( (test, verbose, quiet, testdir), dict(huntrleaks=huntrleaks, use_resources=use_resources) ) yield (test, args_tuple) pending = tests_and_args() | def accumulate_result(test, result): ok, test_time = result test_times.append((test_time, test)) if ok == PASSED: good.append(test) elif ok == FAILED: bad.append(test) elif ok == ENV_CHANGED: bad.append(test) environment_changed.append(test) elif ok == SKIPPED: skipped.append(test) elif ok == RESOURCE_DENIED: skipped.append(test) resource_denieds.append(test) | d8172be4a3d1ea42b76faa6f634faf7700fb632c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/d8172be4a3d1ea42b76faa6f634faf7700fb632c/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21757,
67,
2088,
12,
3813,
16,
563,
4672,
1529,
16,
1842,
67,
957,
273,
563,
1842,
67,
8293,
18,
6923,
12443,
3813,
67,
957,
16,
1842,
3719,
309,
1529,
422,
453,
3033,
18204,
30,
7494,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21757,
67,
2088,
12,
3813,
16,
563,
4672,
1529,
16,
1842,
67,
957,
273,
563,
1842,
67,
8293,
18,
6923,
12443,
3813,
67,
957,
16,
1842,
3719,
309,
1529,
422,
453,
3033,
18204,
30,
7494,... |
if request.method == 'POST': if(not id): form = VideosScreenedInScreeningForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() return HttpResponse("1") else: return HttpResponse("0") else: videoscreened = VideosScreenedInScreening.objects.get(id=id) form = VideosScreenedInScreeningForm(request.POST, instance = videoscreened) if form.is_valid(): form.save() return HttpResponse("1") else: return HttpResponse("0") | if request.method == 'POST': if(not id): form = VideosScreenedInScreeningForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() return HttpResponse("1") else: return HttpResponse("0") else: videoscreened = VideosScreenedInScreening.objects.get(id=id) form = VideosScreenedInScreeningForm(request.POST, instance = videoscreened) if form.is_valid(): form.save() return HttpResponse("1") else: return HttpResponse("0") | def save_videosscreenedinscreening_offline(request, id): if request.method == 'POST': if(not id): form = VideosScreenedInScreeningForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() return HttpResponse("1") else: return HttpResponse("0") else: videoscreened = VideosScreenedInScreening.objects.get(id=id) form = VideosScreenedInScreeningForm(request.POST, instance = videoscreened) if form.is_valid(): form.save() return HttpResponse("1") else: return HttpResponse("0") | 7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6768,
538,
9252,
329,
267,
9252,
310,
67,
23787,
12,
2293,
16,
612,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
309,
12,
902,
612,
4672,
646,
273,
776,
19871,
7956,
329,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
67,
6768,
538,
9252,
329,
267,
9252,
310,
67,
23787,
12,
2293,
16,
612,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
309,
12,
902,
612,
4672,
646,
273,
776,
19871,
7956,
329,
... |
jsfile = path.join(package_dir, 'locale', self.config.language, 'LC_MESSAGES', 'sphinx.js') if path.isfile(jsfile): self.script_files.append('_static/translations.js') | jsfile_list = [path.join(package_dir, 'locale', self.config.language, 'LC_MESSAGES', 'sphinx.js'), path.join(sys.prefix, 'share/sphinx/locale', self.config.language, 'sphinx.js')] for jsfile in jsfile_list: if path.isfile(jsfile): self.script_files.append('_static/translations.js') break | def init(self): # a hash of all config values that, if changed, cause a full rebuild self.config_hash = '' self.tags_hash = '' # section numbers for headings in the currently visited document self.secnumbers = {} | 984d406b443403af3d6f58096b3a05cc59d395de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/984d406b443403af3d6f58096b3a05cc59d395de/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
4672,
468,
279,
1651,
434,
777,
642,
924,
716,
16,
309,
3550,
16,
4620,
279,
1983,
13419,
365,
18,
1425,
67,
2816,
273,
875,
365,
18,
4156,
67,
2816,
273,
875,
468,
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,
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,
1208,
12,
2890,
4672,
468,
279,
1651,
434,
777,
642,
924,
716,
16,
309,
3550,
16,
4620,
279,
1983,
13419,
365,
18,
1425,
67,
2816,
273,
875,
365,
18,
4156,
67,
2816,
273,
875,
468,
2... |
TESTCWD = os.path.join(parent_dir, TESTCWD) | TESTCWD = os.path.join(TEMPDIR, TESTCWD) | def getexpected(self): """Return set of test names we expect to skip on current platform. | 1c83734280c430de3f31763544792e9540c97e0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/1c83734280c430de3f31763544792e9540c97e0f/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
3825,
12,
2890,
4672,
3536,
990,
444,
434,
1842,
1257,
732,
4489,
358,
2488,
603,
783,
4072,
18,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
3825,
12,
2890,
4672,
3536,
990,
444,
434,
1842,
1257,
732,
4489,
358,
2488,
603,
783,
4072,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
person.activities.append(random.choice(values)) | value = random.choice(values) values.remove(value) person.activities.append(value) | def auto_publish(interval): # initialize top level elements tuple = Service(''.join(chr(random.randint(97, 122)) for i in xrange(8)), status=Status(basic='open')) tuple.contact = Contact("sip:%s@%s" % (sip_uri.user, sip_uri.host)) tuple.contact.priority = 0 tuple.relationship = 'self' tuple.timestamp = ServiceTimestamp() pidf.append(tuple) # add email service email_tuple = Service(''.join(chr(random.randint(97, 122)) for i in xrange(8)), status=Status(basic='open')) email_tuple.contact = Contact("mailto:%s@%s" % (sip_uri.user, sip_uri.host)) email_tuple.contact.priority = 0.5 email_tuple.relationship = 'self' email_tuple.timestamp = ServiceTimestamp() pidf.append(email_tuple) person = Person(''.join(chr(random.randint(97, 122)) for i in xrange(8))) person.privacy = Privacy() person.time_offset = TimeOffset() person.timestamp = PersonTimestamp() pidf.append(person) device = Device(''.join(chr(random.randint(97, 122)) for i in xrange(8))) device.notes.add(DeviceNote('Powered by %s' % user_agent, lang='en')) device.timestamp = DeviceTimestamp() device.user_input = UserInput() pidf.append(device) while True: # 50% chance that basic status will change if random.randint(0, 1) == 1: if tuple.status.basic == 'open': tuple.status.basic = 'closed' else: tuple.status.basic = 'open' tuple.timestamp = ServiceTimestamp() # set sphere (9-18 at work (except on weekends), else at home) now = datetime.datetime.now() if (now.hour >= 9 and now.hour < 18) and now.isoweekday() not in (6, 7): person.sphere = 'work' person.sphere.since = datetime.datetime(now.year, now.month, now.day, 9, 0) person.sphere.until = datetime.datetime(now.year, now.month, now.day, 18, 0) else: person.sphere = 'home' # set privacy person.privacy.audio = random.choice((True, False)) person.privacy.text = random.choice((True, False)) person.privacy.video = random.choice((True, False)) # set status icon person.status_icon = StatusIcon("http://sipsimpleclient.com/chrome/site/StatusIcons/%s.png" % random.choice(('available', 'busy'))) # change person note if len(person.notes) > 0: del person.notes['en'] person.notes.add(PersonNote(random_note(), lang='en')) # change person activity if person.activities is None: person.activities = Activities() else: person.activities.clear() values = list(value for value in Activities.values if value != 'unknown') for i in xrange(random.randrange(1, 3)): person.activities.append(random.choice(values)) # change person mood if person.mood is None: person.mood = Mood() else: person.mood.clear() values = list(value for value in Mood.values if value != 'unknown') for i in xrange(random.randrange(1, 3)): person.mood.append(random.choice(values)) # change place is if person.place_is is None: person.place_is = PlaceIs() # 50% chance that place is will change if random.randint(0, 1) == 1: person.place_is.audio = random.choice(('noisy', 'ok', 'quiet', 'unknown')) if random.randint(0, 1) == 1: person.place_is.video = random.choice(('toobright', 'ok', 'dark', 'unknown')) if random.randint(0, 1) == 1: person.place_is.text = random.choice(('uncomfortable', 'inappropriate', 'ok', 'unknown')) person.timestamp = PersonTimestamp() # set user-input if device.user_input.value == 'idle': # 50 % chance to change to active: if random.randint(0, 1) == 1: device.user_input.value = 'active' device.user_input.last_input = None else: # 50 % chance to change to idle: if random.randint(0, 1) == 1: device.user_input.value = 'idle' device.user_input.last_input = now - datetime.timedelta(seconds=30) # publish new pidf publish_pidf() sleep(interval) | 8d25a8561d179314d06dd9b8f86bcb3cd0d7b705 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/8d25a8561d179314d06dd9b8f86bcb3cd0d7b705/sip_auto_publish_presence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3656,
67,
6543,
12,
6624,
4672,
468,
4046,
1760,
1801,
2186,
3193,
273,
1956,
2668,
10332,
5701,
12,
15182,
12,
9188,
18,
7884,
474,
12,
10580,
16,
31501,
3719,
364,
277,
316,
12314,
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,
3656,
67,
6543,
12,
6624,
4672,
468,
4046,
1760,
1801,
2186,
3193,
273,
1956,
2668,
10332,
5701,
12,
15182,
12,
9188,
18,
7884,
474,
12,
10580,
16,
31501,
3719,
364,
277,
316,
12314,
12,... |
f2 = open('tests/x509.der') | f2 = open('tests/x509.der', 'rb') | def test_load_string(self): f = open('tests/x509.pem') s = f.read() f.close() f2 = open('tests/x509.der') s2 = f2.read() f2.close() x509 = X509.load_cert_string(s) x5092 = X509.load_cert_string(s2, X509.FORMAT_DER) assert x509.as_text() == x5092.as_text() assert x509.as_pem() == x5092.as_pem() assert x509.as_der() == x5092.as_der() return | 95f69d9edc6a02f2bc1669263892065793c712e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8055/95f69d9edc6a02f2bc1669263892065793c712e8/test_x509.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
945,
67,
1080,
12,
2890,
4672,
284,
273,
1696,
2668,
16341,
19,
92,
5995,
18,
20313,
6134,
272,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
284,
22,
273,
1696,
2668,
16341,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
945,
67,
1080,
12,
2890,
4672,
284,
273,
1696,
2668,
16341,
19,
92,
5995,
18,
20313,
6134,
272,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
284,
22,
273,
1696,
2668,
16341,... |
Smallest prime power $>= n$. | Smallest prime power $\geq n$. | def _eval(self, n): return 1 | 2d02188176431ba30e789c4b833a0d2ecc1e058b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/2d02188176431ba30e789c4b833a0d2ecc1e058b/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
404,
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,
... | [
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,
389,
8622,
12,
2890,
16,
290,
4672,
327,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
start = self.buff.get_start_iter() | def _modified(self,buff=None) : #pylint: disable-msg=W0613 """ This function is called when the buffer has been modified, it reflects the changes by: 1. Applying the title style on the first line 2. Changing the name of the window if title change """ #cursor_pos = buff.get_property("cursor-position") cursor_mark = buff.get_insert() cursor_iter = buff.get_iter_at_mark(cursor_mark) cursor_line = cursor_iter.get_line() #This should be called only if we are on the title line #As an optimisation title_end = self._apply_title(buff) | d11a5d2913ab9ec9b969e632dab63720868ed791 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/d11a5d2913ab9ec9b969e632dab63720868ed791/taskview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7342,
12,
2890,
16,
20664,
33,
7036,
13,
294,
468,
2074,
5671,
30,
4056,
17,
3576,
33,
59,
7677,
3437,
3536,
1220,
445,
353,
2566,
1347,
326,
1613,
711,
2118,
4358,
16,
518,
3037,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7342,
12,
2890,
16,
20664,
33,
7036,
13,
294,
468,
2074,
5671,
30,
4056,
17,
3576,
33,
59,
7677,
3437,
3536,
1220,
445,
353,
2566,
1347,
326,
1613,
711,
2118,
4358,
16,
518,
3037,... | |
'..\\nsis-test.exe /S /D=%s\\insttest' % os.getcwd(), | '..\\nsis-test-setup.exe /S /D=%s\\insttest' % os.getcwd(), | def confirm(question): print question if raw_input() != 'y': sys.exit(2) | 9494b67ddd4135f65b0bb787a4afe21728de804c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7064/9494b67ddd4135f65b0bb787a4afe21728de804c/release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6932,
12,
4173,
4672,
1172,
5073,
309,
1831,
67,
2630,
1435,
480,
296,
93,
4278,
2589,
18,
8593,
12,
22,
13,
225,
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,
6932,
12,
4173,
4672,
1172,
5073,
309,
1831,
67,
2630,
1435,
480,
296,
93,
4278,
2589,
18,
8593,
12,
22,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.filterdata = windowfunc(self.filterwidth / binsize) / binsize | self.filterdata = windowfunc(self.filterwidth / binsize) | def __init__(self, segment, filterwidth, windowfunc = gaussian_window): """ Initialize the bins for the given segment and filter width. """ # # bin size is 1/20th of the filter's width, but adjusted so # that there is an integer number of bins in the interval # | 0ac19b6e20782fd18101a6ed00bebc75237e5c30 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3592/0ac19b6e20782fd18101a6ed00bebc75237e5c30/rate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3267,
16,
1034,
2819,
16,
2742,
644,
273,
21490,
67,
5668,
4672,
3536,
9190,
326,
8963,
364,
326,
864,
3267,
471,
1034,
1835,
18,
3536,
468,
468,
4158,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3267,
16,
1034,
2819,
16,
2742,
644,
273,
21490,
67,
5668,
4672,
3536,
9190,
326,
8963,
364,
326,
864,
3267,
471,
1034,
1835,
18,
3536,
468,
468,
4158,
9... |
color -= 16 return (CUBE_STEPS[(color / 36) % 6], CUBE_STEPS[(color / 6) % 6], CUBE_STEPS[color % 6]) elif 233 <= color <= 253: | xcolor -= 16 return (CUBE_STEPS[(xcolor / 36) % 6], CUBE_STEPS[(xcolor / 6) % 6], CUBE_STEPS[xcolor % 6]) elif 232 <= xcolor <= 255: | def xterm_to_rgb(color): if color < 16: # basic colors return BASIC16[color] elif 16 <= color <= 232: # color cube color -= 16 return (CUBE_STEPS[(color / 36) % 6], CUBE_STEPS[(color / 6) % 6], CUBE_STEPS[color % 6]) elif 233 <= color <= 253: # gray tone c = 8 + (color - 232) * 0x0A return (c, c, c) else: assert False | 202adc9d5049d9aec692ff214e5f3e6e2075be94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10366/202adc9d5049d9aec692ff214e5f3e6e2075be94/xterm256.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
6408,
67,
869,
67,
10948,
12,
3266,
4672,
309,
2036,
411,
2872,
30,
468,
5337,
5740,
327,
28143,
18118,
2313,
63,
3266,
65,
1327,
2872,
1648,
2036,
1648,
576,
1578,
30,
468,
2036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
619,
6408,
67,
869,
67,
10948,
12,
3266,
4672,
309,
2036,
411,
2872,
30,
468,
5337,
5740,
327,
28143,
18118,
2313,
63,
3266,
65,
1327,
2872,
1648,
2036,
1648,
576,
1578,
30,
468,
2036,
... |
mock = PyPycLoaderMock({name: 'path/to/mod'}) | mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')}) | def run_test(self, dont_write_bytecode): name = 'mod' mock = PyPycLoaderMock({name: 'path/to/mod'}) sys.dont_write_bytecode = dont_write_bytecode with util.uncache(name): mock.load_module(name) self.assert_((name in mock.module_bytecode) is not dont_write_bytecode) | 1f5dd752f4d6cb8dff4cf083a6e7c9587747a2d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/1f5dd752f4d6cb8dff4cf083a6e7c9587747a2d7/test_abc_loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
3813,
12,
2890,
16,
14046,
67,
2626,
67,
1637,
16651,
4672,
508,
273,
296,
1711,
11,
5416,
273,
4707,
9413,
71,
2886,
9865,
12590,
529,
30,
1140,
18,
803,
18,
5701,
2668,
803... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3813,
12,
2890,
16,
14046,
67,
2626,
67,
1637,
16651,
4672,
508,
273,
296,
1711,
11,
5416,
273,
4707,
9413,
71,
2886,
9865,
12590,
529,
30,
1140,
18,
803,
18,
5701,
2668,
803... |
if opts.instruments: opts.instruments = lsctables.instrument_set_from_ifos(opts.instruments) | def parse_command_line(): parser = OptionParser(version = "%prog CVS $Id$", usage = "%prog [options] [file ...]", description = "%prog computes mass/mass upperlimit") parser.add_option("--webserver", help = "Set the webserver path. Required. Example https://ldas-jobs.ligo.caltech.edu/~channa/highmass_months_23-24_summary_page") parser.add_option("--open-box", action = "store_true", help = "Produce open box page") parser.add_option("--output-name-tag", default = "", metavar = "name", help = "Set the basename for image search") opts, filenames = parser.parse_args() if opts.instruments: opts.instruments = lsctables.instrument_set_from_ifos(opts.instruments) if not opts.webserver: print >>sys.stderr, "must specify a webserver" sys.exit(1) return opts, filenames | 40b28754ab291edb3c64dfe0c60823f7bd0fb6c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/40b28754ab291edb3c64dfe0c60823f7bd0fb6c5/make_summary_page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
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,
1109,
67,
3076,
67,
1369,
13332,
2082,
273,
18862,
12,
1589,
273,
2213,
14654,
385,
14640,
271,
548,
8,
3113,
4084,
273,
2213,
14654,
306,
2116,
65,
306,
768,
1372,
65,
3113,
2477,
273,
... | |
word = urllib.unquote(word) | word = uunquote(word) | def runImport(dbFN, useDBM, newDBM, inFN): if newDBM: try: os.unlink(dbFN) except OSError, e: if e.errno != 2: # errno.<WHAT> raise try: os.unlink(dbFN+".dat") except OSError, e: if e.errno != 2: # errno.<WHAT> raise try: os.unlink(dbFN+".dir") except OSError, e: if e.errno != 2: # errno.<WHAT> raise if useDBM: bayes = spambayes.storage.DBDictClassifier(dbFN) else: bayes = spambayes.storage.PickledClassifier(dbFN) try: fp = open(inFN, 'r') except IOError, e: if e.errno != errno.ENOENT: raise nline = fp.readline() (nham, nspam, junk) = re.split(',', nline) if newDBM: bayes.nham = int(nham) bayes.nspam = int(nspam) else: bayes.nham += int(nham) bayes.nspam += int(nspam) if newDBM: impType = "Importing" else: impType = "Merging" print "%s database %s using file %s" % (impType, dbFN, inFN) lines = fp.readlines() for line in lines: (word, hamcount, spamcount, junk) = re.split('`', line) word = urllib.unquote(word) try: wi = bayes.wordinfo[word] except KeyError: wi = bayes.WordInfoClass() wi.hamcount += int(hamcount) wi.spamcount += int(spamcount) bayes._wordinfoset(word, wi) fp.close() print "Storing database, please be patient. Even moderately large" print "databases may take a very long time to store." bayes.store() print "Finished storing database" if useDBM: words = bayes.db.keys() words.remove(bayes.statekey) else: words = bayes.wordinfo.keys() print "Database has %s ham, %s spam, and %s words" \ % (bayes.nham, bayes.nspam, len(words)) | fa1310433c631fe7ebb6ffdce65fa72535a12b14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/fa1310433c631fe7ebb6ffdce65fa72535a12b14/sb_dbexpimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5010,
12,
1966,
19793,
16,
999,
2290,
49,
16,
394,
2290,
49,
16,
316,
19793,
4672,
225,
309,
394,
2290,
49,
30,
775,
30,
1140,
18,
318,
1232,
12,
1966,
19793,
13,
1335,
10002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5010,
12,
1966,
19793,
16,
999,
2290,
49,
16,
394,
2290,
49,
16,
316,
19793,
4672,
225,
309,
394,
2290,
49,
30,
775,
30,
1140,
18,
318,
1232,
12,
1966,
19793,
13,
1335,
10002,
... |
def get_item(item, next_level, extra_context=None): | def get_item(item, prev_level, next_level, extra_context=None): | def get_item(item, next_level, extra_context=None): context.push() | 82605208f0baf6ef5ef1911ec3ae5e20e64cf9d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10899/82605208f0baf6ef5ef1911ec3ae5e20e64cf9d3/incunafein_tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1726,
12,
1726,
16,
2807,
67,
2815,
16,
1024,
67,
2815,
16,
2870,
67,
2472,
33,
7036,
4672,
819,
18,
6206,
1435,
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,
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,
336,
67,
1726,
12,
1726,
16,
2807,
67,
2815,
16,
1024,
67,
2815,
16,
2870,
67,
2472,
33,
7036,
4672,
819,
18,
6206,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def get(self, *key): | def get(self, key): | def get(self, *key): try: obj = self.mru[key] except KeyError: # Cache miss. If our MRU list is full, evict something. if len(self.mru) == self.size: self.mru.popOldest() | efe1dfc8e6ac0f44501afa68d307a3e636b5ea7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/efe1dfc8e6ac0f44501afa68d307a3e636b5ea7e/pyhole.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
498,
4672,
775,
30,
1081,
273,
365,
18,
81,
8653,
63,
856,
65,
1335,
4999,
30,
468,
4379,
12543,
18,
971,
3134,
490,
19866,
666,
353,
1983,
16,
18161,
5943,
18,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
498,
4672,
775,
30,
1081,
273,
365,
18,
81,
8653,
63,
856,
65,
1335,
4999,
30,
468,
4379,
12543,
18,
971,
3134,
490,
19866,
666,
353,
1983,
16,
18161,
5943,
18,
30... |
if dset == "loadtime": file = logConf.get('file', "loaddeps.dot") elif dset == "runtime": file = logConf.get('file', "rundeps.dot") else: file = logConf.get('file', "deps.dot") | def depsToDotFile(logConf, gr): if logConf.get('format', None): format = logConf.get('format') if format == 'dot': if dset == "loadtime": # gr = grLoad file = logConf.get('file', "loaddeps.dot") elif dset == "runtime": # gr = grRun file = logConf.get('file', "rundeps.dot") else: file = logConf.get('file', "deps.dot") classRoot = logConf.get('root') st, op = gr.breadth_first_search(root=classRoot) gr1 = graph.digraph() st_nodes = set(st.keys() + st.values()) # add nodes #gr1.add_nodes(st_nodes) for cid in st_nodes: if cid == None: # None is introduced in st continue #if cid not in self._classes: # gr1.add_node(cid) # continue fsize = self._classes[cid]['size'] if fsize > 20000: color = "red" elif fsize > 5000: color = "green" else: color = "blue" gr1.add_node(cid, attrs=[("color", color)]) # add edges for v in st.iteritems(): if None in v: # drop edges with a None node continue v2, v1 = v if gr.has_edge(v1,v2): gr1.add_edge(v1, v2, attrs=gr.get_edge_attributes(v1, v2)) else: gr1.add_edge(v1, v2, ) for v1 in st_nodes: for v2 in st_nodes: if gr.has_edge(v1, v2): gr1.add_edge(v1, v2, attrs=gr.get_edge_attributes(v1, v2)) #gr1.add_spanning_tree(st) dot = gr1.write(fmt='dotwt') self._console.info("Writing dependency graph to file: %s" % file) open(file, 'w').write(dot) return | b87fb4bb1833705bcbac0b7d575d7ae86b99e09f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/b87fb4bb1833705bcbac0b7d575d7ae86b99e09f/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8740,
774,
10412,
812,
12,
1330,
3976,
16,
3821,
4672,
309,
613,
3976,
18,
588,
2668,
2139,
2187,
599,
4672,
740,
273,
613,
3976,
18,
588,
2668,
2139,
6134,
309,
740,
422,
296,
9811,
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,
8740,
774,
10412,
812,
12,
1330,
3976,
16,
3821,
4672,
309,
613,
3976,
18,
588,
2668,
2139,
2187,
599,
4672,
740,
273,
613,
3976,
18,
588,
2668,
2139,
6134,
309,
740,
422,
296,
9811,
4... | |
return defer.maybeDeferred(urlopen, url) def _process_changes(self, query): | return getPage(url, timeout=self.pollInterval) def _process_changes(self, content): | def _get_changes(self): url = self._make_url() log.msg("Polling Tinderbox tree at %s" % url) self.lastPoll = time.time() # get the page, in pipe-delimited format return defer.maybeDeferred(urlopen, url) | 4ef98c6086b937573953ae1791ac56e9ed7cdc99 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/4ef98c6086b937573953ae1791ac56e9ed7cdc99/tinderboxpoller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
6329,
12,
2890,
4672,
880,
273,
365,
6315,
6540,
67,
718,
1435,
613,
18,
3576,
2932,
24767,
399,
14055,
2147,
2151,
622,
738,
87,
6,
738,
880,
13,
225,
365,
18,
2722,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6329,
12,
2890,
4672,
880,
273,
365,
6315,
6540,
67,
718,
1435,
613,
18,
3576,
2932,
24767,
399,
14055,
2147,
2151,
622,
738,
87,
6,
738,
880,
13,
225,
365,
18,
2722,
1... |
self.dragCreateDrawableObject.selected = true | self.dragCreateDrawableObject.selected = True | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() x, y = self.CalcUnscrolledPosition (x, y) for drawableObject in self.zOrderedDrawableObjects: if drawableObject.bounds.Inside ((x, y)): event.m_x = x - drawableObject.bounds.GetX() event.m_y = y - drawableObject.bounds.GetY() if drawableObject.ProcessEvent (event): return true | c0cecfcb7704c0cc4c05de4b417e49f03bc3a0f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c0cecfcb7704c0cc4c05de4b417e49f03bc3a0f8/SimpleCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
9186,
1133,
261,
2890,
16,
871,
4672,
619,
16,
677,
273,
871,
18,
967,
2555,
9038,
1435,
619,
16,
677,
273,
365,
18,
25779,
984,
1017,
25054,
2555,
261,
92,
16,
677,
13,
364,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9186,
1133,
261,
2890,
16,
871,
4672,
619,
16,
677,
273,
871,
18,
967,
2555,
9038,
1435,
619,
16,
677,
273,
365,
18,
25779,
984,
1017,
25054,
2555,
261,
92,
16,
677,
13,
364,
1... |
x = colpos + colwidth * 0.5 | x = colpos+(colwidth+cellstyle.leftPadding-cellstyle.rightPadding)*0.5 | def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontname or cellstyle.fontsize != cur.fontsize: self.canv.setFont(cellstyle.fontname, cellstyle.fontsize, cellstyle.leading) self._curcellstyle = cellstyle | 1f2c4205cffa241d50509aac344a7b48690616b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7053/1f2c4205cffa241d50509aac344a7b48690616b8/tables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9446,
4020,
12,
2890,
16,
2484,
1125,
16,
2484,
4060,
16,
261,
1293,
917,
16,
1027,
917,
3631,
261,
1293,
2819,
16,
1027,
4210,
3719,
30,
309,
365,
6315,
1397,
3855,
4060,
353,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9446,
4020,
12,
2890,
16,
2484,
1125,
16,
2484,
4060,
16,
261,
1293,
917,
16,
1027,
917,
3631,
261,
1293,
2819,
16,
1027,
4210,
3719,
30,
309,
365,
6315,
1397,
3855,
4060,
353,
48... |
self.add_jobstore(RAMJobStore) def configure(self, config): """ Updates the configuration with the given options. """ for key, val in config.items(): if key.startswith('apscheduler.'): key = key[12:] if key == 'misfire_grace_time': self.misfire_grace_time = int(val) elif key == 'daemonic': self.daemonic = asbool(val) | config = combine_opts(gconfig, 'apscheduler.', options) self.misfire_grace_time = int(config.pop('misfire_grace_time', 1)) self.daemonic = asbool(config.pop('daemonic', True)) threadpool_opts = combine_opts(config, 'threadpool.') self.threadpool = ThreadPool(**threadpool_opts) jobstore_opts = combine_opts(config, 'jobstore.') jobstores = {} for key, value in jobstore_opts.items(): store_name, option = key.split('.', 1)[0] opts_dict = jobstores.setdefault(store_name, {}) opts_dict[option] = value for alias, opts in jobstores.items(): classname = opts.pop('class') cls = ref_to_obj(classname) jobstore = cls(**opts) jobstore.alias = alias self._jobstores[alias] = jobstore if not 'default' in self._jobstores: self._jobstores['default'] = RAMJobStore() | def __init__(self, **config): self.wakeup = Event() self.configure(config) self._jobstores = {} self._jobstores_lock = Lock() self.add_jobstore(RAMJobStore) | 5e6a198d475a7cd3e47f28fec2da59ca5dc48dbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1127/5e6a198d475a7cd3e47f28fec2da59ca5dc48dbb/scheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1425,
4672,
365,
18,
91,
911,
416,
273,
2587,
1435,
365,
18,
14895,
12,
1425,
13,
365,
6315,
4688,
19632,
273,
2618,
365,
6315,
4688,
19632,
67,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2826,
1425,
4672,
365,
18,
91,
911,
416,
273,
2587,
1435,
365,
18,
14895,
12,
1425,
13,
365,
6315,
4688,
19632,
273,
2618,
365,
6315,
4688,
19632,
67,
73... |
self._system = alg self._type = type self._prec = prec | self._system = algorithm if not (typ in ['I', 'J', 'K', 'Y']): raise ValueError, "typ must be one of I, J, K, Y" self._type = typ prec = int(prec) if prec < 0: raise ValueError, "prec must be a positive integer" self._prec = int(prec) | def __init__(self, nu, type = "J", alg = "pari", prec = 53): self._order = nu self._system = alg self._type = type self._prec = prec | 0090c116d1d0d5f9f5ec1cc4c8800a058defd9bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0090c116d1d0d5f9f5ec1cc4c8800a058defd9bb/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9244,
16,
618,
273,
315,
46,
3113,
11989,
273,
315,
1065,
77,
3113,
13382,
273,
15935,
4672,
365,
6315,
1019,
273,
9244,
365,
6315,
4299,
273,
11989,
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,
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,
9244,
16,
618,
273,
315,
46,
3113,
11989,
273,
315,
1065,
77,
3113,
13382,
273,
15935,
4672,
365,
6315,
1019,
273,
9244,
365,
6315,
4299,
273,
11989,
365,
... |
Complexity is soft $O(\log R \log^2 m)$. | Complexity is soft $O(\log R \log m)$. | def padic_height_pairing_matrix(self, p, prec=20, height=None, check_hypotheses=True): r""" Computes the cyclotomic $p$-adic height pairing matrix of this curve with respect to the basis self.gens() for the Mordell-Weil group for a given odd prime p of good ordinary reduction. This curve must be in minimal weierstrass form. INPUT: p -- prime >= 5 prec -- answer will be returned modulo p^prec height -- precomputed height function. If not supplied, this function will call padic_height to compute it. check_hypotheses -- boolean, whether to check that this is a curve for which the p-adic height makes sense OUTPUT: The p-adic cyclotomic height pairing matrix of this curve to the given precision. TODO: -- remove restriction that curve must be in minimal weierstrass form. This is currently required for E.gens(). AUTHORS: -- David Harvey, Liang Xiao, Robert Bradshaw, Jennifer Balakrishnan, original implementation at the 2006 MSRI graduate workshop on modular forms -- David Harvey (2006-09-13), cleaned up and integrated into SAGE, removed some redundant height computations EXAMPLES: sage: E = EllipticCurve("37a") sage: E.padic_height_pairing_matrix(5, 10) [4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + O(5^10)] A rank two example: sage: e =EllipticCurve('389a') sage: e._set_gens([e(-1, 1), e(1,0)]) # avoid platform dependent gens sage: e.padic_height_pairing_matrix(5,10) [2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^10) 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + 2*5^9 + O(5^10)] [ 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + 2*5^9 + O(5^10) 5 + 4*5^2 + 4*5^3 + 2*5^4 + 4*5^5 + 5^6 + 4*5^9 + O(5^10)] An anomalous rank 3 example: sage: e = EllipticCurve("5077a") sage: e._set_gens([e(-1,3), e(2,0), e(4,6)]) sage: e.padic_height_pairing_matrix(5,4) [ 1 + 5 + O(5^4) 1 + 4*5 + 2*5^3 + O(5^4) 2*5 + 3*5^3 + O(5^4)] [ 1 + 4*5 + 2*5^3 + O(5^4) 2 + 5^2 + 3*5^3 + O(5^4) 3 + 4*5^2 + 4*5^3 + O(5^4)] [ 2*5 + 3*5^3 + O(5^4) 3 + 4*5^2 + 4*5^3 + O(5^4) 4 + 5 + 3*5^2 + 3*5^3 + O(5^4)] """ if check_hypotheses: p = __check_padic_hypotheses(self, p) K = Qp(p, prec=prec) rank = self.rank() M = matrix.matrix(K, rank, rank, 0) if rank == 0: return M basis = self.gens() if height is None: height = self.padic_height(p, prec, check_hypotheses=False) # Use <P, Q> =1/2*( h(P + Q) - h(P) - h(Q) ) point_height = [height(P) for P in basis] for i in range(rank): for j in range(i+1, rank): M[i, j] = M[j, i] = ( height(basis[i] + basis[j]) - point_height[i] - point_height[j] ) / 2 for i in range(rank): M[i,i] = point_height[i] return M | 1688b9b2d430c8516a73dff5766209d1aea11aa0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/1688b9b2d430c8516a73dff5766209d1aea11aa0/padics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4627,
335,
67,
4210,
67,
6017,
310,
67,
5667,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4627,
335,
67,
4210,
67,
6017,
310,
67,
5667,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281... |
for elem in data.split(","): | for elem in utils.UnescapeAndSplit(data, sep=","): | def _SplitKeyVal(opt, data): """Convert a KeyVal string into a dict. This function will convert a key=val[,...] string into a dict. Empty values will be converted specially: keys which have the prefix 'no_' will have the value=False and the prefix stripped, the others will have value=True. @type opt: string @param opt: a string holding the option name for which we process the data, used in building error messages @type data: string @param data: a string of the format key=val,key=val,... @rtype: dict @return: {key=val, key=val} @raises errors.ParameterError: if there are duplicate keys """ kv_dict = {} if data: for elem in data.split(","): if "=" in elem: key, val = elem.split("=", 1) else: if elem.startswith(NO_PREFIX): key, val = elem[len(NO_PREFIX):], False elif elem.startswith(UN_PREFIX): key, val = elem[len(UN_PREFIX):], None else: key, val = elem, True if key in kv_dict: raise errors.ParameterError("Duplicate key '%s' in option %s" % (key, opt)) kv_dict[key] = val return kv_dict | 1b3a7656c2f8fde039d7ca2a8d7b7788266fcd82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/1b3a7656c2f8fde039d7ca2a8d7b7788266fcd82/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5521,
653,
3053,
12,
3838,
16,
501,
4672,
3536,
2723,
279,
1929,
3053,
533,
1368,
279,
2065,
18,
225,
1220,
445,
903,
1765,
279,
498,
33,
1125,
63,
16,
2777,
65,
533,
1368,
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,
389,
5521,
653,
3053,
12,
3838,
16,
501,
4672,
3536,
2723,
279,
1929,
3053,
533,
1368,
279,
2065,
18,
225,
1220,
445,
903,
1765,
279,
498,
33,
1125,
63,
16,
2777,
65,
533,
1368,
279,
... |
self.links = temp_links | self.links = temp_links | def proceed(self, url, location): container_id = self.parent.url.split("/")[-1].split("id=")[-1] url = "http://relink.us/view.php?id="+container_id self.html = self.req.load(url, cookies=True) temp_links = [] | 2599ae0c23fd9f0766ba22a1741d458a08985823 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/2599ae0c23fd9f0766ba22a1741d458a08985823/RelinkUs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11247,
12,
2890,
16,
880,
16,
2117,
4672,
1478,
67,
350,
273,
365,
18,
2938,
18,
718,
18,
4939,
2932,
4898,
13,
18919,
21,
8009,
4939,
2932,
350,
1546,
13,
18919,
21,
65,
880,
273,
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,
11247,
12,
2890,
16,
880,
16,
2117,
4672,
1478,
67,
350,
273,
365,
18,
2938,
18,
718,
18,
4939,
2932,
4898,
13,
18919,
21,
8009,
4939,
2932,
350,
1546,
13,
18919,
21,
65,
880,
273,
3... |
subject += word + "," self.xmp_widgets["Subject"].set_text(subject) | subject += word if index is not len(keywords): subject += "," self.xmp_widgets["Subject"].set_text( subject ) | def read_image_metadata(self, obj): """ reads the image metadata after the pyexiv2.Image has been created """ | 85120981c36cb94696cf716feba20c7de0ae85c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/85120981c36cb94696cf716feba20c7de0ae85c7/ImageMetadataGramplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2730,
67,
4165,
12,
2890,
16,
1081,
4672,
3536,
6838,
326,
1316,
1982,
1839,
326,
2395,
338,
427,
22,
18,
2040,
711,
2118,
2522,
3536,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2730,
67,
4165,
12,
2890,
16,
1081,
4672,
3536,
6838,
326,
1316,
1982,
1839,
326,
2395,
338,
427,
22,
18,
2040,
711,
2118,
2522,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
for dir in sys.argv[1:]: zappyc(dir) | for dir in sys.argv[1:]: zappyc(dir) | def main(): if os.name == 'mac': import macfs fss, ok = macfs.GetDirectory('Directory to zap pyc files in') if not ok: sys.exit(0) dir = fss.as_pathname() zappyc(dir) else: if not sys.argv[1:]: print 'Usage: zappyc dir ...' sys.exit(1) for dir in sys.argv[1:]: zappyc(dir) | cd9c8ebd8aea22cdf288f59c39b01c267508e33e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd9c8ebd8aea22cdf288f59c39b01c267508e33e/zappycfiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
1140,
18,
529,
422,
296,
5821,
4278,
1930,
5318,
2556,
284,
1049,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
2668,
2853,
358,
11419,
2395,
71,
1390,
316,
6134,
309,
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,
2774,
13332,
309,
1140,
18,
529,
422,
296,
5821,
4278,
1930,
5318,
2556,
284,
1049,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
2668,
2853,
358,
11419,
2395,
71,
1390,
316,
6134,
309,
486,... |
customMsgBox(self, 'This file is already part of your project.', 'wakeup') | customMsgBox(self, 'This file is already part of your ' 'project.', 'wakeup') | def on_file_add(self, event): if self.project <> None: dlg = wxFileDialog (self, "Choose a file to add", self.project.directory, '', '*.txt', wxOPEN|wxFILE_MUST_EXIST) if dlg.ShowModal() == wxID_OK: file = dlg.GetPath() if file not in self.project.files: self.tree.AppendItem(self.root, file, self.im2) self.tree.Expand(self.root) self.project.add(file) self.projectSave() else: customMsgBox(self, 'This file is already part of your project.', 'wakeup') dlg.Destroy() | 3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/3ba07fe9c5b636ef447aa47e40d9f258c1d32e0a/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
768,
67,
1289,
12,
2890,
16,
871,
4672,
309,
365,
18,
4406,
2813,
599,
30,
25840,
273,
7075,
812,
6353,
261,
2890,
16,
315,
24529,
279,
585,
358,
527,
3113,
365,
18,
4406,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
67,
768,
67,
1289,
12,
2890,
16,
871,
4672,
309,
365,
18,
4406,
2813,
599,
30,
25840,
273,
7075,
812,
6353,
261,
2890,
16,
315,
24529,
279,
585,
358,
527,
3113,
365,
18,
4406,
1... |
template : TEMPLATE LT params_list GT | template : TEMPLATE LT template_params_list GT | def p_template(t): """ template : TEMPLATE LT params_list GT """ pass | d53bba01a8a947f1fa2d7bbb49e927e76b41666c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/d53bba01a8a947f1fa2d7bbb49e927e76b41666c/ddf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
67,
3202,
12,
88,
4672,
3536,
1542,
294,
20835,
11807,
1542,
67,
2010,
67,
1098,
19688,
3536,
1342,
225,
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,
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,
293,
67,
3202,
12,
88,
4672,
3536,
1542,
294,
20835,
11807,
1542,
67,
2010,
67,
1098,
19688,
3536,
1342,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return _kill_python(p) | return _kill_python_and_exit_code(p) | def start_python(self, *args): p = _spawn_python(*args) return _kill_python(p) | 092414cfb17372ecb63e326c8df0dc994215533f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/092414cfb17372ecb63e326c8df0dc994215533f/test_cmd_line.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
8103,
12,
2890,
16,
380,
1968,
4672,
293,
273,
389,
1752,
9533,
67,
8103,
30857,
1968,
13,
327,
389,
16418,
67,
8103,
12,
84,
13,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
8103,
12,
2890,
16,
380,
1968,
4672,
293,
273,
389,
1752,
9533,
67,
8103,
30857,
1968,
13,
327,
389,
16418,
67,
8103,
12,
84,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'', '.'.join(numbers) + u'\u00a0' * 3, CLASS='sectnum') | '', (self.prefix + '.'.join(numbers) + self.suffix + u'\u00a0' * 3), CLASS='sectnum') | def update_section_numbers(self, node, prefix=None, depth=0): depth += 1 | 8ba287536108707c637702464216966ce43f89ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/8ba287536108707c637702464216966ce43f89ac/parts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
33,
7036,
16,
3598,
33,
20,
4672,
3598,
1011,
404,
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,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
33,
7036,
16,
3598,
33,
20,
4672,
3598,
1011,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.default_tags = None self.test_timeout = None | def __init__(self, path, suitenames, parent=None): LOGGER.info("Parsing test suite directory '%s'" % path) # If we are included also all our children are if self._is_in_incl_suites(os.path.basename(os.path.normpath(path)), suitenames): suitenames = [] subitems, self.initfile = self._get_suite_items(path, suitenames) rawdata = self._get_rawdata(path) _BaseSuite.__init__(self, rawdata, parent) error = "Test suite directory '%s' contains no test cases." % path self._create_subsuites(subitems, suitenames, error) self.default_tags = None self.test_timeout = None | a6f7a9a01134b47710eaaa4dcef6f7975d3a01f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/a6f7a9a01134b47710eaaa4dcef6f7975d3a01f8/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
1597,
305,
6809,
16,
982,
33,
7036,
4672,
4145,
18,
1376,
2932,
13963,
1842,
11371,
1867,
1995,
87,
4970,
738,
589,
13,
468,
971,
732,
854,
5849... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
589,
16,
1597,
305,
6809,
16,
982,
33,
7036,
4672,
4145,
18,
1376,
2932,
13963,
1842,
11371,
1867,
1995,
87,
4970,
738,
589,
13,
468,
971,
732,
854,
5849... | |
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', | 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue', | def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None): res = {} for account in self.browse(cr, uid, ids, context=context): res[account.id] = account.ca_theorical + account.total_cost for id in ids: res[id] = round(res.get(id, 0.0),2) return res | 3415b14d6137c1321c302ddbfce5d3abfacd8e15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3415b14d6137c1321c302ddbfce5d3abfacd8e15/account_analytic_analysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5787,
10129,
67,
10107,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
364,
2236,
316,
365,
18,
25731,
12,
3353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5787,
10129,
67,
10107,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
364,
2236,
316,
365,
18,
25731,
12,
3353,
... |
rep += "WHERE DirID=%d AND SEID=%d;" % ( dirID, seID ) | req += "WHERE DirID=%d AND SEID=%d;" % ( dirID, seID ) | def _updateDirectoryUsage( self, directorySEDict, change, connection = False ): connection = self._getConnection( connection ) for dirID in sortList( directorySEDict.keys() ): dirDict = directorySEDict[dirID] for seID in sortList( dirDict.keys() ): seDict = dirDict[seID] files = seDict['Files'] size = seDict['Size'] req = "UPDATE FC_DirectoryUsage SET SESize=SESize%s%d, SEFiles=SEFiles%s%d, LastUpdate=UTC_TIMESTAMP() " \ % ( change, size, change, files ) rep += "WHERE DirID=%d AND SEID=%d;" % ( dirID, seID ) res = self.db._update( req ) if not res['OK']: gLogger.warn( "Failed to update FC_DirectoryUsage", res['Message'] ) if res['Value']: continue if change != '+': gLogger.warn( "Decrement of usage for DirID,SEID that didnt exist", "%d %d" % ( dirID, seID ) ) continue req = "INSERT INTO FC_DirectoryUsage (DirID, SEID, SESize, SEFiles, LastUpdate)" req += " VALUES (%d, %d, %d, %d, UTC_TIMESTAMP());" % ( dirID, seID, size, files ) res = self.db._update( req ) if not res['OK']: gLogger.warn( "Failed to insert FC_DirectoryUsage", res['Message'] ) return S_OK() | 350138bd9c468a3d28584144f70b2157b697a583 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/350138bd9c468a3d28584144f70b2157b697a583/FileManagerBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
2853,
5357,
12,
365,
16,
1867,
1090,
5014,
16,
2549,
16,
1459,
273,
1083,
262,
30,
1459,
273,
365,
6315,
588,
1952,
12,
1459,
262,
364,
1577,
734,
316,
1524,
682,
12,
1867,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
2853,
5357,
12,
365,
16,
1867,
1090,
5014,
16,
2549,
16,
1459,
273,
1083,
262,
30,
1459,
273,
365,
6315,
588,
1952,
12,
1459,
262,
364,
1577,
734,
316,
1524,
682,
12,
1867,
... |
if 1 or env.debug(): | if env.debug(): | def launch_qutemol(pdb_file): """Try to launch QuteMol and load <pdb_file>. Returns (errorcode, errortext), where errorcode is one of the following: ###k 0 = successful 8 = QuteMol failed for an unknown reason. """ exit = "" plugin_name = "QuteMol" plugin_prefs_keys = (qutemol_enabled_prefs_key, qutemol_path_prefs_key) #program_nickname = "QuteMol" #program = env.prefs[qutemol_path_prefs_key] ask_for_help = True # give user the chance to fix problems in the prefs dialog errorcode, errortext_or_path = check_plugin_prefs(plugin_name, plugin_prefs_keys, ask_for_help) if errorcode: return errorcode, errortext_or_path program_path = errortext_or_path workdir, junk_exe = os.path.split(program_path) # Start QuteMol. try: args = [pdb_file] if exit: args += [exit] if 1 or env.debug(): print "debug: Launching", plugin_name, \ "\n working directory=",workdir,"\n program_path=", program_path, "\n args are %r" % (args,) arguments = QStringList() for arg in args: if arg != "": arguments.append(arg) from Process import Process p = Process() # QuteMol must run from the directory its executable lives. Otherwise, it # has serious problems (but still runs). Mark 2007-06-02. p.setWorkingDirectory(QString(workdir)) # Tried p.startDetached() so that QuteMol would be its own process and continue to live # even if NE1 exits. Unfortunately, setWorkingDirectory() doesn't work. Seems like # a Qt bug to me. Mark 2007-06-02 p.start(program_path, arguments) except: print_compact_traceback( "exception in launch_qutemol(): " ) return 8, "%s failed for an unknown reason." % plugin_name # set an appropriate exitcode and msg if p.exitStatus() == QProcess.NormalExit: exitcode = p.exitStatus() if not exitcode: msg = plugin_name + " launched." else: msg = plugin_name + " had exitcode %r" % exitcode else: exitcode = p.exitStatus() exitcode = -1 msg = "Abnormal exit (or failure to launch)" if exitcode: return 8, "Error: " + msg # this breaks the convention of the other error returns return 0, plugin_name + " launched." # from launch_qutemol | 78f5eeb24643cd9f4ac4c1379cf705f4c39be763 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/78f5eeb24643cd9f4ac4c1379cf705f4c39be763/qutemol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8037,
67,
85,
322,
351,
355,
12,
17414,
67,
768,
4672,
3536,
7833,
358,
8037,
2238,
624,
49,
355,
471,
1262,
411,
17414,
67,
768,
18652,
2860,
261,
1636,
710,
16,
393,
499,
408,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8037,
67,
85,
322,
351,
355,
12,
17414,
67,
768,
4672,
3536,
7833,
358,
8037,
2238,
624,
49,
355,
471,
1262,
411,
17414,
67,
768,
18652,
2860,
261,
1636,
710,
16,
393,
499,
408,
3631,
... |
assert os.path.isfile(t_filename) | assert os.path.isfile(t_filename), t_filename | def check_simple_write_read(records, indent=" ") : #print indent+"Checking we can write and then read back these records" for format in SeqIO._FormatToWriter.keys() : print indent+"Checking can write/read as '%s' format" % format #Going to write to a handle... handle = StringIO() try : SeqIO.write(sequences=records, handle=handle, format=format) except ValueError, e : #This is often expected to happen, for example when we try and #write sequences of different lengths to an alignment file. print indent+"Failed: %s" % str(e) #Carry on to the next format: continue handle.flush() handle.seek(0) #Now ready to read back from the handle... try : records2 = list(SeqIO.parse(handle=handle, format=format)) except SyntaxError, e : #This is BAD. We can't read our own output. #I want to see the output when called from the test harness, #run_tests.py (which can be funny about new lines on Windows) handle.seek(0) raise SyntaxError("%s\n\n%s\n\n%s" \ % (str(e), repr(handle.read()), repr(records))) assert len(records2) == t_count for i in range(t_count) : #Check the bare minimum (ID and sequence) as #many formats can't store more than that. # #Note some formats allow spaces, others don't. #Assume spaces are turned into underscores. records[i].id.replace(" ","_") == records2[i].id.replace(" ","_") records[i].seq.data == records2[i].seq.data | 3b79cccf07559d2ba5164d57e4d599db1d9e1e34 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/3b79cccf07559d2ba5164d57e4d599db1d9e1e34/test_SeqIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
9369,
294,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
14367,
4294,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
9369,
294,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
14367,
4294,
63... |
f.write("\0" * 8) | f.write(MAGIC) f.write("\0" * 4) | def writePyc(code, path): f = open(path, "wb") f.write("\0" * 8) # don't bother about a time stamp marshal.dump(code, f) f.seek(0, 0) f.write(MAGIC) f.close() | f13a37076aae6680a63d28d43497de36962d4f57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f13a37076aae6680a63d28d43497de36962d4f57/bundlebuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
9413,
71,
12,
710,
16,
589,
4672,
284,
273,
1696,
12,
803,
16,
315,
9464,
7923,
284,
18,
2626,
12,
49,
22247,
13,
284,
18,
2626,
31458,
20,
6,
380,
1059,
13,
225,
468,
2727,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1045,
9413,
71,
12,
710,
16,
589,
4672,
284,
273,
1696,
12,
803,
16,
315,
9464,
7923,
284,
18,
2626,
12,
49,
22247,
13,
284,
18,
2626,
31458,
20,
6,
380,
1059,
13,
225,
468,
2727,
... |
def item_cget(self, col, opt): return self.tk.call(self._w, 'item', 'cget', col, opt) | def item_cget(self, entry, col, opt): return self.tk.call(self._w, 'item', 'cget', entry, col, opt) | def item_cget(self, col, opt): return self.tk.call(self._w, 'item', 'cget', col, opt) | 925fa48561cba9d568fdba9dacb6d8cb2c974098 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/925fa48561cba9d568fdba9dacb6d8cb2c974098/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
761,
67,
71,
588,
12,
2890,
16,
225,
645,
16,
2153,
4672,
327,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
1726,
2187,
296,
71,
588,
2187,
645,
16,
2153,
13,
2,
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,
1,
1,
1,
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,
761,
67,
71,
588,
12,
2890,
16,
225,
645,
16,
2153,
4672,
327,
365,
18,
16099,
18,
1991,
12,
2890,
6315,
91,
16,
296,
1726,
2187,
296,
71,
588,
2187,
645,
16,
2153,
13,
2,
-100,
-1... |
return self.event_rect | rc = self.event_rect return Rect( rc.left() + (self.instance and self.instance.position().x() or 0), rc.top(), rc.width(), rc.height() ) | def getEventRect(self): return self.event_rect | bfdd918c4fb4208011480a3e5ab3f6a4a9206c63 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/bfdd918c4fb4208011480a3e5ab3f6a4a9206c63/GraphMultiEpg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9832,
6120,
12,
2890,
4672,
327,
365,
18,
2575,
67,
2607,
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,... | [
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9832,
6120,
12,
2890,
4672,
327,
365,
18,
2575,
67,
2607,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
d = base64.decodestring(pool.get('ir.attachment').browse(cr, uid, aids[0]).datas) | brow_rec = pool.get('ir.attachment').browse(cr, uid, aids[0]) if not brow_rec.datas: continue d = base64.decodestring(brow_rec.datas) | def __init__(self, *args, **argv): for key,arg in argv.items(): setattr(self, key, arg) | 580ab8c750be375663f614385e959361e071f30a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/580ab8c750be375663f614385e959361e071f30a/report_sxw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
19485,
4672,
364,
498,
16,
3175,
316,
5261,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
1501,
13,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
19485,
4672,
364,
498,
16,
3175,
316,
5261,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
1501,
13,
2,
-100,
-100,
-100,
-100,
-100,... |
POSTINST = 'initinst' | POSTINST = 'postinst' | def getEntry(self, protocol, network = True): """ Return the entry, in a GRUB compatible format """ buf = 'title %s\n' % self.title if self.desc: buf += 'desc %s\n' % self.desc if self.value: buf += self.value + '\n' return self._applyReplacement(buf, network) | 1d2d4086846f81cbe2e45c5efb8e3d210a8583d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/1d2d4086846f81cbe2e45c5efb8e3d210a8583d0/menu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15428,
12,
2890,
16,
1771,
16,
2483,
273,
1053,
4672,
3536,
2000,
326,
1241,
16,
316,
279,
15228,
3457,
7318,
740,
3536,
1681,
273,
296,
2649,
738,
87,
64,
82,
11,
738,
365,
18,
2649,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15428,
12,
2890,
16,
1771,
16,
2483,
273,
1053,
4672,
3536,
2000,
326,
1241,
16,
316,
279,
15228,
3457,
7318,
740,
3536,
1681,
273,
296,
2649,
738,
87,
64,
82,
11,
738,
365,
18,
2649,
... |
self.title = vc['TITLE'][0] | self.title = str(vc['TITLE'][0]) | def set_info_ogg( self, file ): """ Sets all the info variables with useful info from the oggfile. | 0da363e44f41820457a5f385cbc8673190f46f40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/0da363e44f41820457a5f385cbc8673190f46f40/audioinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1376,
67,
23972,
12,
365,
16,
585,
262,
30,
3536,
11511,
777,
326,
1123,
3152,
598,
5301,
1123,
628,
326,
320,
14253,
768,
18,
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,
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,
444,
67,
1376,
67,
23972,
12,
365,
16,
585,
262,
30,
3536,
11511,
777,
326,
1123,
3152,
598,
5301,
1123,
628,
326,
320,
14253,
768,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def guess_extension(type, strict=1): | def guess_all_extensions(type, strict=True): """Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ init() return guess_all_extensions(type, strict) def guess_extension(type, strict=True): | def guess_extension(type, strict=1): """Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. """ init() return guess_extension(type, strict) | 00f4afff414f17f11401025d4fd9f2f9f25f525b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/00f4afff414f17f11401025d4fd9f2f9f25f525b/mimetypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
67,
454,
67,
9489,
12,
723,
16,
5490,
33,
5510,
4672,
3536,
15977,
326,
4418,
364,
279,
585,
2511,
603,
2097,
13195,
618,
18,
225,
2000,
460,
353,
279,
666,
434,
2064,
21057,
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,
7274,
67,
454,
67,
9489,
12,
723,
16,
5490,
33,
5510,
4672,
3536,
15977,
326,
4418,
364,
279,
585,
2511,
603,
2097,
13195,
618,
18,
225,
2000,
460,
353,
279,
666,
434,
2064,
21057,
326... |
float.__init__(value) | float.__init__(self, value) | def __init__(self, value=0.0, prec=12): self.prec = int(prec) float.__init__(value) | 90a81028ad693329f6744d631fbd34ff4369bfe3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/90a81028ad693329f6744d631fbd34ff4369bfe3/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
460,
33,
20,
18,
20,
16,
13382,
33,
2138,
4672,
365,
18,
4036,
273,
509,
12,
4036,
13,
1431,
16186,
2738,
972,
12,
1132,
13,
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,
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,
1001,
2738,
972,
12,
2890,
16,
460,
33,
20,
18,
20,
16,
13382,
33,
2138,
4672,
365,
18,
4036,
273,
509,
12,
4036,
13,
1431,
16186,
2738,
972,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,... |
elif options.kmlVersion=="0": | if options.kmlVersion=="1": myAwareness.createKmlV1(options.kmlOutput) if options.kmlVersion=="0": | def createKmlV2(self,kmlFileName="output",heightFactor=0,threshold=0.005): """ A version based on lines and polygons instead of placemarks Args: kmlFileName: the name of the resulting kml (the osc filename per default) threshold: lat or long detla to link together the nodes (they aer not ways) to better visualize that this nodes belong to the same user. Output: Creates a kml file """ print "Creating KML file..." myKml=KML.KML(kmlFileName) statsDescription=self.globalStats() myKml.placemarkDescriptive(description=statsDescription,name=myKml.kmlTitle) for userName, userStat in sorted(self.statsUsers.iteritems()): myKml.folderHead("<![CDATA["+unicode(userName)\ +"("+str(self.statsUsers[userName][0])+")]]>") for pathType in [0,1,2]: ## Extract created nodes-"path" for this user # cut subpaths if next node is above the threshold lonThreshold=threshold latThreshold=threshold # paths=[] # list of cut paths firstNode=True thisPath="" for coordinate in self.statsUsers[userName][4][pathType]: thisLat=coordinate[0] thisLong=coordinate[1] thisNode=thisLong+","+thisLat+","\ +str(heightFactor)+" " if firstNode==True: thisPath+=thisNode prevLat=thisLat prevLong=thisLong firstNode=False else: #distanceThreshold=sqrt((thisLat-prevLat)**2 + (thisLong-prevLong)**2) dLon=abs(float(thisLong)-float(prevLong)) dLat=abs(float(thisLat)-float(prevLat)) if (dLon > lonThreshold) and (dLat > latThreshold): #print dLat, paths.append(thisPath) thisPath="" elif (dLon < lonThreshold) and (dLat < latThreshold): thisPath+=thisNode prevLat=thisLat prevLong=thisLong paths.append(thisPath+thisNode) #print paths #if len(self.statsUsers[userName][4][0])!=0: pathCreated=pathCreated+thisNode if pathType==0: lineStyle="lineStyleCreated" genre="Created" if pathType==1: lineStyle="lineStyleModified" genre="Modified" if pathType==2: lineStyle="lineStyleDeleted" genre="Deleted" trackCut=1 for path in paths: if path!="": myKml.placemarkPath(pathName=genre+"P"+str(trackCut), coordinates=path,style=lineStyle) trackCut+=1 #if userName ==None: print "Anonymous users detected" myKml.folderTail() myKml.close() | fe0b9eb053af0b2f2eeec1647fe57a8c599a32aa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1927/fe0b9eb053af0b2f2eeec1647fe57a8c599a32aa/osmaware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
47,
781,
58,
22,
12,
2890,
16,
79,
781,
4771,
1546,
2844,
3113,
4210,
6837,
33,
20,
16,
8699,
33,
20,
18,
28564,
4672,
3536,
432,
1177,
2511,
603,
2362,
471,
17294,
3560,
434,
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,
752,
47,
781,
58,
22,
12,
2890,
16,
79,
781,
4771,
1546,
2844,
3113,
4210,
6837,
33,
20,
16,
8699,
33,
20,
18,
28564,
4672,
3536,
432,
1177,
2511,
603,
2362,
471,
17294,
3560,
434,
3... |
url_re = re.compile(r'\w{3,6}://\S+') email_re = re.compile(r'[\w\.]+@[\w\.\-]+') designator_re = re.compile(r'([a-z_]+)(\d+)') def _url_repl(self, match): s = match.group(0) return '<a href="%s">%s</a>'%(s, s) def _email_repl(self, match): s = match.group(0) return '<a href="mailto:%s">%s</a>'%(s, s) def _designator_repl(self, match): s = match.group(0) s1 = match.group(1) s2 = match.group(2) try: self._db.getclass(s1) return '<a href="%s">%s %s</a>'%(s, s1, s2) except KeyError: return '%s%s'%(s1, s2) | hyper_re = re.compile(r'((?P<url>\w{3,6}://\S+)|' r'(?P<email>[\w\.]+@[\w\.\-]+)|' r'(?P<item>(?P<class>[a-z_]+)(?P<id>\d+)))') def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class') s2 = match.group('id') try: self._db.getclass(s1) return '<a href="%s">%s %s</a>'%(s, s1, s2) except KeyError: return '%s%s'%(s1, s2) | def __cmp__(self, other): if isinstance(other, HTMLProperty): return cmp(self._value, other._value) return cmp(self._value, other) | 24b8cf906e395bb31f22bdb647fe68df9add3817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/24b8cf906e395bb31f22bdb647fe68df9add3817/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
3982,
1396,
4672,
327,
9411,
12,
2890,
6315,
1132,
16,
1308,
6315,
1132,
13,
327,
9411,
12,
2890,
6315,
1132,
16,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
3982,
1396,
4672,
327,
9411,
12,
2890,
6315,
1132,
16,
1308,
6315,
1132,
13,
327,
9411,
12,
2890,
6315,
1132,
16,
13... |
print fss.getItem(fss.metadata(it)), it | if not fss.isContainer(it): print fss.getItem(fss.metadata(it)), it | def listItems(self, key): if key == "": key = "." path = self._keyToPath(key) return [self._stripPrefix(fn) for fn in glob.glob(path+"/*")] | a7a1944d24a0c3e0bb622941475acb2c7d37e769 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4231/a7a1944d24a0c3e0bb622941475acb2c7d37e769/FSStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
3126,
12,
2890,
16,
498,
4672,
309,
498,
422,
1408,
30,
498,
273,
4585,
589,
273,
365,
6315,
856,
774,
743,
12,
856,
13,
327,
306,
2890,
6315,
6406,
2244,
12,
4293,
13,
364,
229... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
666,
3126,
12,
2890,
16,
498,
4672,
309,
498,
422,
1408,
30,
498,
273,
4585,
589,
273,
365,
6315,
856,
774,
743,
12,
856,
13,
327,
306,
2890,
6315,
6406,
2244,
12,
4293,
13,
364,
229... |
print 'Generating manifest' | def generate_manifest(self, path, prefix, parts, parts_digest, file, key, iv, cert_path, ec2cert_path, private_key_path, target_arch, image_size, bundled_size, image_digest, user, kernel, ramdisk, mapping=None, product_codes=None, ancestor_ami_ids=None): print 'Generating manifest' | 921d53a6601f7c37bc6754526216d2f437914efd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12707/921d53a6601f7c37bc6754526216d2f437914efd/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
14357,
12,
2890,
16,
589,
16,
1633,
16,
2140,
16,
2140,
67,
10171,
16,
585,
16,
498,
16,
4674,
16,
3320,
67,
803,
16,
6557,
22,
7593,
67,
803,
16,
3238,
67,
856,
67,
803,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
14357,
12,
2890,
16,
589,
16,
1633,
16,
2140,
16,
2140,
67,
10171,
16,
585,
16,
498,
16,
4674,
16,
3320,
67,
803,
16,
6557,
22,
7593,
67,
803,
16,
3238,
67,
856,
67,
803,... | |
self.max_sub = self.attention | def __init__(self, verbose): self.count = 0 | cb6bc49d36771dd5e95ebfdee0c01b59a5a8c9b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/cb6bc49d36771dd5e95ebfdee0c01b59a5a8c9b7/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3988,
4672,
365,
18,
1883,
273,
374,
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,
... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3988,
4672,
365,
18,
1883,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
print "__oct__:", args | def __oct__(self, *args): print "__oct__:", args return '01' | c325556505a8ebbf36091d1115ec2e3a7fbaf5d6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/c325556505a8ebbf36091d1115ec2e3a7fbaf5d6/test_class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
16,
380,
1968,
4672,
327,
296,
1611,
11,
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,... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
16,
380,
1968,
4672,
327,
296,
1611,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '\\1', text) | if _re_stripid.search(repr(Exception)): return _re_stripid.sub(r'\1', text) | def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '\\1', text) return text | dfd15a479453f6fd5f5558a56f74bc7a53210566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/dfd15a479453f6fd5f5558a56f74bc7a53210566/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2569,
350,
12,
955,
4672,
3536,
3288,
326,
20070,
612,
628,
279,
6600,
733,
4335,
12123,
468,
1021,
14273,
434,
738,
84,
353,
4471,
17,
10891,
31,
732,
866,
2795,
6088,
18,
309,
389,
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,
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,
2569,
350,
12,
955,
4672,
3536,
3288,
326,
20070,
612,
628,
279,
6600,
733,
4335,
12123,
468,
1021,
14273,
434,
738,
84,
353,
4471,
17,
10891,
31,
732,
866,
2795,
6088,
18,
309,
389,
2... |
tags[self.tagnum]['album'] = fileref.tag().album | tags[self.tagnum]['album'] = tag.album | def tags_win_update(self, window, tags, entries, entries_names): self.updating_edit_entries = True # Populate tags(). Note that we only retrieve info from the # file if the info hasn't already been changed: fileref = tagpy.FileRef(tags[self.tagnum]['fullpath']) if not tags[self.tagnum]['title-changed']: tags[self.tagnum]['title'] = fileref.tag().title if not tags[self.tagnum]['artist-changed']: tags[self.tagnum]['artist'] = fileref.tag().artist if not tags[self.tagnum]['album-changed']: tags[self.tagnum]['album'] = fileref.tag().album if not tags[self.tagnum]['year-changed']: tags[self.tagnum]['year'] = fileref.tag().year if not tags[self.tagnum]['track-changed']: tags[self.tagnum]['track'] = fileref.tag().track if not tags[self.tagnum]['genre-changed']: tags[self.tagnum]['genre'] = fileref.tag().genre if not tags[self.tagnum]['comment-changed']: tags[self.tagnum]['comment'] = fileref.tag().comment # Update interface: entries[0].set_text(self.tags_get_tag(tags[self.tagnum], 'title')) entries[1].set_text(self.tags_get_tag(tags[self.tagnum], 'artist')) entries[2].set_text(self.tags_get_tag(tags[self.tagnum], 'album')) if self.tags_get_tag(tags[self.tagnum], 'year') != 0: entries[3].set_text(str(self.tags_get_tag(tags[self.tagnum], 'year'))) else: entries[3].set_text('') if self.tags_get_tag(tags[self.tagnum], 'track') != 0: entries[4].set_text(str(self.tags_get_tag(tags[self.tagnum], 'track'))) else: entries[4].set_text('') entries[5].set_text(self.tags_get_tag(tags[self.tagnum], 'genre')) entries[6].set_text(self.tags_get_tag(tags[self.tagnum], 'comment')) self.curr_mpdpath = gobject.filename_display_name(tags[self.tagnum]['mpdpath']) filename = self.curr_mpdpath if not self.use_mpdpaths: filename = os.path.basename(filename) entries[7].set_text(filename) entries[0].select_region(0, len(entries[0].get_text())) entries[0].grab_focus() window.set_title(_("Edit Tags") + " - " + str(self.tagnum+1) + " " + _("of") + " " + str(len(tags))) self.updating_edit_entries = False # Update text colors as appropriate: for i in range(len(entries)-1): if tags[self.tagnum][entries_names[i] + '-changed']: self.tags_win_entry_changed(entries[i]) else: self.tags_win_entry_revert_color(entries[i]) self.tags_win_set_sensitive(window.action_area) | f46c857512301d1836864c51b4a0d938e9c1cf02 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/f46c857512301d1836864c51b4a0d938e9c1cf02/tagedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
2725,
12,
2890,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
365,
18,
5533,
1776,
67,
4619,
67,
8219,
273,
1053,
468,
22254,
2342,
7675,
3609,
716,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2342,
67,
8082,
67,
2725,
12,
2890,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
365,
18,
5533,
1776,
67,
4619,
67,
8219,
273,
1053,
468,
22254,
2342,
7675,
3609,
716,
732,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.