rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
soup = BeautifulSoup(urllib2.urlopen(page)) | soup = BeautifulSoup(urllib2.urlopen(page), convertEntities=BeautifulSoup.HTML_ENTITIES) | def parse_page(page): """Parse a page of recently listened tracks and return a list.""" soup = BeautifulSoup(urllib2.urlopen(page)) for row in soup.find('table', 'candyStriped tracklist').findAll('tr'): artist, track, timestamp = parse_track(row) # Tracks submitted before 2005 have no timestamp if artist and track: yield (artist, track, timestamp) | 4b8a80ae1c37b95cab73e178444c66710b4f7e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6447/4b8a80ae1c37b95cab73e178444c66710b4f7e0d/lastscrape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2433,
12,
2433,
4672,
3536,
3201,
279,
1363,
434,
19907,
6514,
329,
13933,
471,
327,
279,
666,
12123,
15418,
273,
28132,
12,
718,
2941,
22,
18,
295,
18589,
12,
2433,
3631,
1765... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2433,
12,
2433,
4672,
3536,
3201,
279,
1363,
434,
19907,
6514,
329,
13933,
471,
327,
279,
666,
12123,
15418,
273,
28132,
12,
718,
2941,
22,
18,
295,
18589,
12,
2433,
3631,
1765... |
height = max(x.xy.y for x in self.nodeOrder) + 1 | height = max(xy.y for xy in self.coordinates) + 1 | def buildNodeList(self, tree): nodeGroups = {} for stmt in tree.stmts: if isinstance(stmt, diagparser.Node): node = self.getDiagramNode(stmt.id) node.setAttributes(stmt.attrs) elif isinstance(stmt, diagparser.Edge): while len(stmt.nodes) >= 2: edge = self.getDiagramEdge(stmt.nodes.pop(0), stmt.nodes[0]) edge.setAttributes(stmt.attrs) elif isinstance(stmt, diagparser.SubGraph): group = self.getDiagramGroup(stmt.id) nodeGroups[group] = stmt elif isinstance(stmt, diagparser.DefAttrs): self.diagram.setAttributes(stmt.attrs) else: raise AttributeError("Unknown sentense: " + str(type(stmt))) | eb97c21f8674ffa2f0c435aba47c61aa6abe13f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/eb97c21f8674ffa2f0c435aba47c61aa6abe13f0/blockdiag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
19914,
12,
2890,
16,
2151,
4672,
756,
3621,
273,
2618,
364,
3480,
316,
2151,
18,
25659,
30,
309,
1549,
12,
10589,
16,
6643,
4288,
18,
907,
4672,
756,
273,
365,
18,
588,
14058,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19914,
12,
2890,
16,
2151,
4672,
756,
3621,
273,
2618,
364,
3480,
316,
2151,
18,
25659,
30,
309,
1549,
12,
10589,
16,
6643,
4288,
18,
907,
4672,
756,
273,
365,
18,
588,
14058,
19... |
dif = abs( now - when ) | def calculateBucketLengthForTime( self, typeName, now, when ): """ Get the expected bucket time for a moment in time """ dif = abs( now - when ) for granuT in self.dbBucketsLength[ typeName ]: if dif < granuT[0]: return granuT[1] return self.maxBucketTime | 13b41032681fed093279f250f41a8f53aa4fff7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/13b41032681fed093279f250f41a8f53aa4fff7b/AccountingDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
4103,
1782,
1290,
950,
12,
365,
16,
8173,
16,
2037,
16,
1347,
262,
30,
3536,
968,
326,
2665,
2783,
813,
364,
279,
10382,
316,
813,
3536,
364,
15889,
89,
56,
316,
365,
18,
1966,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4604,
4103,
1782,
1290,
950,
12,
365,
16,
8173,
16,
2037,
16,
1347,
262,
30,
3536,
968,
326,
2665,
2783,
813,
364,
279,
10382,
316,
813,
3536,
364,
15889,
89,
56,
316,
365,
18,
1966,
... | |
gLogger.exception(error) | gLogger.exception( error ) | def configureCE( ceName='',ceType='', cfg=None, currentSectionPath='' ): """ Produce new dirac.cfg including configuration for new CE """ from DIRAC.Resources.Computing.ComputingElementFactory import ComputingElementFactory from DIRAC.Resources.Computing.ComputingElement import getLocalCEConfigDict from DIRAC import gConfig cesCfg = ResourcesDefaults.getComputingElementDefaults( ceName, ceType, cfg, currentSectionPath ) ceNameList = cesCfg.listSections() if not ceNameList: error = 'No CE Name provided' gLogger.error( error ) if exitOnError: exit( -1 ) return S_ERROR( error) for ceName in ceNameList: if 'CEType' not in cesCfg[ceName]: error = 'Missing Type for CE "%s"' % ceName gLogger.error( error ) if exitOnError: exit( -1 ) return S_ERROR( error) localsiteCfg = localCfg['LocalSite'] # Replace Configuration under LocalSite with new Configuration for ceName in ceNameList: if localsiteCfg.existsKey( ceName ): gLogger.notice(' Removing existing CE:', ceName ) localsiteCfg.deleteKey( ceName ) gLogger.notice( 'Configuring CE:', ceName ) localsiteCfg.createNewSection( ceName, contents=cesCfg[ceName] ) # Apply configuration and try to instantiate the CEs gConfig.loadCFG( localCfg ) for ceName in ceNameList: ceFactory = ComputingElementFactory( ) try: ceInstance = ceFactory.getCE(ceType, ceName) except Exception, x: error = 'Fail to instantiate CE' gLogger.exception(error) if exitOnError: exit( -1 ) return S_ERROR( error) if not ceInstance['OK']: error = 'Fail to instantiate CE: %s' % ceInstance['Message'] gLogger.error(error) if exitOnError: exit( -1 ) return S_ERROR( error) # Everything is OK, we can save the new cfg localCfg.writeToFile( cfgFile ) gLogger.always( 'LocalSite section in %s has been uptdated with new configuration:' % os.path.basename(cfgFile) ) gLogger.always( str( localCfg['LocalSite'] ) ) return S_OK( ceNameList ) | 9cd965a8f6afefefa23e4aaa683056b6432068d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9cd965a8f6afefefa23e4aaa683056b6432068d8/InstallTools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
1441,
12,
5898,
461,
2218,
2187,
311,
559,
2218,
2187,
2776,
33,
7036,
16,
783,
5285,
743,
2218,
11,
262,
30,
3536,
23278,
394,
4314,
8836,
18,
7066,
6508,
1664,
364,
394,
29538,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5068,
1441,
12,
5898,
461,
2218,
2187,
311,
559,
2218,
2187,
2776,
33,
7036,
16,
783,
5285,
743,
2218,
11,
262,
30,
3536,
23278,
394,
4314,
8836,
18,
7066,
6508,
1664,
364,
394,
29538,
... |
sCmd = "copy %s %s > NULL" % (lSrcFiles[i], file) | sCmd = "copy %s %s > NUL" % (lSrcFiles[i], file) | def main(): output = os.path.abspath(sys.argv[1]) target = sys.argv[2] f = open(output + ".hhp", "w") html_files = "" if len(sys.argv) > 2: # sys.argv[3] == html_dir # sys.argv[4:] == html_files (globbed) html_dir = os.path.abspath(sys.argv[3]) lGlobs = sys.argv[4:] lDestFiles, lSrcFiles = handle_globs(lGlobs) # ensure HTML Help build directory exists. try: os.makedirs(html_dir) except: pass # copy files into html_dir for i in range(len(lDestFiles)): file = lDestFiles[i] file = os.path.join(html_dir, file) # ensure any directories under html_dir get created. try: os.makedirs(os.path.split(file)[0]) except: pass sCmd = "copy %s %s > NULL" % (lSrcFiles[i], file) os.system(sCmd) for file in lDestFiles: html_files = html_files + '%s\\%s\n' % (html_dir, file) f.write(sHHPFormat % { "output" : output, "target" : target, "html_files" : html_files }) f.close() | f9382a3ed5ec6686d5be64224ae309a59513746b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/f9382a3ed5ec6686d5be64224ae309a59513746b/BuildHHP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
876,
273,
1140,
18,
803,
18,
5113,
803,
12,
9499,
18,
19485,
63,
21,
5717,
1018,
273,
2589,
18,
19485,
63,
22,
65,
284,
273,
1696,
12,
2844,
397,
3552,
76,
15373,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
876,
273,
1140,
18,
803,
18,
5113,
803,
12,
9499,
18,
19485,
63,
21,
5717,
1018,
273,
2589,
18,
19485,
63,
22,
65,
284,
273,
1696,
12,
2844,
397,
3552,
76,
15373,
3113,
... |
if add_box_flag is True: | if add_box_flag: | def write_html_output(opts, args, fnameList, tagLists, \ doThumb=True, cbcweb = False, mapList = [],\ comment=None, CoincSummTable=None,\ html_tag = '', add_box_flag=False): """ @param opts: The options from the calling code @param args: The args from the calling code @param fnameList: A list of the filenames @param tagLists: A list for the tags, getting added to the links @param doThumb: Uses the _thumb file as the sourcs for the images @param cbcweb: Creates the output as a CBC webpage @param mapList: A list of dictionaries to create the image maps @html_tag: tag to add to html filename @add_box_flag: Adds _OPEN_BOX to the html file name if any of the files in filelist have "_OPEN_BOX" in their name. Otherwise, will add "_CLOSED_BOX" to the file name. These flags go between opts.prefix and opts.suffix """ prefix = opts.prefix # add the html_tag if desired if html_tag != '': prefix += '_' + html_tag # add the box-flag to the prefix if desired if add_box_flag is True: box_flag = '' if [fname for fname in fnameList if 'OPEN_BOX' in fname] != []: box_flag ='_OPEN_BOX' else: box_flag = '_CLOSED_BOX' # add the box flag to the prefix prefix += box_flag # -- the HTML document and output cache file # -- initialise the web page calling init_page page, extra = init_markup_page(opts) if cbcweb: page.addheader("<%method title>" + opts.name + " results</%method>") page.addheader("<%method headline>" + opts.name + " results</%method>") page.addheader("<%method cvsid> $Id: InspiralUtils.py,v 1.41 2009/02/27 20:21:07 jclayton Exp $ </%method>") else: page.h1(opts.name + " results") page.p(prefix + opts.suffix) page.hr() # -- filename if cbcweb: html_filename = prefix + opts.suffix +"_publish.html" else: html_filename = prefix + opts.suffix +".html" if opts.output_path: html_filename = opts.output_path + html_filename html_file = file(html_filename, "w") # loop over the contents for tag,filename in zip(tagLists,fnameList): # set the correct name for linking (two '//' does not bother) if cbcweb: fname = opts.html_for_cbcweb + "/Images/" + os.path.basename(filename) else: fname = "Images/" + os.path.basename(filename) # set the thumbnail pictures if required if doThumb: fname_thumb = fname[:-4] + "_thumb.png" else: fname_thumb =fname # add the image to tge page page.a(extra.img(src=[fname_thumb], width=400, \ alt=tag, border="2"), title=tag, href=[ fname]) page.add("<hr/>") # add maps to this page if len(mapList)>0: m=0 for mapDict in mapList: m+=1 page.add( mapDict['text']+'<br>' ) page.add( '<IMG src="%s" width=800px '\ 'usemap="#map%d">' % ( mapDict['object'], m) ) page.add( '<MAP name="map%d"> <P>' % m ) n=0 for px, py, link in zip( mapDict['xCoords'], \ mapDict['yCoords'], \ mapDict['links']): n+=1 page.add( '<area href="%s" shape="circle" '\ 'coords="%d, %d, 5"> Point%d</a>' %\ ( link, px, py, n) ) page.add('</P></MAP></OBJECT><br>') page.add("<hr/>") if opts.enable_output: if comment is not None: page.add("<div> "+comment+"</div>") page.hr() if CoincSummTable is not None: page.add(CoincSummTable) page.hr() text = writeProcessParams( opts.name, opts.version, args) page.add(text) html_file.write(page(False)) html_file.close() return html_filename | bcc9a3d73777133127c6ec00f0ce96dd34b5bc6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/bcc9a3d73777133127c6ec00f0ce96dd34b5bc6a/InspiralUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2620,
67,
2844,
12,
4952,
16,
833,
16,
5299,
682,
16,
1047,
7432,
16,
521,
741,
18922,
33,
5510,
16,
2875,
71,
4875,
273,
1083,
16,
852,
682,
273,
5378,
17211,
2879,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2620,
67,
2844,
12,
4952,
16,
833,
16,
5299,
682,
16,
1047,
7432,
16,
521,
741,
18922,
33,
5510,
16,
2875,
71,
4875,
273,
1083,
16,
852,
682,
273,
5378,
17211,
2879,
33,
70... |
if character in self.QUOTATION_CHARACTERS: | if character in self.QUOTATION_CHARACTERS and self.classification[y][x] is None: | def recognize(self): """ Try to convert ASCII art to vector graphics. The result is stored in ``self.shapes``. """ # XXX search for symbols #~ #search for long strings #~ for y in range(self.height): #~ for x in range(self.width): #~ character = self.image[y][x] #~ if self.classification[y][x] is None: #~ if character.isalnum(): #~ self.shapes.extend( #~ self._follow_horizontal_string(x, y) #~ ) # search for quoted texts for y in range(self.height): for x in range(self.width): #if not yet classified, check for a line character = self.image[y][x] if character in self.QUOTATION_CHARACTERS: self.shapes.extend( self._follow_horizontal_string(x, y, quoted=True)) | 218252d005352e281120e3f98f9c3d27eb44ecbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1203/218252d005352e281120e3f98f9c3d27eb44ecbe/aafigure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21431,
12,
2890,
4672,
3536,
6161,
358,
1765,
11768,
3688,
358,
3806,
17313,
18,
1021,
563,
353,
4041,
316,
12176,
2890,
18,
17648,
68,
8338,
3536,
468,
11329,
1623,
364,
7963,
468,
98,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21431,
12,
2890,
4672,
3536,
6161,
358,
1765,
11768,
3688,
358,
3806,
17313,
18,
1021,
563,
353,
4041,
316,
12176,
2890,
18,
17648,
68,
8338,
3536,
468,
11329,
1623,
364,
7963,
468,
98,
... |
R = K[['q']] | def eisenstein_series_qexp(k, prec=10, K=QQ): r""" Return the $q$-expansion of the weight $k$ Eisenstein series to precision prec in the field $K$. Here's a rough description of how the algorithm works: we know $E_k = const + \sum_n sigma(n,k-1) q^n$. Now, we basically just compute all the $\sigma(n,k-1)$ simultaneously, as $\sigma$ is multiplicative. INPUT: k -- even positive integer prec -- nonnegative integer K -- a ring in which B_k/(2*k) is invertible EXAMPLES: sage: eisenstein_series_qexp(2,5) -1/24 + q + 3*q^2 + 4*q^3 + 7*q^4 + O(q^5) sage: eisenstein_series_qexp(2,0) O(q^0) AUTHORS: -- William Stein: original implementation -- Craig Citro (2007-06-01): rewrote for massive speedup """ k = Integer(k) if k%2 or k < 2: raise ValueError, "k (=%s) must be an even positive integer"%k precision = Integer(prec) if precision < 0: raise ValueError, "prec (=%s) must an even nonnegative integer"%prec R = K[['q']] one = Integer(1) val = [one] * (prec + 1) pow = 0 ind = 0 term = 0 expt = k - one for p in prime_range(1,prec+1): int_p = int(p) ppow = int_p mult = p**expt term = mult*mult last = mult while (ppow <= prec): ind = ppow while (ind <= prec): val[ind] = val[ind] * (term - one) // (last - one) ind += ppow ppow *= int_p last = term term *= mult val[0] = [-bernoulli(k) / (2*k)] return R(val, precision) | 37d32e5b878a862e5e00d658df6e0773a4c46222 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/37d32e5b878a862e5e00d658df6e0773a4c46222/eis_series.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
291,
275,
334,
13685,
67,
10222,
67,
85,
2749,
12,
79,
16,
13382,
33,
2163,
16,
1475,
33,
53,
53,
4672,
436,
8395,
2000,
326,
271,
85,
8,
17,
2749,
12162,
434,
326,
3119,
271,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
425,
291,
275,
334,
13685,
67,
10222,
67,
85,
2749,
12,
79,
16,
13382,
33,
2163,
16,
1475,
33,
53,
53,
4672,
436,
8395,
2000,
326,
271,
85,
8,
17,
2749,
12162,
434,
326,
3119,
271,
... | |
def get_number_of_spin(self): | def get_number_of_spins(self): | def get_number_of_spin(self): return 1 + int(self.calc.GetSpinPolarized()) | 7a734bfc3baabe5ff2322c55903416b4148070ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/7a734bfc3baabe5ff2322c55903416b4148070ec/old.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2696,
67,
792,
67,
1752,
2679,
12,
2890,
4672,
327,
404,
397,
509,
12,
2890,
18,
12448,
18,
967,
3389,
267,
5850,
297,
1235,
10756,
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,
336,
67,
2696,
67,
792,
67,
1752,
2679,
12,
2890,
4672,
327,
404,
397,
509,
12,
2890,
18,
12448,
18,
967,
3389,
267,
5850,
297,
1235,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.conn.send.add(item) self.conn.do.command_list_end() | self.conn.do.add(item) | def stream_parse_and_add(self, item): # We need to do different things depending on if this is # a normal stream, pls, m3u, etc.. # Note that we will only download the first 2000 bytes f = None try: request = urllib2.Request(item) opener = urllib2.build_opener() f = opener.open(request).read(2000) except: try: request = urllib2.Request("http://" + item) opener = urllib2.build_opener() f = opener.open(request).read(2000) except: try: request = urllib2.Request("file://" + item) opener = urllib2.build_opener() f = opener.open(request).read(2000) except: pass if f: self.conn.send.command_list_begin() if is_binary(f): # Binary file, just add it: self.conn.send.add(item) else: if "[playlist]" in f: # pls: self.stream_parse_pls(f) elif "#EXTM3U" in f: # extended m3u: self.stream_parse_m3u(f) elif "http://" in f: # m3u or generic list: self.stream_parse_m3u(f) else: # Something else.. self.conn.send.add(item) self.conn.do.command_list_end() else: # Hopefully just a regular stream, try to add it: self.conn.do.add(item) | 0da9815c248298a9268c10f25c59ea81e5bd319d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/0da9815c248298a9268c10f25c59ea81e5bd319d/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1407,
67,
2670,
67,
464,
67,
1289,
12,
2890,
16,
761,
4672,
468,
1660,
1608,
358,
741,
3775,
9198,
8353,
603,
309,
333,
353,
468,
279,
2212,
1407,
16,
886,
87,
16,
312,
23,
89,
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,
1407,
67,
2670,
67,
464,
67,
1289,
12,
2890,
16,
761,
4672,
468,
1660,
1608,
358,
741,
3775,
9198,
8353,
603,
309,
333,
353,
468,
279,
2212,
1407,
16,
886,
87,
16,
312,
23,
89,
16,
... |
the rdiff_backup_data directory because there is no important | the rdiff-backup-data directory because there is no important | def checkdest_need_check(dest_rp): """Return None if no dest dir found, 1 if dest dir needs check, 0 o/w""" if not dest_rp.isdir() or not Globals.rbdir.isdir(): return None for filename in Globals.rbdir.listdir(): if filename not in ['chars_to_quote', 'backup.log']: break else: # This may happen the first backup just after we test for quoting return None curmirroot = Globals.rbdir.append("current_mirror") curmir_incs = restore.get_inclist(curmirroot) if not curmir_incs: Log.FatalError( | 2495768fa544b503dad6cca4fbdf88cb7c9e85f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/783/2495768fa544b503dad6cca4fbdf88cb7c9e85f5/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
10488,
67,
14891,
67,
1893,
12,
10488,
67,
13832,
4672,
3536,
990,
599,
309,
1158,
1570,
1577,
1392,
16,
404,
309,
1570,
1577,
4260,
866,
16,
374,
320,
19,
91,
8395,
309,
486,
157... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10488,
67,
14891,
67,
1893,
12,
10488,
67,
13832,
4672,
3536,
990,
599,
309,
1158,
1570,
1577,
1392,
16,
404,
309,
1570,
1577,
4260,
866,
16,
374,
320,
19,
91,
8395,
309,
486,
157... |
self.cur.execute(category_update, {'balance':str(balance), 'id':item['category']}) | self.cur.execute(category_update, {'balance':mf(balance), 'id':item['category']}) | def _update_category_balance(self, item): "Update the category balance from the item amount" if int(item['type']) == 1: table = "ExpenseCategory" elif int(item['type']) == 2: table = "BillCategory" elif int(item['type']) == 3: table = "SavingCategory" category_select = "select * from %s where id = :id;" % (table) category_update = "update %s set balance = :balance where id = :id;" % (table) | c1b405e7b76ee374ecb1e3fca3072ef6e0007414 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14271/c1b405e7b76ee374ecb1e3fca3072ef6e0007414/view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
4743,
67,
12296,
12,
2890,
16,
761,
4672,
315,
1891,
326,
3150,
11013,
628,
326,
761,
3844,
6,
309,
509,
12,
1726,
3292,
723,
19486,
422,
404,
30,
1014,
273,
315,
424,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
4743,
67,
12296,
12,
2890,
16,
761,
4672,
315,
1891,
326,
3150,
11013,
628,
326,
761,
3844,
6,
309,
509,
12,
1726,
3292,
723,
19486,
422,
404,
30,
1014,
273,
315,
424,
... |
cmp_one_row = classmethod(cmp_one_row) | @classmethod | def cmp_one_row(cls, data_matrix1, data_matrix2, row_index1, row_index2, col_id2col_index1, col_id2col_index2, col_id12col_id2, \ mapping_for_data_matrix1=None): """ 2008-05-12 use NA_set 2008-05-12 split from cmp_row_wise(), for one row """ no_of_mismatches = 0 no_of_non_NA_pairs = 0 no_of_NAs = 0 no_of_totals = 0 for col_id1, col_index1 in col_id2col_index1.iteritems(): if col_id1 in col_id12col_id2: col_id2 = col_id12col_id2[col_id1] col_index2 = col_id2col_index2[col_id2] no_of_totals += 1 if data_matrix1[row_index1][col_index1] in NA_set: no_of_NAs += 1 if data_matrix1[row_index1][col_index1] not in NA_set and data_matrix2[row_index2][col_index2] not in NA_set: #2008-01-07 no_of_non_NA_pairs += 1 if data_matrix1[row_index1][col_index1] != data_matrix2[row_index2][col_index2]: no_of_mismatches += 1 if no_of_totals >0: NA_rate = no_of_NAs/float(no_of_totals) else: NA_rate = -1 if no_of_non_NA_pairs>0: mismatch_rate = no_of_mismatches/float(no_of_non_NA_pairs) else: mismatch_rate = -1 return NA_rate, mismatch_rate, no_of_NAs, no_of_totals, no_of_mismatches, no_of_non_NA_pairs | c13cb33cb1a6b269be23f22968b5981b73c60e17 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/c13cb33cb1a6b269be23f22968b5981b73c60e17/TwoSNPData.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9411,
67,
476,
67,
492,
12,
6429,
16,
501,
67,
5667,
21,
16,
501,
67,
5667,
22,
16,
1027,
67,
1615,
21,
16,
1027,
67,
1615,
22,
16,
645,
67,
350,
22,
1293,
67,
1615,
21,
16,
645,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9411,
67,
476,
67,
492,
12,
6429,
16,
501,
67,
5667,
21,
16,
501,
67,
5667,
22,
16,
1027,
67,
1615,
21,
16,
1027,
67,
1615,
22,
16,
645,
67,
350,
22,
1293,
67,
1615,
21,
16,
645,... |
if buf.len >= self.minimal_size_bytes: | if buf.tell() >= self.minimal_size_bytes: | def filter (self, data, **attrs): """feed data to recognizer""" if not attrs.has_key('mimerecognizer_buf'): return data buf = attrs['mimerecognizer_buf'] buf.write(data) if buf.len >= self.minimal_size_bytes: return self.recognize(buf, attrs) return '' | 0b7fc560693771de1ffdef9c3491de2a81d2f28d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/0b7fc560693771de1ffdef9c3491de2a81d2f28d/MimeRecognizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
261,
2890,
16,
501,
16,
2826,
7039,
4672,
3536,
7848,
501,
358,
14603,
1824,
8395,
309,
486,
3422,
18,
5332,
67,
856,
2668,
81,
4417,
557,
4198,
1824,
67,
4385,
11,
4672,
327,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1034,
261,
2890,
16,
501,
16,
2826,
7039,
4672,
3536,
7848,
501,
358,
14603,
1824,
8395,
309,
486,
3422,
18,
5332,
67,
856,
2668,
81,
4417,
557,
4198,
1824,
67,
4385,
11,
4672,
327,
50... |
def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i))) biglong = 2**32L - 1 swapped = func(biglong) self.assert_(swapped == biglong or swapped == -1) self.assertRaises(OverflowError, func, 2L**34) | def testNtoHL(self): sizes = {socket.htonl: 32, socket.ntohl: 32, socket.htons: 16, socket.ntohs: 16} for func, size in sizes.items(): mask = (1L<<size) - 1 for i in (0, 1, 0xffff, ~0xffff, 2, 0x01234567, 0x76543210): self.assertEqual(i & mask, func(func(i&mask)) & mask) swapped = func(mask) self.assertEqual(swapped & mask, mask) self.assertRaises(OverflowError, func, 1L<<34) | def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i))) | d2834f71a211a8f25a9c29a1cc8fe6b497fede58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d2834f71a211a8f25a9c29a1cc8fe6b497fede58/test_socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
50,
869,
44,
12,
2890,
4672,
364,
1326,
316,
2987,
18,
647,
265,
80,
16,
2987,
18,
496,
16699,
80,
30,
364,
277,
316,
261,
20,
16,
404,
16,
4871,
20,
20431,
16,
576,
48,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
50,
869,
44,
12,
2890,
4672,
364,
1326,
316,
2987,
18,
647,
265,
80,
16,
2987,
18,
496,
16699,
80,
30,
364,
277,
316,
261,
20,
16,
404,
16,
4871,
20,
20431,
16,
576,
48,
4672... |
gsl_probability=Extension('sage.gsl.probability_distribution',['sage/gsl/probability_distribution.pyx'],libraries=['gsl', BLAS, BLAS2],define_macros=[('GSL_DISABLE_DEPRECATED','1')]) gsl_integration=Extension('sage.gsl.integration',['sage/gsl/integration.pyx'],define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS, BLAS2]) | gsl_probability = Extension('sage.gsl.probability_distribution', ['sage/gsl/probability_distribution.pyx'], libraries=['gsl', BLAS, BLAS2], define_macros=[('GSL_DISABLE_DEPRECATED','1')]) gsl_integration = Extension('sage.gsl.integration', ['sage/gsl/integration.pyx'], define_macros=[('GSL_DISABLE_DEPRECATED','1')], libraries=['gsl',BLAS, BLAS2]) | def is_newer(file1, file2): """ Return True if either file2 does not exist or is older than file1. If file1 does not exist, always return False. """ if not os.path.exists(file1): return False if not os.path.exists(file2): return True if os.path.getmtime(file2) < os.path.getmtime(file1): return True return False | c82811cc0b935d826f6cfba833e4406f8eb9ed19 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/c82811cc0b935d826f6cfba833e4406f8eb9ed19/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
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,
353,
67,
2704,
264,
12,
768,
21,
16,
585,
22,
4672,
3536,
2000,
1053,
309,
3344,
585,
22,
1552,
486,
1005,
578,
353,
12156,
2353,
585,
21,
18,
225,
971,
585,
21,
1552,
486,
1005,
16,... |
urllib.quote('%s' % vardoc.canonical_name)) | urllib.quote('%s' % api_doc.canonical_name)) | def pysrc_url(self, vardoc): if isinstance(vardoc, ModuleDoc): if vardoc.filename in (None, UNKNOWN): return None else: return ('%s-module-pysrc.html' % urllib.quote('%s' % vardoc.canonical_name)) else: module = self.docindex.module_that_defines(vardoc) if module: mname_len = len(module.canonical_name) anchor = DottedName(*vardoc.canonical_name[mname_len:]) return ('%s-module-pysrc.html#%s' % (urllib.quote('%s' % module.canonical_name), urllib.quote('%s' % anchor))) | 3b9e871da71d71174bfb9c4ab3e0bae8dd2a5a2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/3b9e871da71d71174bfb9c4ab3e0bae8dd2a5a2a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21027,
1310,
67,
718,
12,
2890,
16,
569,
2434,
4672,
309,
1549,
12,
90,
1060,
504,
16,
5924,
1759,
4672,
309,
569,
2434,
18,
3459,
316,
261,
7036,
16,
13598,
4672,
327,
599,
469,
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,
21027,
1310,
67,
718,
12,
2890,
16,
569,
2434,
4672,
309,
1549,
12,
90,
1060,
504,
16,
5924,
1759,
4672,
309,
569,
2434,
18,
3459,
316,
261,
7036,
16,
13598,
4672,
327,
599,
469,
30,
... |
if member.kind == 'method' and not member.implicit_jscontext: | if member.kind == 'method' and not member.implicit_jscontext and not isVariantType(member.realtype): | def addStubMember(memberId, member, traceable): mayTrace = False if member.kind == 'method' and not member.implicit_jscontext: # This code MUST match writeTraceableQuickStub haveCallee = memberNeedsCallee(member) # Traceable natives support up to MAX_TRACEABLE_NATIVE_ARGS # total arguments. We always have two prefix arguments # (CONTEXT and THIS) and when haveCallee is true also have # CALLEE. We can only output a traceable native if our number # of arguments is no bigger than can be handled. prefixArgCount = 2 + int(haveCallee); mayTrace = (len(member.params) <= MAX_TRACEABLE_NATIVE_ARGS - prefixArgCount) for param in member.params: for attrname, value in vars(param).items(): if value is True: # Let the tracer call the regular fastnative method if there # are optional arguments. if attrname == 'optional': mayTrace = False continue raise UserError("Method %s, parameter %s: " "unrecognized property %r" % (memberId, param.name, attrname)) member.traceable = traceable and mayTrace # Add this member to the list. member.iface.stubMembers.append(member) | 50c10f08ea902c4ee7145c571c7595b4d431277f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/50c10f08ea902c4ee7145c571c7595b4d431277f/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11974,
4419,
12,
5990,
548,
16,
3140,
16,
2606,
429,
4672,
2026,
3448,
273,
1083,
309,
3140,
18,
9224,
422,
296,
2039,
11,
471,
486,
3140,
18,
24357,
67,
2924,
2472,
471,
486,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
11974,
4419,
12,
5990,
548,
16,
3140,
16,
2606,
429,
4672,
2026,
3448,
273,
1083,
309,
3140,
18,
9224,
422,
296,
2039,
11,
471,
486,
3140,
18,
24357,
67,
2924,
2472,
471,
486,
353... |
port = sys.argv[2] | try: port = int(sys.argv[2]) except ValueError: print "ERROR: port must be an integer value" sys.exit(0) | def build_installer(self, user_key_dict, vessels, dist_str): """ <Purpose> Create the customized installer by taking the user-key pair and vessel info <Arguments> user_key_dict: the dictionary containing the user - public key pair see method above for detailed format vessels: the vessel information given by the user see method above for detailed format dist_str: string that contains any combination of letter w (Windows), l (Linux), or m (Mac). example "lm" <Returns> The url of the installer it builds """ # a dummy username for testing (needs to be removed) username = "foo" # prefix dir is specific to this user user_prefix = self.prefix + "/%s_dist"%(username) | cb5a0f40a68ff5a6797852e4452775da461c8622 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/cb5a0f40a68ff5a6797852e4452775da461c8622/remote_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
20163,
12,
2890,
16,
729,
67,
856,
67,
1576,
16,
331,
403,
10558,
16,
2411,
67,
701,
4672,
3536,
411,
10262,
4150,
34,
1788,
326,
29063,
16050,
635,
13763,
326,
729,
17,
856,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
20163,
12,
2890,
16,
729,
67,
856,
67,
1576,
16,
331,
403,
10558,
16,
2411,
67,
701,
4672,
3536,
411,
10262,
4150,
34,
1788,
326,
29063,
16050,
635,
13763,
326,
729,
17,
856,... |
info = _RegKeyDict( dkey ) | info = _RegKeyDict(dkey) | def _LoadDynamicInfoFromKey( self, key ): try: dkey = _winreg.OpenKeyEx( key, 'Dynamic DST' ) except WindowsError: return info = _RegKeyDict( dkey ) del info['FirstEntry'] del info['LastEntry'] years = map( int, info.keys() ) values = map( WinTZI, info.values() ) # create a range mapping that searches by descending year and matches # if the target year is greater or equal. self.dynamicInfo = RangeMap( zip( years, values ), descending, operator.ge ) | 59648a863c896e2f14363d0c28a25b3865360d9a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/992/59648a863c896e2f14363d0c28a25b3865360d9a/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2563,
9791,
966,
1265,
653,
12,
365,
16,
498,
262,
30,
775,
30,
302,
856,
273,
389,
8082,
1574,
18,
3678,
653,
424,
12,
498,
16,
296,
9791,
463,
882,
11,
262,
1335,
8202,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2563,
9791,
966,
1265,
653,
12,
365,
16,
498,
262,
30,
775,
30,
302,
856,
273,
389,
8082,
1574,
18,
3678,
653,
424,
12,
498,
16,
296,
9791,
463,
882,
11,
262,
1335,
8202,
668,
... |
return 0 | raise ValueError(('list item %d does not begin with '+ 'an identifier.') % n) | def handle_consolidated_field(self, body, tagname): """ Attempt to handle a consolidated :Parameters: section, which should contain a single list. Any standard format for it?? """ # Check that it contains a bulleted list. if len(body) != 1 or body[0].tagname != 'bullet_list': print 'a' return 0 | 16d949db8254db8f0c72d44dc4229fd8de83ee3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/16d949db8254db8f0c72d44dc4229fd8de83ee3e/restructuredtext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
8559,
7953,
690,
67,
1518,
12,
2890,
16,
1417,
16,
25586,
4672,
3536,
12864,
358,
1640,
279,
21785,
690,
294,
2402,
30,
2442,
16,
1492,
1410,
912,
279,
2202,
666,
18,
225,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8559,
7953,
690,
67,
1518,
12,
2890,
16,
1417,
16,
25586,
4672,
3536,
12864,
358,
1640,
279,
21785,
690,
294,
2402,
30,
2442,
16,
1492,
1410,
912,
279,
2202,
666,
18,
225,
55... |
if validate(None, self, None, o, None): | if validate(None, self, None, o, _noroles): | def filtered_manage_options(self, REQUEST=None): | 349ff766c0a46742f62831a7e147472608a6295d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/349ff766c0a46742f62831a7e147472608a6295d/Management.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5105,
67,
12633,
67,
2116,
12,
2890,
16,
12492,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5105,
67,
12633,
67,
2116,
12,
2890,
16,
12492,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ContStr = group("[rR]?'" + any(r'\\.', r"[^\n'\\]") + group("'", r'\\\r?\n'), '[rR]?"' + any(r'\\.', r'[^\n"\\]') + group('"', r'\\\r?\n')) | ContStr = group(r"[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*" + group("'", r'\\\r?\n'), r'[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*' + group('"', r'\\\r?\n')) | def maybe(*choices): return apply(group, choices) + '?' | 86fa2dedab97a34f1f007c0a409aed49359d6af3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86fa2dedab97a34f1f007c0a409aed49359d6af3/tokenize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6944,
30857,
11937,
4672,
327,
2230,
12,
1655,
16,
7246,
13,
397,
6787,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
6944,
30857,
11937,
4672,
327,
2230,
12,
1655,
16,
7246,
13,
397,
6787,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return GNUTranslations(open(os.path.join(i18n_path, lang, 'LC_MESSAGES','formalchemy.mo'))) | translations_path = os.path.join(i18n_path, lang, 'LC_MESSAGES','formalchemy.mo') return GNUTranslations(open(translations_path, 'rb')) | def get_translator(lang=None): """ return a GNUTranslations instance for `lang`:: >>> translator = get_translator('fr') ... assert translator.gettext('Remove') == 'Supprimer' ... assert translator.gettext('month_01') == 'Janvier' >>> translator = get_translator('en') ... assert translator.gettext('Remove') == 'Remove' ... assert translator.gettext('month_01') == 'January' """ # get possible fallback languages try: langs = get_lang() or [] except TypeError: # this occurs when Pylons is available and we are not in a valid thread langs = [] # insert lang if provided if lang and lang not in langs: langs.insert(0, lang) if not langs: langs = ['en'] # get the first available catalog for lang in langs: filename = os.path.join(i18n_path, lang, 'LC_MESSAGES','formalchemy.mo') if os.path.isfile(filename): return GNUTranslations(open(os.path.join(i18n_path, lang, 'LC_MESSAGES','formalchemy.mo'))) # dummy translator return _Translator() | d2449f53aecb6e6d1a43c855f9e5923beded1e56 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13203/d2449f53aecb6e6d1a43c855f9e5923beded1e56/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
17879,
12,
4936,
33,
7036,
4672,
3536,
327,
279,
611,
50,
57,
12297,
791,
364,
1375,
4936,
68,
2866,
225,
4080,
8333,
273,
336,
67,
17879,
2668,
4840,
6134,
1372,
1815,
8333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17879,
12,
4936,
33,
7036,
4672,
3536,
327,
279,
611,
50,
57,
12297,
791,
364,
1375,
4936,
68,
2866,
225,
4080,
8333,
273,
336,
67,
17879,
2668,
4840,
6134,
1372,
1815,
8333,
... |
rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | D = os.path.join(os.path.dirname(reportlab.__file__), 'tools','pythonpoint') fn = os.path.join(D,'stdparser.py') if os.path.isfile(fn) or os.path.isfile(fn+'c') or os.path.isfile(fn+'o'): m1 = recursiveImport('stdparser', baseDir=D) | def test2(self): "try under a directory NOT on the path" rlDir = os.path.dirname(reportlab.__file__) ppDir = os.path.join(rlDir, 'tools','pythonpoint') m1 = recursiveImport('stdparser', baseDir=ppDir) | 153abc6259a5e5a886dbe294edae46c25b20613b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/153abc6259a5e5a886dbe294edae46c25b20613b/test_lib_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
22,
12,
2890,
4672,
315,
698,
3613,
279,
1867,
4269,
603,
326,
589,
6,
463,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
6006,
7411,
16186,
768,
972,
3631,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
22,
12,
2890,
4672,
315,
698,
3613,
279,
1867,
4269,
603,
326,
589,
6,
463,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
6006,
7411,
16186,
768,
972,
3631,
29... |
Abelian variety factor of dimension 1 of J0(42), Abelian variety factor of dimension 2 of J0(42), Abelian variety factor of dimension 2 of J0(42) | Simple abelian subvariety 21a(2,42) of dimension 1 of J0(42), Simple abelian subvariety 14a(1,42) of dimension 1 of J0(42), Simple abelian subvariety 14a(3,42) of dimension 1 of J0(42), Simple abelian subvariety 42a(1,42) of dimension 1 of J0(42), Simple abelian subvariety 21a(1,42) of dimension 1 of J0(42) | def is_subvariety(self, other): """ Return True if self is a subvariety of other. | 231a556974015ed454b20c5783447e82495d8183 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/231a556974015ed454b20c5783447e82495d8183/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1717,
4093,
14369,
12,
2890,
16,
1308,
4672,
3536,
2000,
1053,
309,
365,
353,
279,
720,
4093,
14369,
434,
1308,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
1717,
4093,
14369,
12,
2890,
16,
1308,
4672,
3536,
2000,
1053,
309,
365,
353,
279,
720,
4093,
14369,
434,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
window.location.replace('/');o | window.location.replace('/'); | def notebook_lib(): s= r""" | d8b601b388dfc968d77cbac43bc2157edb1d305e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/d8b601b388dfc968d77cbac43bc2157edb1d305e/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
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,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def balance_set(self, value): | def balance(self, value): | def balance_set(self, value): self._balance = float(value) | 893bd3e70bab4cf38ac9630a2f39c1900e9da566 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/893bd3e70bab4cf38ac9630a2f39c1900e9da566/bank.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11013,
12,
2890,
16,
460,
4672,
365,
6315,
12296,
273,
1431,
12,
1132,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
11013,
12,
2890,
16,
460,
4672,
365,
6315,
12296,
273,
1431,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
events.trigger("Close", self.window_list[item]) self.remove_page(self.page_num(self.window_list[item])) del self.window_list[item] | network, type, id = item if network: id = network.normalize_case(id) events.trigger("Close", self.window_list[network, type, id]) self.remove_page(self.page_num(self.window_list[network, type, id])) del self.window_list[network, type, id] | def __delitem__(self, item): events.trigger("Close", self.window_list[item]) | 7bde6f365265c67d891c9d1c5d0256fe7bd425bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/7bde6f365265c67d891c9d1c5d0256fe7bd425bb/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
1726,
972,
12,
2890,
16,
761,
4672,
2641,
18,
10668,
2932,
4605,
3113,
365,
18,
5668,
67,
1098,
63,
1726,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
1726,
972,
12,
2890,
16,
761,
4672,
2641,
18,
10668,
2932,
4605,
3113,
365,
18,
5668,
67,
1098,
63,
1726,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.windows[window].set_icon(gtk.gdk.pixbuf_new_from_file(self.get_image_path('icon3.png'))) builder.connect_signals(self) | self.windows[window].set_icon(gtk.gdk.pixbuf_new_from_file(self.get_image_path('icon3.png'))) | def __init__(self, app_instance, builder_file): """ Setup gui. Connect signals """ # configs self.app = app_instance # init builder builder = gtk.Builder() builder.add_from_file(builder_file) # dicts for widgets self.windows = self.construct_dict(builder, [ 'main_window', 'preferences_window', 'dialog_email_password', 'dialog_action', 'dialog_archive', 'dialog_conclusion', 'dialog_cut', 'dialog_cutlist', 'dialog_rename' ]) self.windows['main_window'].realize() self.windows['main_window'].window.set_decorations(gtk.gdk.DECOR_ALL & ~gtk.gdk.DECOR_MAXIMIZE) self.main_window = self.construct_dict(builder, [ 'toolbar', 'toolbuttonDecode', 'toolbuttonDecodeAll', 'toolbuttonCut', 'toolbuttonCutAll', 'toolbuttonDecodeAndCut', 'toolbuttonDecodeAndCutAll', | 2bc483b8d9443c0af39f7134c699dcad2da964a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11048/2bc483b8d9443c0af39f7134c699dcad2da964a5/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
595,
67,
1336,
16,
2089,
67,
768,
4672,
3536,
10939,
13238,
18,
8289,
11505,
3536,
225,
468,
6784,
365,
18,
2910,
273,
595,
67,
1336,
225,
468,
1208,
208... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
595,
67,
1336,
16,
2089,
67,
768,
4672,
3536,
10939,
13238,
18,
8289,
11505,
3536,
225,
468,
6784,
365,
18,
2910,
273,
595,
67,
1336,
225,
468,
1208,
208... |
THEME_CHANGE.post() | signals['theme change'].emit() | def set(new): """ set current fxd theme """ global current_theme if not current_theme: init_module() if new == current_theme: # new and old theme are the same, # don't do anything return current_theme if isinstance(new, str): # new theme is only a string, load the theme file # based on the current theme log.info('loading new theme %s', new) filename = new if new and vfs.isfile(os.path.join(new, 'folder.fxd')): new = vfs.abspath(os.path.join(new, 'folder.fxd')) elif new and vfs.isfile(new): new = vfs.abspath(new) theme = copy.copy(current_theme) try: theme.load(new) theme.prepare() except: log.exception('XML file corrupt:') theme = copy.copy(current_theme) theme.filename = new current_theme = theme else: # set the global theme variable current_theme = new # notify other parts of Freevo about the theme change # FIXME: maybe this is a signal. THEME_CHANGE.post() # return new theme in case the new one was given to this # function as string and the caller wants the object return current_theme | 23b132e7f080e2c018bf345f711a53a499a12f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/23b132e7f080e2c018bf345f711a53a499a12f33/theme.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2704,
4672,
3536,
444,
783,
284,
7669,
5006,
3536,
2552,
783,
67,
7997,
309,
486,
783,
67,
7997,
30,
1208,
67,
2978,
1435,
309,
394,
422,
783,
67,
7997,
30,
468,
394,
471,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2704,
4672,
3536,
444,
783,
284,
7669,
5006,
3536,
2552,
783,
67,
7997,
309,
486,
783,
67,
7997,
30,
1208,
67,
2978,
1435,
309,
394,
422,
783,
67,
7997,
30,
468,
394,
471,
1... |
output(sys.exc_info()[1]) | err = sys.exc_info()[1] output(str(err)) | def parse(file): scanner = ASDLScanner() parser = ASDLParser() buf = open(file).read() tokens = scanner.tokenize(buf) try: return parser.parse(tokens) except ASDLSyntaxError: output(sys.exc_info()[1]) lines = buf.split("\n") output(lines[err.lineno - 1]) # lines starts at 0, files at 1 | a63d393bd6bdbe0abf858a1518b1b8bf9c2abd9d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/a63d393bd6bdbe0abf858a1518b1b8bf9c2abd9d/asdl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
768,
4672,
7683,
273,
5355,
8914,
11338,
1435,
2082,
273,
5355,
8914,
2678,
1435,
225,
1681,
273,
1696,
12,
768,
2934,
896,
1435,
2430,
273,
7683,
18,
2316,
554,
12,
4385,
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,
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,
12,
768,
4672,
7683,
273,
5355,
8914,
11338,
1435,
2082,
273,
5355,
8914,
2678,
1435,
225,
1681,
273,
1696,
12,
768,
2934,
896,
1435,
2430,
273,
7683,
18,
2316,
554,
12,
4385,
13,
... |
print outStr | if notifyFunc: notifyFunc(outStr) else: print outStr | def wrap(*args,**kwargs): if args: rArgs = [args[0].__class__.__name__ + ', '] else: rArgs = [] | 1ea78fd02fc9ae34753d15944c23b5502ce72aef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/1ea78fd02fc9ae34753d15944c23b5502ce72aef/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
30857,
1968,
16,
636,
4333,
4672,
309,
833,
30,
436,
2615,
273,
306,
1968,
63,
20,
8009,
972,
1106,
972,
16186,
529,
972,
397,
2265,
12671,
469,
30,
436,
2615,
273,
5378,
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,
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,
2193,
30857,
1968,
16,
636,
4333,
4672,
309,
833,
30,
436,
2615,
273,
306,
1968,
63,
20,
8009,
972,
1106,
972,
16186,
529,
972,
397,
2265,
12671,
469,
30,
436,
2615,
273,
5378,
2,
-100... |
if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg)) | logger = logging.getLogger(title) if logger.isEnabledFor(logging.DEBUG_RPC): for line in pformat(msg).split('\n'): logger.log(logging.DEBUG_RPC, line) | def log(self, title, msg): if tools.config['log_level'] == logging.DEBUG_RPC: Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg)) | d40744c93709acc5967c8f7515faac95b984a736 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/d40744c93709acc5967c8f7515faac95b984a736/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
2077,
16,
1234,
4672,
309,
8513,
18,
1425,
3292,
1330,
67,
2815,
3546,
422,
2907,
18,
9394,
67,
8087,
30,
4242,
7675,
12336,
2909,
29909,
87,
11,
738,
2077,
16,
2018... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
2077,
16,
1234,
4672,
309,
8513,
18,
1425,
3292,
1330,
67,
2815,
3546,
422,
2907,
18,
9394,
67,
8087,
30,
4242,
7675,
12336,
2909,
29909,
87,
11,
738,
2077,
16,
2018... |
defaultFeedURLs = [u'http://www.getmiro.com/screencasts/windows/win.feed.rss'] defaultFeedURLs.extend([ (_('Starter Channels'), | usingMiroURL = u'http://www.getmiro.com/screencasts/windows/win.feed.rss' defaultFeedURLs = [ (_('Starter Channels'), | def _installDefaultFeeds(self): initialFeeds = resources.path("initial-feeds.democracy") if os.path.exists(initialFeeds): type, urls = subscription.parseFile(initialFeeds) if urls is not None and type == 'rss': for url in urls: feed.Feed(url, initiallyAutoDownloadable=False) dialog = dialogs.MessageBoxDialog(_("Custom Channels"), Template(_("You are running a version of $longAppName with a custom set of channels.")).substitute(longAppName=config.get(prefs.LONG_APP_NAME))) dialog.run() app.controller.initial_feeds = True else: logging.info("Adding default feeds") if platform.system() == 'Darwin': defaultFeedURLs = [u'http://www.getmiro.com/screencasts/mac/mac.feed.rss'] elif platform.system() == 'Windows': defaultFeedURLs = [u'http://www.getmiro.com/screencasts/windows/win.feed.rss'] else: defaultFeedURLs = [u'http://www.getmiro.com/screencasts/windows/win.feed.rss'] defaultFeedURLs.extend([ (_('Starter Channels'), [u'http://richie-b.blip.tv/posts/?skin=rss', u'http://feeds.pbs.org/pbs/kcet/wiredscience-video', u'http://www.jpl.nasa.gov/multimedia/rss/podfeed-hd.xml', u'http://www.linktv.org/rss/hq/mosaic.xml']), ]) | 1fd9a9a6843958d1ba8eb9e4155ec375a3cecc82 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/1fd9a9a6843958d1ba8eb9e4155ec375a3cecc82/theme.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5425,
1868,
8141,
87,
12,
2890,
4672,
2172,
8141,
87,
273,
2703,
18,
803,
2932,
6769,
17,
7848,
87,
18,
19117,
504,
354,
2431,
7923,
309,
1140,
18,
803,
18,
1808,
12,
6769,
8141,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5425,
1868,
8141,
87,
12,
2890,
4672,
2172,
8141,
87,
273,
2703,
18,
803,
2932,
6769,
17,
7848,
87,
18,
19117,
504,
354,
2431,
7923,
309,
1140,
18,
803,
18,
1808,
12,
6769,
8141,
... |
compiler = self.compiler | def build_libraries (self, libraries): | f4aa684132a2752118af9a2412f0acc90c258035 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4aa684132a2752118af9a2412f0acc90c258035/build_clib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
31417,
261,
2890,
16,
14732,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
31417,
261,
2890,
16,
14732,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
file.write("</" + _encode(tag, encoding) + ">") | file.write(_encode("</" + tag + ">", encoding)) | def _write(self, file, node, encoding, namespaces): # write XML to file tag = node.tag if tag is Comment: file.write("<!-- %s -->" % _escape_cdata(node.text, encoding)) elif tag is ProcessingInstruction: file.write("<?%s?>" % _escape_cdata(node.text, encoding)) else: items = list(node.items()) xmlns_items = [] # new namespaces in this scope try: if isinstance(tag, QName) or tag[:1] == "{": tag, xmlns = fixtag(tag, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(tag) file.write("<" + _encode(tag, encoding)) if items or xmlns_items: items.sort() # lexical order for k, v in items: try: if isinstance(k, QName) or k[:1] == "{": k, xmlns = fixtag(k, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(k) try: if isinstance(v, QName): v, xmlns = fixtag(v, namespaces) if xmlns: xmlns_items.append(xmlns) except TypeError: _raise_serialization_error(v) file.write(" %s=\"%s\"" % (_encode(k, encoding), _escape_attrib(v, encoding))) for k, v in xmlns_items: file.write(" %s=\"%s\"" % (_encode(k, encoding), _escape_attrib(v, encoding))) if node.text or len(node): file.write(">") if node.text: file.write(_escape_cdata(node.text, encoding)) for n in node: self._write(file, n, encoding, namespaces) file.write("</" + _encode(tag, encoding) + ">") else: file.write(" />") for k, v in xmlns_items: del namespaces[v] if node.tail: file.write(_escape_cdata(node.tail, encoding)) | aee804b3fce4c5038906d49ddb1a5d50826dbe83 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/aee804b3fce4c5038906d49ddb1a5d50826dbe83/ElementTree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
12,
2890,
16,
585,
16,
756,
16,
2688,
16,
7728,
4672,
468,
1045,
3167,
358,
585,
1047,
273,
756,
18,
2692,
309,
1047,
353,
9821,
30,
585,
18,
2626,
2932,
5586,
413,
738,
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,
389,
2626,
12,
2890,
16,
585,
16,
756,
16,
2688,
16,
7728,
4672,
468,
1045,
3167,
358,
585,
1047,
273,
756,
18,
2692,
309,
1047,
353,
9821,
30,
585,
18,
2626,
2932,
5586,
413,
738,
8... |
try: if self.options['scrollSpeed'] == "" or self.options['scrollSpeed'] == None: self.options['scrollSpeed'] = "30" except: self.options['scrollSpeed'] = "30" | if self.options.has_key('scrollSpeed'): if self.options['scrollSpeed'] == "": self.options['scrollSpeed'] = '30' else: self.options['scrollSpeed'] = '30' | def injectScript(self): """ Returns a string of script to inject in to the page """ | 28b4eb28ad2dfae50793b0a48b1f28a52237851c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5464/28b4eb28ad2dfae50793b0a48b1f28a52237851c/BrowserMediaAnimatedBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4590,
3651,
12,
2890,
4672,
3536,
2860,
279,
533,
434,
2728,
358,
4590,
316,
358,
326,
1363,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4590,
3651,
12,
2890,
4672,
3536,
2860,
279,
533,
434,
2728,
358,
4590,
316,
358,
326,
1363,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return 0 def check_spot( pos ): if len( wolfpack.items( pos.x, pos.y, pos.map ) ): return 0 return 1 | return False | def check_room( item, pos ): # check valid item if not item.hastag( 'carpentry_type' ): return 0 name = item.gettag( 'carpentry_type' ) if not deeds.haskey( name ): return 0 dir = deeds[ name ][ 1 ] items = deeds[ name ][ 2: ] if not items: return 0 num_item = len( items ) if not num_item: return 0 # check the spots ret0 = 0 ret1 = 0 ret2 = 0 if num_item == 1: return check_spot( pos ) elif num_item == 2: ret0 = check_spot( pos ) if dir == 1: ret1 = check_spot( pos.x, pos.y + 1, pos.map ) else: ret1 = check_spot( pos.x + 1, pos.y, pos.map ) return ret0 & ret1 elif num_item == 3: ret0 = check_spot( pos ) if dir == 1: ret1 = check_spot( pos.x, pos.y + 1, pos.map ) ret2 = check_spot( pos.x, pos.y - 1, pos.map ) else: ret1 = check_spot( pos.x + 1, pos.y, pos.map ) ret2 = check_spot( pos.x -1, pos.y, pos.map ) return ret0 & ret1 & ret2 elif num_item == 4: ret0 = 1 for x in range( pos.x, pos.x + 2 ): for y in range( pos.y, pos.y + 2 ): ret0 = check_spot( x, y, pos.map ) if not ret0: return 0 return 1 # pentagram elif num_item == 9: ret0 = wolfpack.items( pos.x, pos.y, pos.map, 2 ) if not ret0: return 0 return 1 # no other case : error return 0 | f9665c46d91ee48a0931cc8fc760b9852ee4a43f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/f9665c46d91ee48a0931cc8fc760b9852ee4a43f/carpentry_deed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13924,
12,
761,
16,
949,
262,
30,
468,
866,
923,
761,
309,
486,
761,
18,
76,
689,
346,
12,
296,
9815,
1907,
698,
67,
723,
11,
262,
30,
327,
374,
508,
273,
761,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13924,
12,
761,
16,
949,
262,
30,
468,
866,
923,
761,
309,
486,
761,
18,
76,
689,
346,
12,
296,
9815,
1907,
698,
67,
723,
11,
262,
30,
327,
374,
508,
273,
761,
18,
588,
... |
q = (C.base_ring()).order() P = C.sd_duursma_q(type,d0) | P = C.sd_duursma_q(typ,d0) | def sd_zeta_polynomial(C,type=1): r""" Returns the Duursma zeta function of a self-dual code using the construction in [D]. | 3a7625918ca06799454663aea3e731edc0d084bf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/3a7625918ca06799454663aea3e731edc0d084bf/linear_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8349,
67,
94,
1066,
67,
3915,
13602,
12,
39,
16,
723,
33,
21,
4672,
436,
8395,
2860,
326,
463,
89,
25152,
2540,
998,
1066,
445,
434,
279,
365,
17,
72,
1462,
981,
1450,
326,
16171,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8349,
67,
94,
1066,
67,
3915,
13602,
12,
39,
16,
723,
33,
21,
4672,
436,
8395,
2860,
326,
463,
89,
25152,
2540,
998,
1066,
445,
434,
279,
365,
17,
72,
1462,
981,
1450,
326,
16171,
31... |
fd, orf = tempfile.mkstemp() os.close(fd) | def extract_ocr_info(self, pnmfiles): fd, orf = tempfile.mkstemp() os.close(fd) | 528d4c0b050a00a26d548575b21d8bcd758c00e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/528d4c0b050a00a26d548575b21d8bcd758c00e7/ImageStripper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
504,
86,
67,
1376,
12,
2890,
16,
11059,
81,
2354,
4672,
5194,
16,
578,
74,
273,
13275,
18,
24816,
19781,
84,
1435,
1140,
18,
4412,
12,
8313,
13,
2,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
504,
86,
67,
1376,
12,
2890,
16,
11059,
81,
2354,
4672,
5194,
16,
578,
74,
273,
13275,
18,
24816,
19781,
84,
1435,
1140,
18,
4412,
12,
8313,
13,
2,
-100,
-100,
-100,
-100,
... | |
%(user)s will be changed. """) | %(safeuser)s will be changed. """) | def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() lenparts = parts and len(parts) if not parts or lenparts < 1: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.addError(_('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: # Avoid cross-site scripting attacks safelistname = Utils.websafe(listname) title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.addError(_('No such list <em>%(safelistname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # The total contents of the user's response cgidata = cgi.FieldStorage(keep_blank_values=1) # Set the language for the page. If we're coming from the listinfo cgi, # we might have a 'language' key in the cgi data. That was an explicit # preference to view the page in, so we should honor that here. If that's # not available, use the list's default language. language = cgidata.getvalue('language', mlist.preferred_language) i18n.set_language(language) doc.set_language(language) if lenparts < 2: user = cgidata.getvalue('email') if not user: # If we're coming from the listinfo page and we left the email # address field blank, it's not an error. listinfo.html names the # button UserOptions; we can use that as the descriminator. if not cgidata.getvalue('UserOptions'): doc.addError(_('No address given')) loginpage(mlist, doc, None, cgidata) print doc.Format() return else: user = Utils.LCDomain(Utils.UnobscureEmail(SLASH.join(parts[1:]))) # Avoid cross-site scripting attacks safeuser = Utils.websafe(user) # Sanity check the user, but be careful about leaking membership # information when we're using private rosters. if not mlist.isMember(user) and mlist.private_roster == 0: doc.addError(_('No such member: %(safeuser)s.')) loginpage(mlist, doc, None, cgidata) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = user.lower() try: cpuser = mlist.getMemberCPAddress(lcuser) except Errors.NotAMemberError: # This happens if the user isn't a member but we've got private rosters cpuser = None if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up to for the # user's stored preferred language, overridden by any form settings for # their new language preference. userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user)) doc.set_language(userlang) i18n.set_language(userlang) # See if this is VARHELP on topics. varhelp = None if cgidata.has_key('VARHELP'): varhelp = cgidata['VARHELP'].value elif os.environ.get('QUERY_STRING'): # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qs = cgi.parse_qs(os.environ['QUERY_STRING']).get('VARHELP') if qs and type(qs) == types.ListType: varhelp = qs[0] if varhelp: topic_details(mlist, doc, user, cpuser, userlang, varhelp) return # Are we processing an unsubscription request from the login screen? if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): mlist.ConfirmUnsubscription(user, userlang) doc.addError(_('The confirmation email has been sent.'), tag='') else: # Not a member if mlist.private_roster == 0: # Public rosters doc.addError(_('No such member: %(safeuser)s.')) else: syslog('mischief', 'Unsub attempt of non-member w/ private rosters: %s', user) doc.addError(_('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): if mlist.isMember(user): mlist.MailUserPassword(user) doc.addError( _('A reminder of your password has been emailed to you.'), tag='') else: # Not a member if mlist.private_roster == 0: # Public rosters doc.addError(_('No such member: %(safeuser)s.')) else: syslog('mischief', 'Reminder attempt of non-member w/ private rosters: %s', user) doc.addError( _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('password'): doc.addError(_('Authentication failed.')) # So as not to allow membership leakage, prompt for the email # address and the password here. if mlist.private_roster <> 0: syslog('mischief', 'Login failure with private rosters: %s', user) user = None loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist, user) + [mlist]: url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): # We could be changing the user's full name, email address, or both. # Watch out for non-ASCII characters in the member's name. membername = cgidata.getvalue('fullname') # Canonicalize the member's name membername = Utils.canonstr(membername, language) newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') oldname = mlist.getMemberName(user) set_address = set_membername = 0 # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # We will change the member's name under the following conditions: # - membername has a value # - membername has no value, but they /used/ to have a membername if membername and membername <> oldname: # Setting it to a new value set_membername = 1 if not membername and oldname: # Unsetting it set_membername = 1 # We will change the user's address if both newaddr and confirmaddr # are non-blank, have the same value, and aren't the currently # subscribed email address (when compared case-sensitively). If both # are blank, but membername is set, we ignore it, otherwise we print # an error. msg = '' if newaddr and confirmaddr: if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return if newaddr == cpuser: options_page(mlist, doc, user, cpuser, userlang, _('You are already using that email address')) print doc.Format() return # If they're requesting to subscribe an address which is already a # member, and they're /not/ doing it globally, then refuse. # Otherwise, we'll agree to do it globally (with a warning # message) and let ApprovedChangeMemberAddress() handle already a # member issues. if mlist.isMember(newaddr): safenewaddr = Utils.websafe(newaddr) if globally: listname = mlist.real_name msg += _("""\ | d7486f36a2c21a3bf7f4e4354844f858131b0e0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/d7486f36a2c21a3bf7f4e4354844f858131b0e0e/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
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,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
562,
6019,
273,... |
self.xNorm2 = 0.0 | self.xNorm2 = 0.0 | def __init__( self, c, **kwargs ): """ Solve the equality-constrained quadratic programming problem | aaeba3373d0375cd9447e5d6a6205e7f4114f313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13857/aaeba3373d0375cd9447e5d6a6205e7f4114f313/ppcg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
276,
16,
2826,
4333,
262,
30,
3536,
348,
5390,
326,
14958,
17,
591,
31142,
26146,
5402,
11987,
6199,
2,
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,
1001,
2738,
972,
12,
365,
16,
276,
16,
2826,
4333,
262,
30,
3536,
348,
5390,
326,
14958,
17,
591,
31142,
26146,
5402,
11987,
6199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def equify(f): """ Returns the equation rewritten to give negative values when True, | def equify(f, variables = None): """ Returns the equation rewritten as a symbolic function to give negative values when True, | def equify(f): """ Returns the equation rewritten to give negative values when True, positive when False. EXAMPLES: sage: from sage.plot.contour_plot import equify sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) 2 - x^2 """ import operator op = f.operator() if op is operator.gt or op is operator.ge: return f.rhs() - f.lhs() else: return f.lhs() - f.rhs() | 53e7b825257a4b83d2112766abf7b79749cd0e7f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/53e7b825257a4b83d2112766abf7b79749cd0e7f/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1298,
1164,
12,
74,
16,
3152,
273,
599,
4672,
3536,
2860,
326,
15778,
26768,
487,
279,
16754,
445,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
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,
1298,
1164,
12,
74,
16,
3152,
273,
599,
4672,
3536,
2860,
326,
15778,
26768,
487,
279,
16754,
445,
358,
8492,
6092,
924,
1347,
1053,
16,
6895,
1347,
1083,
18,
225,
5675,
8900,
11386,
30,... |
Subgroup of Mordell Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be saturated, and this is used; however, if the computed bound is greater than a value set by the eclib library (currently 97) then no saturation will be attempted at primes above this. - ``odd_primes_only`` (bool, default False) -- only do saturation at odd primes. (If the points have been found via 2-descent they should alreday be 2-saturated.) | 8b53e056cc765e689493ec9632c441ee03a3206a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8b53e056cc765e689493ec9632c441ee03a3206a/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... |
for recordedProgram in recordedlist: try: recordedRecord = recordedProgram.getRecorded() except MythError, e: sys.stderr.write(u"\n! Error: Getting recorded table record: %s\n" % e.args[0]) return programs | for recordedRecord in recordedlist: | def _getScheduledRecordedProgramList(self): '''Find all Scheduled and Recorded programs return array of found programs, if none then empty array is returned ''' programs=[] | 619ac1009ceeb785c0ebdccd1b235661e895634e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/619ac1009ceeb785c0ebdccd1b235661e895634e/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
10660,
426,
3850,
785,
9459,
682,
12,
2890,
4672,
9163,
3125,
777,
17286,
471,
868,
3850,
785,
25038,
327,
526,
434,
1392,
25038,
16,
309,
6555,
1508,
1008,
526,
353,
2106,
916... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
10660,
426,
3850,
785,
9459,
682,
12,
2890,
4672,
9163,
3125,
777,
17286,
471,
868,
3850,
785,
25038,
327,
526,
434,
1392,
25038,
16,
309,
6555,
1508,
1008,
526,
353,
2106,
916... |
self.logger.debug(query) | def getRestrictedComputersListLen(self, ctx, filt = None): """ Get the size of the computer list that match filters parameters """ self.logger.debug("getRestrictedComputersListLen") session = create_session() query = self.__getRestrictedComputersListQuery(ctx, filt, session) if query == None: return 0 query = query.group_by([self.machine.c.name, self.machine.c.domain]).all() self.logger.debug(query) session.close() # I didn't find how to easily count() all the computers after the # group_by. return query | ab6b40a91fa4c0664fcc491bd17bf70a61998675 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/ab6b40a91fa4c0664fcc491bd17bf70a61998675/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18784,
7703,
414,
682,
2891,
12,
2890,
16,
1103,
16,
18553,
273,
599,
4672,
3536,
968,
326,
963,
434,
326,
26579,
666,
716,
845,
3415,
1472,
3536,
365,
18,
4901,
18,
4148,
2932,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18784,
7703,
414,
682,
2891,
12,
2890,
16,
1103,
16,
18553,
273,
599,
4672,
3536,
968,
326,
963,
434,
326,
26579,
666,
716,
845,
3415,
1472,
3536,
365,
18,
4901,
18,
4148,
2932,
5... | |
EXAMPLES: | EXAMPLES:: | def CRT_vectors(X, moduli): """ INPUT: - ``X`` - list of lists of the same length - ``moduli`` - list of len(X) moduli OUTPUT: - ``list`` - application of CRT componentwise. EXAMPLES: sage: CRT_vectors([[3,5,7],[3,5,11]], [2,3]) [3, 5, 5] """ # First find the CRT basis: if len(X) == 0 or len(X[0]) == 0: return [] n = len(X) if n != len(moduli): raise ValueError, "number of moduli must equal length of X" a = CRT_basis(moduli) modulus = misc.prod(moduli) return [sum([a[i]*X[i][j] for i in range(n)]) % modulus for j in range(len(X[0]))] | f2370aee3f6f590b914899ff20666b42b979fc93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f2370aee3f6f590b914899ff20666b42b979fc93/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6732,
56,
67,
18535,
12,
60,
16,
13340,
77,
4672,
3536,
12943,
30,
282,
300,
225,
12176,
60,
10335,
300,
666,
434,
6035,
434,
326,
1967,
769,
225,
300,
225,
12176,
1711,
14826,
10335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6732,
56,
67,
18535,
12,
60,
16,
13340,
77,
4672,
3536,
12943,
30,
282,
300,
225,
12176,
60,
10335,
300,
666,
434,
6035,
434,
326,
1967,
769,
225,
300,
225,
12176,
1711,
14826,
10335,
... |
field += "\n" + fields.Field(self._model, self._column).render() | field += "\n" + fields.ModelFieldRender(self._model, self._column).render() | def render(self, **options): super(LabelField, self).render() | 328aceb5384e92cb7e9e25f08ddf08127ac10569 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13203/328aceb5384e92cb7e9e25f08ddf08127ac10569/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
2826,
2116,
4672,
2240,
12,
2224,
974,
16,
365,
2934,
5902,
1435,
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,
1743,
12,
2890,
16,
2826,
2116,
4672,
2240,
12,
2224,
974,
16,
365,
2934,
5902,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
else: if template in self.list_licenses: seems_ok = True exit_cicle = True license_found = license_selected break | if template in self.list_licenses: seems_ok = True exit_cicle = True license_found = license_selected break | def smartDetection(self, image_text): seems_ok = False license_found = None regex_find_licenses = re.compile(r'\{\{(?:[Tt]emplate:|)(.*?)(?:[|\n].*?|)\}\}', re.DOTALL) licenses_found = regex_find_licenses.findall(image_text) second_round = False | a125f0bc99d8f4717369fdaae33ff100c3445cb0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/a125f0bc99d8f4717369fdaae33ff100c3445cb0/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13706,
10214,
12,
2890,
16,
1316,
67,
955,
4672,
12001,
67,
601,
273,
1083,
8630,
67,
7015,
273,
599,
3936,
67,
4720,
67,
80,
16548,
273,
283,
18,
11100,
12,
86,
8314,
23241,
95,
23203... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13706,
10214,
12,
2890,
16,
1316,
67,
955,
4672,
12001,
67,
601,
273,
1083,
8630,
67,
7015,
273,
599,
3936,
67,
4720,
67,
80,
16548,
273,
283,
18,
11100,
12,
86,
8314,
23241,
95,
23203... |
sage: c = maple._commands() | sage: c = maple._commands() | def _commands(self): """ Return list of all commands defined in Maple. | 7ae09855b4aff8a1a3b5c69eb5509644d10936b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7ae09855b4aff8a1a3b5c69eb5509644d10936b0/maple.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7847,
12,
2890,
4672,
3536,
2000,
666,
434,
777,
4364,
2553,
316,
1635,
298,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
389,
7847,
12,
2890,
4672,
3536,
2000,
666,
434,
777,
4364,
2553,
316,
1635,
298,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
for (seg, id) in self.loops.reverse(): | self.loops.reverse() for (seg, id) in self.loops: | def cleanup(self): if self.loops: for (seg, id) in self.loops.reverse(): if self.loops[-1][0] == 'ST': err_str = 'ST id=%s was not closed with a SE' % (id) self.errh.st_error('3', err_str) self.errh.close_st_loop(None, None, self) elif self.loops[-1][0] == 'GS': err_str = 'GS id=%s was not closed with a GE' % (id) self.errh.gs_error('3', err_str) self.errh.close_gs_loop(None, None, self) elif self.loops[-1][0] == 'ISA': err_str = 'ISA id=%s was not closed with a IEA' % (id) self.errh.isa_error('023', err_str) self.errh.close_isa_loop(None, None, self) #elif self.loops[-1][0] == 'LS': # err_str = 'LS id=%s was not closed with a LE' % (id, self.loops[-1][1]) # self.errh.ls_error('3', err_str) | 38c6a0b00d23ce8ba5226d6ac86c75d24d496f88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11528/38c6a0b00d23ce8ba5226d6ac86c75d24d496f88/x12file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
12,
2890,
4672,
309,
365,
18,
383,
4473,
30,
365,
18,
383,
4473,
18,
9845,
1435,
364,
261,
5680,
16,
612,
13,
316,
365,
18,
383,
4473,
30,
309,
365,
18,
383,
4473,
18919,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6686,
12,
2890,
4672,
309,
365,
18,
383,
4473,
30,
365,
18,
383,
4473,
18,
9845,
1435,
364,
261,
5680,
16,
612,
13,
316,
365,
18,
383,
4473,
30,
309,
365,
18,
383,
4473,
18919,
21,
... |
color = styles.blockItem.getEventOutlineColor(item) | eventColors = styles.blockItem.getEventColors(item) color = eventColors.outlineColor | def GetStatusPen(self, styles): # probably should use styles to determine a good pen color item = self.GetItem() color = styles.blockItem.getEventOutlineColor(item) if (item.transparency == "confirmed"): pen = wx.Pen(color, 4) elif (item.transparency == "fyi"): pen = wx.Pen(color, 4) elif (item.transparency == "tentative"): pen = wx.Pen(color, 4, wx.DOT) return pen | 25ddad0361cdcff8c6c9b1849cc3d6061261e934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/25ddad0361cdcff8c6c9b1849cc3d6061261e934/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1482,
24251,
12,
2890,
16,
5687,
4672,
468,
8656,
1410,
999,
5687,
358,
4199,
279,
7494,
14264,
2036,
761,
273,
365,
18,
967,
1180,
1435,
871,
12570,
273,
5687,
18,
2629,
1180,
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,
968,
1482,
24251,
12,
2890,
16,
5687,
4672,
468,
8656,
1410,
999,
5687,
358,
4199,
279,
7494,
14264,
2036,
761,
273,
365,
18,
967,
1180,
1435,
871,
12570,
273,
5687,
18,
2629,
1180,
18,
... |
if fi and CFG_WEBSEARCH_FIELDS_CONVERT.has_key(string.lower(fi)): fi = CFG_WEBSEARCH_FIELDS_CONVERT[string.lower(fi)] | fi = wash_field(fi) | def create_basic_search_units(req, p, f, m=None, of='hb'): """Splits search pattern and search field into a list of independently searchable units. - A search unit consists of '(operator, pattern, field, type, hitset)' tuples where 'operator' is set union (|), set intersection (+) or set exclusion (-); 'pattern' is either a word (e.g. muon*) or a phrase (e.g. 'nuclear physics'); 'field' is either a code like 'title' or MARC tag like '100__a'; 'type' is the search type ('w' for word file search, 'a' for access file search). - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this kind of matching. If it is not set, then a guess is made. 'm' can have values: 'a'='all of the words', 'o'='any of the words', 'p'='phrase/substring', 'r'='regular expression', 'e'='exact value'. - Warnings are printed on req (when not None) in case of HTML output formats.""" opfts = [] # will hold (o,p,f,t,h) units # FIXME: quick hack for the journal index if f == 'journal': opfts.append(['+', p, f, 'w']) return opfts ## check arguments: is desired matching type set? if m: ## A - matching type is known; good! if m == 'e': # A1 - exact value: opfts.append(['+', p, f, 'a']) # '+' since we have only one unit elif m == 'p': # A2 - phrase/substring: opfts.append(['+', "%" + p + "%", f, 'a']) # '+' since we have only one unit elif m == 'r': # A3 - regular expression: opfts.append(['+', p, f, 'r']) # '+' since we have only one unit elif m == 'a' or m == 'w': # A4 - all of the words: p = strip_accents(p) # strip accents for 'w' mode, FIXME: delete when not needed for word in get_words_from_pattern(p): opfts.append(['+', word, f, 'w']) # '+' in all units elif m == 'o': # A5 - any of the words: p = strip_accents(p) # strip accents for 'w' mode, FIXME: delete when not needed for word in get_words_from_pattern(p): if len(opfts)==0: opfts.append(['+', word, f, 'w']) # '+' in the first unit else: opfts.append(['|', word, f, 'w']) # '|' in further units else: if of.startswith("h"): print_warning(req, "Matching type '%s' is not implemented yet." % cgi.escape(m), "Warning") opfts.append(['+', "%" + p + "%", f, 'w']) else: ## B - matching type is not known: let us try to determine it by some heuristics if f and p[0] == '"' and p[-1] == '"': ## B0 - does 'p' start and end by double quote, and is 'f' defined? => doing ACC search opfts.append(['+', p[1:-1], f, 'a']) elif (f == 'author' or f == 'exactauthor') and author_name_requires_phrase_search(p): ## B1 - do we search in author, and does 'p' contain space/comma/dot/etc? ## => doing washed ACC search opfts.append(['+', p, f, 'a']) elif f and p[0] == "'" and p[-1] == "'": ## B0bis - does 'p' start and end by single quote, and is 'f' defined? => doing ACC search opfts.append(['+', '%' + p[1:-1] + '%', f, 'a']) elif f and p[0] == "/" and p[-1] == "/": ## B0ter - does 'p' start and end by a slash, and is 'f' defined? => doing regexp search opfts.append(['+', p[1:-1], f, 'r']) elif f and string.find(p, ',') >= 0: ## B1 - does 'p' contain comma, and is 'f' defined? => doing ACC search opfts.append(['+', p, f, 'a']) elif f and str(f[0:2]).isdigit(): ## B2 - does 'f' exist and starts by two digits? => doing ACC search opfts.append(['+', p, f, 'a']) else: ## B3 - doing WRD search, but maybe ACC too # search units are separated by spaces unless the space is within single or double quotes # so, let us replace temporarily any space within quotes by '__SPACE__' p = re_pattern_single_quotes.sub(lambda x: "'"+string.replace(x.group(1), ' ', '__SPACE__')+"'", p) p = re_pattern_double_quotes.sub(lambda x: "\""+string.replace(x.group(1), ' ', '__SPACE__')+"\"", p) p = re_pattern_regexp_quotes.sub(lambda x: "/"+string.replace(x.group(1), ' ', '__SPACE__')+"/", p) # wash argument: p = re_equal.sub(":", p) p = re_logical_and.sub(" ", p) p = re_logical_or.sub(" |", p) p = re_logical_not.sub(" -", p) p = re_operators.sub(r' \1', p) for pi in string.split(p): # iterate through separated units (or items, as "pi" stands for "p item") pi = re_pattern_space.sub(" ", pi) # replace back '__SPACE__' by ' ' # firstly, determine set operator if pi[0] == '+' or pi[0] == '-' or pi[0] == '|': oi = pi[0] pi = pi[1:] else: # okay, there is no operator, so let us decide what to do by default oi = '+' # by default we are doing set intersection... # secondly, determine search pattern and field: if string.find(pi, ":") > 0: fi, pi = string.split(pi, ":", 1) # test whether fi is a real index code or a MARC-tag defined code: if fi in get_fieldcodes() or '00' <= fi[:2] <= '99': pass else: # it is not, so join it back: fi, pi = f, fi + ":" + pi else: fi, pi = f, pi # look also for old ALEPH field names: if fi and CFG_WEBSEARCH_FIELDS_CONVERT.has_key(string.lower(fi)): fi = CFG_WEBSEARCH_FIELDS_CONVERT[string.lower(fi)] # wash 'pi' argument: if re_quotes.match(pi): # B3a - quotes are found => do ACC search (phrase search) if pi[0] == '"' and pi[-1] == '"': pi = string.replace(pi, '"', '') # remove quote signs opfts.append([oi, pi, fi, 'a']) elif pi[0] == "'" and pi[-1] == "'": pi = string.replace(pi, "'", "") # remove quote signs opfts.append([oi, "%" + pi + "%", fi, 'a']) else: # unbalanced quotes, so fall back to WRD query: opfts.append([oi, pi, fi, 'w']) elif fi and str(fi[0]).isdigit() and str(fi[0]).isdigit(): # B3b - fi exists and starts by two digits => do ACC search opfts.append([oi, pi, fi, 'a']) elif fi and not get_index_id_from_field(fi) and get_field_name(fi): # B3c - logical field fi exists but there is no WRD index for fi => try ACC search opfts.append([oi, pi, fi, 'a']) elif pi.startswith('/') and pi.endswith('/'): # B3d - pi has slashes around => do regexp search opfts.append([oi, pi[1:-1], fi, 'r']) else: # B3e - general case => do WRD search pi = strip_accents(pi) # strip accents for 'w' mode, FIXME: delete when not needed for pii in get_words_from_pattern(pi): opfts.append([oi, pii, fi, 'w']) ## sanity check: for i in range(0, len(opfts)): try: pi = opfts[i][1] if pi == '*': if of.startswith("h"): print_warning(req, "Ignoring standalone wildcard word.", "Warning") del opfts[i] if pi == '' or pi == ' ': fi = opfts[i][2] if fi: if of.startswith("h"): print_warning(req, "Ignoring empty <em>%s</em> search term." % fi, "Warning") del opfts[i] except: pass ## return search units: return opfts | 8ddf761928449491a17692686d1824e4e3394724 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2139/8ddf761928449491a17692686d1824e4e3394724/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
13240,
67,
3072,
67,
7705,
12,
3658,
16,
293,
16,
284,
16,
312,
33,
7036,
16,
434,
2218,
76,
70,
11,
4672,
3536,
16582,
1623,
1936,
471,
1623,
652,
1368,
279,
666,
434,
1480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
13240,
67,
3072,
67,
7705,
12,
3658,
16,
293,
16,
284,
16,
312,
33,
7036,
16,
434,
2218,
76,
70,
11,
4672,
3536,
16582,
1623,
1936,
471,
1623,
652,
1368,
279,
666,
434,
1480... |
("kahan","watson","archimedes","tesla","Hawking"), | ("Kahan","watson","Archimedes","tesla","Hawking"), | def Precache(): pass#fixme | d63fd07c1902819d53e2b6e33c3c67ba3b9ddd7d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2883/d63fd07c1902819d53e2b6e33c3c67ba3b9ddd7d/faction_ships.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2962,
2493,
13332,
1342,
7,
904,
3501,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2962,
2493,
13332,
1342,
7,
904,
3501,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return http.Response(stream=msg) | return HTMLResponse(stream=msg) | def render(self, ctx): id = self.id(ctx) | 39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
612,
273,
365,
18,
350,
12,
5900,
13,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
612,
273,
365,
18,
350,
12,
5900,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
locale.setlocale(locale.LC_ALL, str('en_US' + '.' + encoding)) | def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name=None, verbose=True): logger = netsvc.Logger() if verbose: logger.notifyChannel("init", netsvc.LOG_INFO, 'loading translation file for language %s' % (lang)) pool = pooler.get_pool(db_name) lang_obj = pool.get('res.lang') trans_obj = pool.get('ir.translation') model_data_obj = pool.get('ir.model.data') try: uid = 1 cr = pooler.get_db(db_name).cursor() ids = lang_obj.search(cr, uid, [('code','=',lang)]) lc, encoding = locale.getdefaultlocale() if not encoding: encoding = 'UTF-8' if encoding == 'utf': encoding = 'UTF-8' if encoding == 'cp1252': encoding= '1252' if encoding == 'iso-8859-1': encoding= 'iso-8859-15' if encoding == 'latin1': encoding= 'latin9' try: if os.name == 'nt': locale.setlocale(locale.LC_ALL, str(_LOCALE2WIN32.get(lang, lang) + '.' + encoding)) else: locale.setlocale(locale.LC_ALL, str(lang + '.' + encoding)) except Exception: locale.setlocale(locale.LC_ALL, str('en_US' + '.' + encoding)) netsvc.Logger().notifyChannel(' ', netsvc.LOG_WARNING, 'unable to set locale "%s"' % (lang)) if not ids: if not lang_name: lang_name=lang languages=tools.get_languages() lang_name = languages.get(lang, lang) ids = lang_obj.create(cr, uid, { 'code': lang, 'name': lang_name, 'translatable': 1, 'date_format' : str(locale.nl_langinfo(locale.D_FMT).replace('%y', '%Y')), 'time_format' : str(locale.nl_langinfo(locale.T_FMT)), 'grouping' : [], 'decimal_point' : str(locale.nl_langinfo(locale.RADIXCHAR)), 'thousands_sep' : str(locale.nl_langinfo(locale.THOUSEP)) }) else: lang_obj.write(cr, uid, ids, {'translatable':1, 'date_format' : str(locale.nl_langinfo(locale.D_FMT).replace('%y', '%Y')), 'time_format' : str(locale.nl_langinfo(locale.T_FMT)), 'grouping' : [], 'decimal_point' : str(locale.nl_langinfo(locale.RADIXCHAR)), 'thousands_sep' : str(locale.nl_langinfo(locale.THOUSEP)) }) locale.resetlocale(locale.LC_ALL) lang_ids = lang_obj.search(cr, uid, []) langs = lang_obj.read(cr, uid, lang_ids) ls = map(lambda x: (x['code'],x['name']), langs) fileobj.seek(0) if fileformat == 'csv': reader = csv.reader(fileobj, quotechar='"', delimiter=',') # read the first line of the file (it contains columns titles) for row in reader: f = row break elif fileformat == 'po': reader = TinyPoFile(fileobj) f = ['type', 'name', 'res_id', 'src', 'value'] else: raise Exception(_('Bad file format')) # read the rest of the file line = 1 for row in reader: line += 1 # skip empty rows and rows where the translation field (=last fiefd) is empty if (not row) or (not row[-1]): continue # dictionary which holds values for this line of the csv file # {'lang': ..., 'type': ..., 'name': ..., 'res_id': ..., # 'src': ..., 'value': ...} dic = {'lang': lang} for i in range(len(f)): if f[i] in ('module',): continue dic[f[i]] = row[i] try: dic['res_id'] = int(dic['res_id']) except: model_data_ids = model_data_obj.search(cr, uid, [ ('model', '=', dic['name'].split(',')[0]), ('module', '=', dic['res_id'].split('.', 1)[0]), ('name', '=', dic['res_id'].split('.', 1)[1]), ]) if model_data_ids: dic['res_id'] = model_data_obj.browse(cr, uid, model_data_ids[0]).res_id else: dic['res_id'] = False if dic['type'] == 'model' and not strict: (model, field) = dic['name'].split(',') # get the ids of the resources of this model which share # the same source obj = pool.get(model) if obj: ids = obj.search(cr, uid, [(field, '=', dic['src'])]) # if the resource id (res_id) is in that list, use it, # otherwise use the whole list ids = (dic['res_id'] in ids) and [dic['res_id']] or ids for id in ids: dic['res_id'] = id ids = trans_obj.search(cr, uid, [ ('lang', '=', lang), ('type', '=', dic['type']), ('name', '=', dic['name']), ('src', '=', dic['src']), ('res_id', '=', dic['res_id']) ]) if ids: trans_obj.write(cr, uid, ids, {'value': dic['value']}) else: trans_obj.create(cr, uid, dic) else: ids = trans_obj.search(cr, uid, [ ('lang', '=', lang), ('type', '=', dic['type']), ('name', '=', dic['name']), ('src', '=', dic['src']) ]) if ids: trans_obj.write(cr, uid, ids, {'value': dic['value']}) else: trans_obj.create(cr, uid, dic) cr.commit() cr.close() if verbose: logger.notifyChannel("init", netsvc.LOG_INFO, "translation file loaded succesfully") except IOError: filename = '[lang: %s][format: %s]' % (lang or 'new', fileformat) logger.notifyChannel("init", netsvc.LOG_ERROR, "couldn't read translation file %s" % (filename,)) | c677abdf3ec73e03d9903f696e17c2578f0856fb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/c677abdf3ec73e03d9903f696e17c2578f0856fb/translate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
906,
67,
945,
67,
892,
12,
1966,
67,
529,
16,
17041,
16,
585,
2139,
16,
3303,
16,
5490,
33,
8381,
16,
3303,
67,
529,
33,
7036,
16,
3988,
33,
5510,
4672,
1194,
273,
21954,
4227,
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,
906,
67,
945,
67,
892,
12,
1966,
67,
529,
16,
17041,
16,
585,
2139,
16,
3303,
16,
5490,
33,
8381,
16,
3303,
67,
529,
33,
7036,
16,
3988,
33,
5510,
4672,
1194,
273,
21954,
4227,
18,
... | |
if not self._metadata_popupated: | if not self._metadata_populated: | def distribution(self): if not self._metadata_popupated: self.parse_metadata() return self._distribution | d7301a0b869a76845ebfdf478ff07d95dc243e3a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13693/d7301a0b869a76845ebfdf478ff07d95dc243e3a/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7006,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
16279,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7006,
12,
2890,
4672,
309,
486,
365,
6315,
4165,
67,
5120,
11799,
30,
365,
18,
2670,
67,
4165,
1435,
327,
365,
6315,
16279,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
gid = pwd.getpwnam(defaults.www_group).pw_gid | gid = grp.getgrnam(defaults.www_group).gr_gid | def make_nagios_directory(path): if not os.path.exists(path): os.mkdir(path) gid = pwd.getpwnam(defaults.www_group).pw_gid os.chown(path, -1, gid) os.chmod(path, 0770) | 0fe39017050be3e383317fa00e17d54578870f59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/0fe39017050be3e383317fa00e17d54578870f59/lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
27132,
7441,
67,
5149,
12,
803,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
803,
4672,
1140,
18,
26686,
12,
803,
13,
11399,
273,
14295,
18,
588,
3197,
17808,
12,
7606,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
27132,
7441,
67,
5149,
12,
803,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
803,
4672,
1140,
18,
26686,
12,
803,
13,
11399,
273,
14295,
18,
588,
3197,
17808,
12,
7606,
18,
... |
color = numpy.random.random((F.nelems(),3),dtype=float32) | color = numpy.random.rand(F.nelems(),3) | def draw(F, view=None,bbox=None, color='prop',colormap=None,alpha=0.5, mode=None,linewidth=None,shrink=None,marksize=None, wait=True,clear=None,allviews=False): """Draw object(s) with specified settings and direct camera to it. The first argument is an object to be drawn. All other arguments are settings that influence how the object is being drawn. F is either a Formex or a TriSurface object, or a name of such object (global or exported), or a list thereof. If F is a list, the draw() function is called repeatedly with each of ithe items of the list as first argument and with the remaining arguments unchanged. The remaining arguments are drawing options. If None, they are filled in from the current viewport drawing options. view is either the name of a defined view or 'last' or None. Predefined views are 'front','back','top','bottom','left','right','iso'. With view=None the camera settings remain unchanged (but might be changed interactively through the user interface). This may make the drawn object out of view! With view='last', the camera angles will be set to the same camera angles as in the last draw operation, undoing any interactive changes. The initial default view is 'front' (looking in the -z direction). bbox specifies the 3D volume at which the camera will be aimed (using the angles set by view). The camera position wil be set so that the volume comes in view using the current lens (default 45 degrees). bbox is a list of two points or compatible (array with shape (2,3)). Setting the bbox to a volume not enclosing the object may make the object invisible on the canvas. The special value bbox='auto' will use the bounding box of the objects getting drawn (object.bbox()), thus ensuring that the camera will focus on these objects. The special value bbox=None will use the bounding box of the previous drawing operation, thus ensuring that the camera's target volume remains unchanged. color,colormap,linewidth,alpha,marksize are passed to the creation of the 3D actor. shrink is a floating point shrink factor that will be applied to object before drawing it. If the Formex has properties and a color list is specified, then the the properties will be used as an index in the color list and each member will be drawn with the resulting color. If color is one color value, the whole Formex will be drawn with that color. Finally, if color=None is specified, the whole Formex is drawn in black. Each draw action activates a locking mechanism for the next draw action, which will only be allowed after drawdelay seconds have elapsed. This makes it easier to see subsequent images and is far more elegant that an explicit sleep() operation, because all script processing will continue up to the next drawing instruction. The value of drawdelay is set in the config, or 2 seconds by default. The user can disable the wait cycle for the next draw operation by specifying wait=False. Setting drawdelay=0 will disable the waiting mechanism for all subsequent draw statements (until set >0 again). """ if type(F) == list: actor = [] nowait = False for Fi in F: if Fi == F[-1]: nowait = wait actor.append(draw(Fi,view,bbox, color,colormap,alpha, mode,linewidth,shrink,marksize, wait=nowait,clear=clear,allviews=allviews)) if Fi == F[0]: clear = False view = None return actor if type(F) == str: F = named(F) if F is None: return None if isinstance(F,formex.Formex): pass elif isinstance(F,mesh.Mesh): pass elif isinstance(F,surface.TriSurface): pass elif isinstance(F,tools.Plane): pass elif hasattr(F,'toFormex'): F = F.toFormex() # keep this below trying the 'toFormex' !!! elif isinstance(F,coords.Coords): F = Formex(F) else: # Don't know how to draw this object raise RuntimeError,"draw() can not draw objects of type %s" % type(F) GD.GUI.drawlock.wait() if clear is None: clear = GD.canvas.options.get('clear',False) if clear: clear_canvas() if bbox is None: bbox = GD.canvas.options.get('bbox','auto') if view is not None and view != 'last': GD.debug("SETTING VIEW to %s" % view) setView(view) if shrink is None: shrink = GD.canvas.options.get('shrink',None) if marksize is None: marksize = GD.canvas.options.get('marksize',GD.cfg.get('marksize',5.0)) # Create the colors if color == 'prop': if hasattr(F,'p'): color = F.p elif hasattr(F,'prop'): color = F.prop else: color = colors.black elif color == 'random': # create random colors color = numpy.random.random((F.nelems(),3),dtype=float32) GD.GUI.setBusy() if shrink is not None: #GD.debug("DRAWING WITH SHRINK = %s" % shrink) F = _shrink(F,shrink) try: if isinstance(F,formex.Formex): if F.nelems() == 0: return None actor = actors.GeomActor(F.f,None,F.eltype,color=color,colormap=colormap,alpha=alpha,mode=mode,linewidth=linewidth,marksize=marksize) elif isinstance(F,mesh.Mesh): if F.nelems() == 0: return None actor = actors.GeomActor(F.coords,F.elems,F.eltype,color=color,colormap=colormap,alpha=alpha,mode=mode,linewidth=linewidth) elif isinstance(F,surface.TriSurface): if F.nelems() == 0: return None actor = actors.TriSurfaceActor(F,color=color,colormap=colormap,alpha=alpha,mode=mode,linewidth=linewidth) elif isinstance(F,tools.Plane): return drawPlane(F.point(),F.normal(),F.size()) GD.canvas.addActor(actor) if view is not None or bbox not in [None,'last']: #GD.debug("CHANGING VIEW to %s" % view) if view == 'last': view = GD.canvas.options['view'] if bbox == 'auto': bbox = F.bbox() #GD.debug("SET CAMERA TO: bbox=%s, view=%s" % (bbox,view)) GD.canvas.setCamera(bbox,view) #setView(view) GD.canvas.update() GD.app.processEvents() #GD.debug("AUTOSAVE %s" % image.autoSaveOn()) if image.autoSaveOn(): image.saveNext() if wait: # make sure next drawing operation is retarded GD.GUI.drawlock.lock() finally: GD.GUI.setBusy(False) return actor | 3e68b2bdf644e20564e1ac5c41b6c2d562153fa2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2499/3e68b2bdf644e20564e1ac5c41b6c2d562153fa2/draw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
42,
16,
1476,
33,
7036,
16,
20737,
33,
7036,
16,
2036,
2218,
5986,
2187,
1293,
18804,
33,
7036,
16,
5429,
33,
20,
18,
25,
16,
1965,
33,
7036,
16,
7511,
14434,
33,
7036,
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,
3724,
12,
42,
16,
1476,
33,
7036,
16,
20737,
33,
7036,
16,
2036,
2218,
5986,
2187,
1293,
18804,
33,
7036,
16,
5429,
33,
20,
18,
25,
16,
1965,
33,
7036,
16,
7511,
14434,
33,
7036,
16,... |
this = apply(_quickfix.new_PriorSettlPrice, args) | this = _quickfix.new_PriorSettlPrice(*args) | def __init__(self, *args): this = apply(_quickfix.new_PriorSettlPrice, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
25355,
694,
6172,
5147,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
25355,
694,
6172,
5147,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
where account_analytic_line.account_id =ANY(%s) \ | where account_analytic_line.account_id IN %s \ | def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id,COALESCE(SUM(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_analytic_line.journal_id = account_analytic_journal.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_journal.type='general' \ GROUP BY account_analytic_line.account_id",(ids2,)) ff = cr.fetchall() for account_id, sum in ff: res[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) for id in ids: res[id] = round(res.get(id, 0.0),2) return res | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16814,
67,
16172,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
12938,
4672,
400,
273,
2618,
3258,
22,
273,
365,
18,
3072,
12,
3353,
16,
4555,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16814,
67,
16172,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
12938,
4672,
400,
273,
2618,
3258,
22,
273,
365,
18,
3072,
12,
3353,
16,
4555,
1... |
if self.install_virtio: | if self.install_virtio == "yes": | def create_boot_floppy(self): """ Prepares a boot floppy by creating a floppy image file, mounting it and copying an answer file (kickstarts for RH based distros, answer files for windows) to it. After that the image is umounted. """ print "Creating boot floppy" | d245408f9a2fd5877bf4770afc7b97ad08147815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/d245408f9a2fd5877bf4770afc7b97ad08147815/unattended.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
7137,
67,
74,
16884,
2074,
12,
2890,
4672,
3536,
2962,
84,
4807,
279,
4835,
284,
16884,
2074,
635,
4979,
279,
284,
16884,
2074,
1316,
585,
16,
5344,
310,
518,
471,
8933,
392,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
7137,
67,
74,
16884,
2074,
12,
2890,
4672,
3536,
2962,
84,
4807,
279,
4835,
284,
16884,
2074,
635,
4979,
279,
284,
16884,
2074,
1316,
585,
16,
5344,
310,
518,
471,
8933,
392,
... |
c = 1 r = 1 screen = fsm.something[0] screen.cursor_home (r,c) | c = 1 r = 1 screen = fsm.something[0] screen.cursor_home (r,c) | def DoHomeOrigin (fsm): c = 1 r = 1 screen = fsm.something[0] screen.cursor_home (r,c) | cfa572ed6a74538df062e539442271b2ff84abec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9386/cfa572ed6a74538df062e539442271b2ff84abec/ansi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
8684,
7571,
261,
2556,
81,
4672,
276,
273,
404,
436,
273,
404,
5518,
273,
26957,
18,
30289,
63,
20,
65,
5518,
18,
9216,
67,
8712,
261,
86,
16,
71,
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,
2256,
8684,
7571,
261,
2556,
81,
4672,
276,
273,
404,
436,
273,
404,
5518,
273,
26957,
18,
30289,
63,
20,
65,
5518,
18,
9216,
67,
8712,
261,
86,
16,
71,
13,
2,
-100,
-100,
-100,
-100... |
outputPorts += visibleOptionalPorts | outputPorts += visibleOptionalOutputPorts | def setupModule(self, module): """ setupModule(module: Module) -> None Set up the item to reflect the info in 'module' """ # Update module info and visual self.id = module.id self.setZValue(float(self.id)) self.module = module self.center = copy.copy(module.center) if '__desc__' in module.db_annotations_key_index: self.label = module.get_annotation_by_key('__desc__').value.strip() self.description = module.label else: self.label = module.label self.description = '' self.setToolTip(self.description) self.computeBoundingRect() self.resetMatrix() self.translate(module.center.x, -module.center.y) | bb5e4e6e1f45b2acc9dd36ba0e6d8b580347ac97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/bb5e4e6e1f45b2acc9dd36ba0e6d8b580347ac97/pipeline_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
3120,
12,
2890,
16,
1605,
4672,
3536,
3875,
3120,
12,
2978,
30,
5924,
13,
317,
599,
1000,
731,
326,
761,
358,
3037,
326,
1123,
316,
296,
2978,
11,
225,
3536,
468,
2315,
1605,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3875,
3120,
12,
2890,
16,
1605,
4672,
3536,
3875,
3120,
12,
2978,
30,
5924,
13,
317,
599,
1000,
731,
326,
761,
358,
3037,
326,
1123,
316,
296,
2978,
11,
225,
3536,
468,
2315,
1605,
112... |
b = COWBase c = COWBase | b = COWBase.copy() c = COWBase.copy() | def testCopyCopy(self): """ Test the copy of copies """ | abb0b687bc0cc376745617c7c266fa82570e3cc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/abb0b687bc0cc376745617c7c266fa82570e3cc6/cowtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2951,
2951,
12,
2890,
4672,
3536,
7766,
326,
1610,
434,
13200,
3536,
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... | [
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,
1842,
2951,
2951,
12,
2890,
4672,
3536,
7766,
326,
1610,
434,
13200,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if not retVal[ 'OK' ] or retVal[ 'OK' ][0]: | if not retVal[ 'OK' ] or retVal[ 'Value' ][0]: | def __exec( self, cmd, rrdFile = None ): """ Execute a system command """ gLogger.debug( "RRD command: %s" % cmd) retVal = Subprocess.shellCall( 0, cmd ) if self.__logRRDCommands and rrdFile: try: logFile = "%s.log" % rrdFile fd = file( logFile, "a" ) if not retVal[ 'OK' ] or retVal[ 'OK' ][0]: fd.write( "ERROR %s\n" % cmd ) else: fd.write( "OK %s\n" % cmd ) fd.close() except Exception, e: gLogger.warn( "Cannot write log %s: %s" % ( logFile, str(e) ) ) if not retVal[ 'OK' ]: return retVal retTuple = retVal[ 'Value' ] if retTuple[0]: return S_ERROR( "Failed to execute rrdtool: %s" % ( retTuple[2] ) ) return retVal | 7d743e0eae65a9c60c0cc8db3b6e11880356eb51 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/7d743e0eae65a9c60c0cc8db3b6e11880356eb51/RRDManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4177,
12,
365,
16,
1797,
16,
8354,
72,
812,
273,
599,
262,
30,
3536,
7903,
279,
2619,
1296,
3536,
314,
3328,
18,
4148,
12,
315,
17950,
40,
1296,
30,
738,
87,
6,
738,
1797,
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,
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,
4177,
12,
365,
16,
1797,
16,
8354,
72,
812,
273,
599,
262,
30,
3536,
7903,
279,
2619,
1296,
3536,
314,
3328,
18,
4148,
12,
315,
17950,
40,
1296,
30,
738,
87,
6,
738,
1797,
13,
... |
f_model = self.f_model() f_model_amplitudes = f_model.amplitudes().data() f_model_phases = f_model.phases(deg=True).data() f_calc_amplitudes = self.f_calc().amplitudes().data() f_calc_phases = self.f_calc().phases(deg=True).data() f_mask_amplitudes = self.f_mask().amplitudes().data() f_mask_phases = self.f_mask().phases(deg=True).data() fom = self.figures_of_merit() alpha, beta = [item.data() for item in self.alpha_beta()] f_obs = self.f_obs.data() flags = self.r_free_flags.data() indices = self.f_obs.indices() resolution = self.f_obs.d_spacings().data() format="inde= %5d%5d%5d Fobs= %10.3f Fcalc= %10.3f %9.3f Fmask= %10.3f %9.3f"\ | format="inde= %5d%5d%5d Fobs= %11.4f Fcalc= %10.3f %9.3f Fmask= %10.3f %9.3f"\ | def dump(self, out = None): if(out is None): out = sys.stdout print >> out, "k_sol = %10.4f"%self.k_sol() print >> out, "b_sol = %10.4f"%self.b_sol() print >> out, "scale_k1 = %10.4f"%self.scale_k1() b0,b1,b2,b3,b4,b5 = n_as_s("%7.4f",self.b_cart()) c="," print >>out,"(B11,B22,B33,B12,B13,B23) = ("+b0+c+b1+c+b2+c+b3+c+b4+c+b5+")" f_model = self.f_model() f_model_amplitudes = f_model.amplitudes().data() f_model_phases = f_model.phases(deg=True).data() f_calc_amplitudes = self.f_calc().amplitudes().data() f_calc_phases = self.f_calc().phases(deg=True).data() f_mask_amplitudes = self.f_mask().amplitudes().data() f_mask_phases = self.f_mask().phases(deg=True).data() fom = self.figures_of_merit() alpha, beta = [item.data() for item in self.alpha_beta()] f_obs = self.f_obs.data() flags = self.r_free_flags.data() indices = self.f_obs.indices() resolution = self.f_obs.d_spacings().data() format="inde= %5d%5d%5d Fobs= %10.3f Fcalc= %10.3f %9.3f Fmask= %10.3f %9.3f"\ " Fmodel= %13.6f %12.6f fom= %5.3f alpha= %8.4f beta= %12.4f"\ " R-free-flags= %1d resol= %7.3f" for ind, f_obs_i, f_calc_amplitudes_i, f_calc_phases_i, f_mask_amplitudes_i,\ f_mask_phases_i, f_model_amplitudes_i, f_model_phases_i, fom_i, alpha_i,\ beta_i, flags_i, resolution_i in zip(indices, f_obs, f_calc_amplitudes, \ f_calc_phases, f_mask_amplitudes, f_mask_phases, f_model_amplitudes, \ f_model_phases, fom, alpha, beta, flags, resolution): print >> out, format%(ind[0], ind[1], ind[2], f_obs_i, f_calc_amplitudes_i, f_calc_phases_i, f_mask_amplitudes_i, f_mask_phases_i, f_model_amplitudes_i, f_model_phases_i, fom_i, alpha_i, beta_i, flags_i, resolution_i) | f19aefb5e2e6f1ee1fe619eeb40f1643efc3d937 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/f19aefb5e2e6f1ee1fe619eeb40f1643efc3d937/f_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
596,
273,
599,
4672,
309,
12,
659,
353,
599,
4672,
596,
273,
2589,
18,
10283,
1172,
1671,
596,
16,
315,
79,
67,
18281,
565,
273,
738,
2163,
18,
24,
74,
28385,
289... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4657,
12,
2890,
16,
596,
273,
599,
4672,
309,
12,
659,
353,
599,
4672,
596,
273,
2589,
18,
10283,
1172,
1671,
596,
16,
315,
79,
67,
18281,
565,
273,
738,
2163,
18,
24,
74,
28385,
289... |
if v: | if hasattr(v,'TextInfo') and not v.passThrough: | def script_sayAll(self,keyPress,nextScript): o=api.getFocusObject() v=o.virtualBuffer if v and not hasattr(v,'TextInfo') and not v.passThrough: sayAllHandler.sayAll(v.text_reviewPosition,v.text_characterCount,v.text_getNextLineOffsets,v.text_getText,v.text_reportNewPresentation,v._set_text_reviewPosition) else: if v: o=v info=o.makeTextInfo(textHandler.POSITION_CARET) sayAllHandler.readText(info,sayAllHandler.CURSOR_CARET) | e23d9ce72191d06b615f6815b2e7eb96eef84cce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/e23d9ce72191d06b615f6815b2e7eb96eef84cce/_default.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2728,
67,
87,
528,
1595,
12,
2890,
16,
856,
11840,
16,
4285,
3651,
4672,
320,
33,
2425,
18,
588,
9233,
921,
1435,
331,
33,
83,
18,
12384,
1892,
309,
331,
471,
486,
3859,
12,
90,
1118... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2728,
67,
87,
528,
1595,
12,
2890,
16,
856,
11840,
16,
4285,
3651,
4672,
320,
33,
2425,
18,
588,
9233,
921,
1435,
331,
33,
83,
18,
12384,
1892,
309,
331,
471,
486,
3859,
12,
90,
1118... |
print >>sys.stderr, "Failed to process", tag | print >>sys.stderr, "Failed to process:", tag | def parse_tag(self, tag, parent_css): try: tagname = tag.name.lower() except AttributeError: if not isinstance(tag, HTMLConverter.IGNORED_TAGS): self.add_text(tag, parent_css) return tag_css = self.tag_css(tag, parent_css=parent_css) try: # Skip element if its display attribute is set to none if tag_css['display'].lower() == 'none': return except KeyError: pass if 'page-break-before' in tag_css.keys(): if tag_css['page-break-before'].lower() != 'avoid': self.end_page() tag_css.pop('page-break-before') end_page = False if 'page-break-after' in tag_css.keys() and \ tag_css['page-break-after'].lower() != 'avoid': end_page = True tag_css.pop('page-break-after') if tagname in ["title", "script", "meta", 'del']: pass elif tagname == 'a': if tag.has_key('name'): self.current_para.append_to(self.current_block) self.current_block.append_to(self.current_page) previous = self.current_block tb = TextBlock() self.current_block = tb self.current_para = Paragraph() self.targets[tag['name']] = tb self.process_children(tag, tag_css) if tb.parent == None: if self.current_block == tb: self.current_para.append_to(self.current_block) self.current_para = Paragraph() if not self.current_block.get_text().strip(): self.current_page.append(self.current_block) self.current_block = TextBlock() else: found, marked = False, False for item in self.current_page.contents: if item == previous: found = True if found and isinstance(item, TextBlock): self.targets[tag['name']] = item marked = True if not marked: self.current_page.append(tb) elif tag.has_key('href'): purl = urlparse(tag['href']) path = purl[2] if path and os.path.splitext(path)[1][1:].lower() in \ ['png', 'jpg', 'bmp', 'jpeg']: self.add_image_page(path) else: self.add_text('Link: '+tag['href'], tag_css) self.links.append(HTMLConverter.Link(self.current_para.contents[-1], tag)) elif tagname == 'img': if tag.has_key('src') and os.access(tag['src'], os.R_OK): width, height = self.page_width, self.page_height try: try: from PIL import Image as PILImage except: pass else: im = PILImage.open(tag['src']) width, height = im.size if tag.has_key('width'): width = int(tag['width']) if tag.has_key('height'): height = int(tag['height']) except: pass path = os.path.abspath(tag['src']) if not self.images.has_key(path): self.images[path] = ImageStream(path) if max(width, height) <= min(self.page_width, self.page_height)/5.: im = Image(self.images[path], x0=0, y0=0, x1=width, y1=height,\ xsize=width, ysize=height) self.current_para.append(Plot(im, xsize=width*10, ysize=width*10)) elif max(width, height) <= min(self.page_width, self.page_height)/2.: self.end_current_para() im = Image(self.images[path], x0=0, y0=0, x1=width, y1=height,\ xsize=width, ysize=height) self.current_para.append(Plot(im, xsize=width*10, ysize=width*10)) else: self.current_block.append(self.current_para) self.current_page.append(self.current_block) self.current_para = Paragraph() self.current_block = TextBlock() im = ImageBlock(self.images[path], x1=width, y1=height, xsize=width, ysize=height) self.current_page.append(im) else: print >>sys.stderr, "Failed to process", tag self.add_image_page(tag['src']) elif tagname in ['style', 'link']: if tagname == 'style': for c in tag.contents: if isinstance(c,NavigableString): self.css.update(self.parse_css(str(c))) elif tag.has_key('type') and tag['type'] == "text/css" \ and tag.has_key('href'): url = tag['href'] try: if url.startswith('http://'): f = urlopen(url) else: f = open(url) self.parse_css(f.read()) f.close() except IOError: pass elif tagname == 'pre': self.end_current_para() src = ''.join([str(i) for i in tag.contents]) lines = src.split('\n') for line in lines: try: self.current_para.append(Span(line, tag_css, self.memory)) except ConversionError: pass self.current_para.CR() elif tagname in ['ul', 'ol']: self.in_ol = 1 if tagname == 'ol' else 0 self.end_current_para() self.process_children(tag, tag_css) self.in_ol = 0 self.end_current_para() elif tagname == 'li': prepend = str(self.in_ol)+'. ' if self.in_ol else u'\u2022' + ' ' if self.current_para.get_text().strip(): self.current_para.append(CR()) self.current_block.append(self.current_para) self.current_para = Paragraph() self.current_para.append(Space(xsize=100)) self.current_para.append(prepend) self.process_children(tag, tag_css) if self.in_ol: self.in_ol += 1 elif tagname in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']: self.end_current_para() if self.current_block.contents: self.current_block.append(CR()) self.process_children(tag, tag_css) self.end_current_para() self.current_block.append(CR()) elif tagname in ['p', 'div']: self.end_current_para() self.process_children(tag, tag_css) self.end_current_para() elif tagname in ['b', 'strong', 'i', 'em', 'span']: self.process_children(tag, tag_css) elif tagname == 'font': if tag.has_key('face'): tag_css['font-family'] = tag['face'] self.process_children(tag, tag_css) elif tagname in ['br', 'tr']: self.current_para.append(CR()) self.process_children(tag, tag_css) elif tagname == 'hr': if self.current_para.contents: self.current_block.append(self.current_para) self.current_para = Paragraph() self.current_block.append(CR()) self.current_page.append(self.current_block) self.current_block = TextBlock() self.current_page.RuledLine(linelength=self.page_width) else: self.process_children(tag, tag_css) if end_page: self.end_page() | 76959d8f951f10d54d69f01ed023a226f1e5299f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/76959d8f951f10d54d69f01ed023a226f1e5299f/convert_from.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2692,
12,
2890,
16,
1047,
16,
982,
67,
5212,
4672,
775,
30,
25586,
273,
1047,
18,
529,
18,
8167,
1435,
1335,
6394,
30,
309,
486,
1549,
12,
2692,
16,
3982,
5072,
18,
3047,
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,
1109,
67,
2692,
12,
2890,
16,
1047,
16,
982,
67,
5212,
4672,
775,
30,
25586,
273,
1047,
18,
529,
18,
8167,
1435,
1335,
6394,
30,
309,
486,
1549,
12,
2692,
16,
3982,
5072,
18,
3047,
3... |
newName = arg[len('-to:'):] | if oldName: fromToPairs.append([oldName, arg[len('-to:'):]]) oldName = None else: wikipedia.output(u'WARNING: %s without -from' % arg) | def main(): gen = None prefix = None oldName = None newName = None delete = False always = False skipredirects = False summary = None # This factory is responsible for processing command line arguments # that are also used by other scripts and that determine on which pages # to work on. genFactory = pagegenerators.GeneratorFactory() for arg in wikipedia.handleArgs(): if arg == '-del': delete = True elif arg == '-always': always = True if arg == '-skipredirects': skipredirects = True elif arg.startswith('-from:'): oldName = arg[len('-from:'):] elif arg.startswith('-to:'): newName = arg[len('-to:'):] elif arg.startswith('-prefix'): if len(arg) == len('-prefix'): prefix = wikipedia.input(u'Enter the prefix:') else: prefix = arg[8:] elif arg.startswith('-summary'): if len(arg) == len('-summary'): summary = wikipedia.input(u'Enter the summary:') else: summary = arg[9:] else: generator = genFactory.handleArg(arg) if generator: gen = generator if oldName and newName: page = wikipedia.Page(wikipedia.getSite(), oldName) bot = MovePagesBot(None, prefix, delete, always, skipredirects, summary) bot.moveOne(page, newName) elif gen: preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = MovePagesBot(preloadingGen, prefix, delete, always, skipredirects, summary) bot.run() else: wikipedia.showHelp('movepages') | 894512b38d0c2cf2b3c14f1dfffdc478d3ea09d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/894512b38d0c2cf2b3c14f1dfffdc478d3ea09d3/movepages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
1633,
273,
599,
22916,
273,
599,
13253,
273,
599,
1430,
273,
1083,
3712,
273,
1083,
2488,
22715,
273,
1083,
4916,
273,
599,
225,
468,
1220,
3272,
353,
14549,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3157,
273,
599,
1633,
273,
599,
22916,
273,
599,
13253,
273,
599,
1430,
273,
1083,
3712,
273,
1083,
2488,
22715,
273,
1083,
4916,
273,
599,
225,
468,
1220,
3272,
353,
14549,
... |
sqlStr = "SELECT extract('hour' from valid) as vhour, \ station, valid, p01m / 25.4 as p01i from t"+ sqlDate[:4] +" WHERE \ valid = '"+td+" 01:00' or valid = '"+td+" 02:00' or \ valid = '"+td+" 03:00' or valid = '"+td+" 04:00' or \ valid = '"+td+" 05:00' or valid = '"+td+" 06:00' or \ valid = '"+td+" 07:00' or valid = '"+td+" 08:00' or \ valid = '"+td+" 09:00' or valid = '"+td+" 10:00' or \ valid = '"+td+" 11:00' or valid = '"+td+" 12:00' or \ valid = '"+td+" 13:00' or valid = '"+td+" 14:00' or \ valid = '"+td+" 15:00' or valid = '"+td+" 16:00' or \ valid = '"+td+" 17:00' or valid = '"+td+" 18:00' or \ valid = '"+td+" 19:00' or valid = '"+td+" 20:00' or \ valid = '"+td+" 21:00' or valid = '"+td+" 22:00' or \ valid = '"+td+" 23:00' or valid = '"+tm+" 00:00' " | sqlStr = "SELECT station, max(p01m/25.4) as p01i,\ extract(hour from valid) as vhour from t%s \ WHERE valid BETWEEN '%s' and '%s' GROUP by station, vhour" % \ (ts.year, td, tm) | def Main(): ts = doHeader() loadstations() setupTable() sqlDate = ts.strftime("%Y-%m-%d") td = ts.strftime("%Y-%m-%d") tm = (ts + 1).strftime("%Y-%m-%d") ## # Hack, since postgres won't index date(valid) sqlStr = "SELECT extract('hour' from valid) as vhour, \ station, valid, p01m / 25.4 as p01i from t"+ sqlDate[:4] +" WHERE \ valid = '"+td+" 01:00' or valid = '"+td+" 02:00' or \ valid = '"+td+" 03:00' or valid = '"+td+" 04:00' or \ valid = '"+td+" 05:00' or valid = '"+td+" 06:00' or \ valid = '"+td+" 07:00' or valid = '"+td+" 08:00' or \ valid = '"+td+" 09:00' or valid = '"+td+" 10:00' or \ valid = '"+td+" 11:00' or valid = '"+td+" 12:00' or \ valid = '"+td+" 13:00' or valid = '"+td+" 14:00' or \ valid = '"+td+" 15:00' or valid = '"+td+" 16:00' or \ valid = '"+td+" 17:00' or valid = '"+td+" 18:00' or \ valid = '"+td+" 19:00' or valid = '"+td+" 20:00' or \ valid = '"+td+" 21:00' or valid = '"+td+" 22:00' or \ valid = '"+td+" 23:00' or valid = '"+tm+" 00:00' " rs = "" try: rs = mydb.query(sqlStr).dictresult() except: print "<p>Error: No data for that year" for i in range(len(rs)): p01i = float(rs[i]["p01i"]) vhour = int(rs[i]["vhour"]) if (vhour == 0): vhour = 24 if (p01i > 0): # We should require this timestep requireHrs[ vhour ] = 1 try: stData[ rs[i]["station"] ][ vhour ] = round(p01i,2) except KeyError: continue else: try: stData[ rs[i]["station"] ][ vhour ] = " " except KeyError: continue if (ts < mx.DateTime.DateTime(2006,6,1)): stData['MXO'] = ["M"]*25 stData['IIB'] = ["M"]*25 stData['VTI'] = ["M"]*25 stData['MPZ'] = ["M"]*25 stData['PEA'] = ["M"]*25 for j in range(len(st.ids)): station = st.ids[j] print "<tr class=\"row"+ str(j % 5) +"\">", print "%s%s%s" % ("<td>", station, "</td>") , for i in range(1,25): print "<td class=\"style"+ str(i % 3) +"\">", print "%s%s " % ( stData[station][i], "</td>") , try: totp[station] = totp[station] + stData[station][i] except: continue print "%s%s%s" % ("<td>", totp[station], "</td>") , print "%s%s%s" % ("<td>", station, "</td>") , print "</tr>" print """ | b9859367270c5baf590654638ed901ae85725c03 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11189/b9859367270c5baf590654638ed901ae85725c03/catAZOS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12740,
13332,
3742,
273,
741,
1864,
1435,
1262,
31478,
1435,
3875,
1388,
1435,
225,
1847,
1626,
273,
3742,
18,
701,
9982,
27188,
61,
6456,
81,
6456,
72,
7923,
6655,
273,
3742,
18,
701,
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,
12740,
13332,
3742,
273,
741,
1864,
1435,
1262,
31478,
1435,
3875,
1388,
1435,
225,
1847,
1626,
273,
3742,
18,
701,
9982,
27188,
61,
6456,
81,
6456,
72,
7923,
6655,
273,
3742,
18,
701,
9... |
raise ValueError, "length of initial_guess does not coinside with the number of parameters" | raise ValueError, "length of initial_guess does not coincide with the number of parameters" | sage: def f(x, a, b, c): return a * sin(b * x - c) | 3393eb44f88620be14817f51b44b1dd9db6530cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/3393eb44f88620be14817f51b44b1dd9db6530cb/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
1652,
284,
12,
92,
16,
279,
16,
324,
16,
276,
4672,
327,
279,
380,
5367,
12,
70,
380,
619,
300,
276,
13,
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,
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,
272,
410,
30,
1652,
284,
12,
92,
16,
279,
16,
324,
16,
276,
4672,
327,
279,
380,
5367,
12,
70,
380,
619,
300,
276,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Note that you have explicitly define variables and pass | However, preparsing can be turned off. sage: sage_eval('2^3', preparse=False) 1 Note that you can explicitly define variables and pass | def sage_eval(source, locals={}): r""" Obtain a \SAGE object from the input string by evaluate it using SAGE. This means calling eval after preparsing and with globals equal to everything included in the scope of \code{from sage.all import *}.). If the object has an _sage_ method it is called and the value is returned. Otherwise str is called on the object, and all preparsing is applied and the resulting expression is evaluated in the context of \code{from sage.all import *}. To evaluate the expression with certain variables set, use the locals argument, which should be a dictionary. EXAMPLES: This example illustrates that preparsing is applied. sage: eval('2^3') 1 sage: sage_eval('2^3') 8 Note that you have explicitly define variables and pass them as the second option: sage: x = PolynomialRing(RationalField(),"x").gen() sage: sage_eval('x^2+1', locals={'x':x}) x^2 + 1 This illustrates interfaces: sage: f = gp('2/3') sage: type(f) <class 'sage.interfaces.gp.GpElement'> sage: f._sage_() 2/3 sage: type(f._sage_()) <type 'sage.rings.rational.Rational'> sage: a = gap(939393/2433) sage: a._sage_() 313131/811 sage: type(a._sage_()) <type 'sage.rings.rational.Rational'> This example illustrates that evaluation occurs in the context of \code{from sage.all import *}. Even though bernoulli has been redefined in the local scope, when calling \code{sage_eval} the default value meaning of bernoulli is used. Likewise for QQ below. sage: bernoulli = lambda x : x^2 sage: bernoulli(6) 36 sage: eval('bernoulli(6)') 36 sage: sage_eval('bernoulli(6)') 1/42 sage: QQ = lambda x : x^2 sage: QQ(2) 4 sage: sage_eval('QQ(2)') 2 sage: parent(sage_eval('QQ(2)')) Rational Field This example illustrates setting a variable for use in evaluation. sage: x = 5 sage: eval('4/3 + x', {'x':25}) 26 sage: sage_eval('4/3 + x', locals={'x':25}) 79/3 This example illustrates how \code{sage_eval} can be useful when evaluating the output of other computer algebra systems. sage: R.<x> = PolynomialRing(RationalField()) sage: gap.eval('R:=PolynomialRing(Rationals,["x"]);') 'PolynomialRing(..., [ x ])' sage: ff = gap.eval('x:=IndeterminatesOfPolynomialRing(R);; f:=x^2+1;'); ff 'x^2+1' sage: sage_eval(ff, locals={'x':x}) x^2 + 1 sage: eval(ff) Traceback (most recent call last): ... RuntimeError: Use ** for exponentiation, not '^', which means xor in Python, and has the wrong precedence. Here you can see eval simply will not work but \code{sage_eval} will. """ if not isinstance(source, basestring): raise TypeError, "source must be a string." import sage.all p = preparse(source) try: return eval(p, sage.all.__dict__, locals) except SyntaxError, msg: raise SyntaxError, "%s\nError using SAGE to evaluate '%s'"%(msg, p) | 1b4ae08b7fd14b38a52e7d5db5cbe13f4bdbe525 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/1b4ae08b7fd14b38a52e7d5db5cbe13f4bdbe525/sage_eval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
410,
67,
8622,
12,
3168,
16,
8985,
12938,
4672,
436,
8395,
24850,
279,
521,
55,
2833,
733,
628,
326,
810,
533,
635,
5956,
518,
1450,
348,
2833,
18,
225,
1220,
4696,
4440,
5302,
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,
272,
410,
67,
8622,
12,
3168,
16,
8985,
12938,
4672,
436,
8395,
24850,
279,
521,
55,
2833,
733,
628,
326,
810,
533,
635,
5956,
518,
1450,
348,
2833,
18,
225,
1220,
4696,
4440,
5302,
18... |
elif input.text.startswith('/') and ' ' not in input.text: | elif text.startswith('/'): | def get_completer_for(window): input = window.input left, right = input.text[:input.cursor], input.text[input.cursor:] text = left.split(' ')[-1] while True: suffix = '' if text and text[0] in window.network.isupport.get('CHANTYPES', '#&+'): candidates = channel_completer(window, left, right, text) elif input.text.startswith('/reload '): candidates = script_completer(window, left, right, text) elif input.text.startswith('/edit '): candidates = script_completer(window, left, right, text) elif input.text.startswith('/server '): candidates = network_completer(window, left, right, text) elif input.text.startswith('/') and ' ' not in input.text: candidates = command_completer(window, left, right, text) suffix = ' ' else: candidates = nick_completer(window, left, right, text) if left == text: suffix = ': ' else: suffix = ' ' if text: before = left[:-len(text)] else: before = left insert_text = '%s%s%s%s' % (before, '%s', suffix, right) cursor_pos = len(before + suffix) original = window.input.text, window.input.cursor for cand in candidates: if cand.lower().startswith(text.lower()): window.input.text, window.input.cursor = insert_text % cand, cursor_pos + len(cand) yield None window.input.text, window.input.cursor = original yield None | b111984c9bd1e3663026d3cc45610b20d84896ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/b111984c9bd1e3663026d3cc45610b20d84896ed/completion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
832,
17754,
67,
1884,
12,
5668,
4672,
810,
273,
2742,
18,
2630,
225,
2002,
16,
2145,
273,
810,
18,
955,
10531,
2630,
18,
9216,
6487,
810,
18,
955,
63,
2630,
18,
9216,
26894,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
832,
17754,
67,
1884,
12,
5668,
4672,
810,
273,
2742,
18,
2630,
225,
2002,
16,
2145,
273,
810,
18,
955,
10531,
2630,
18,
9216,
6487,
810,
18,
955,
63,
2630,
18,
9216,
26894,
... |
return [('gtkspell',not gtkspell is None)] | return [('gtkspell',not gtkspell is None)] | def check_dependencies(klass): return [('gtkspell',not gtkspell is None)] | a814e90941387bfde1586d081690a8ee36b7c460 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4103/a814e90941387bfde1586d081690a8ee36b7c460/spell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
11037,
12,
22626,
4672,
327,
306,
2668,
4521,
79,
1752,
1165,
2187,
902,
22718,
1752,
1165,
353,
599,
25887,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
866,
67,
11037,
12,
22626,
4672,
327,
306,
2668,
4521,
79,
1752,
1165,
2187,
902,
22718,
1752,
1165,
353,
599,
25887,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
inc(r['type'], typetotals) inc(r['subj'], subjtotals) | type = r['type'] if type == '': type = '[no type]' subj = r['subj'] if type not in typetotals: typetotals[type] = len(r['records']) else: typetotals[type] += len(r['records']) if subj not in subjtotals: subjtotals[subj] = len(r['records']) else: subjtotals[subj] += len(r['records']) | def inc(var, dict): if var in dict: dict[var] += 1 else: dict[var] = 1 | 87cab1882ebddf3ad47a4249bd5b2a75fabd3742 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8937/87cab1882ebddf3ad47a4249bd5b2a75fabd3742/worldcat2olac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7290,
12,
1401,
16,
2065,
4672,
309,
569,
316,
2065,
30,
2065,
63,
1401,
65,
1011,
404,
469,
30,
2065,
63,
1401,
65,
273,
404,
2,
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,
7290,
12,
1401,
16,
2065,
4672,
309,
569,
316,
2065,
30,
2065,
63,
1401,
65,
1011,
404,
469,
30,
2065,
63,
1401,
65,
273,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.tree.SetItemText(self.tree.GetSelection(), name) | self.tree.SetItemText(self.tree.GetSelection(), DV.l(name, warn=False)) | def onPrefChange(self, event): Damnlog('Preference changed event caught.') name = None for i in self.controls.iterkeys(): pref = self.splitLongPref(i) prefname = pref[1] if pref[0][0:16] == 'damnvid-profile-': genericpref = pref[0][0:15] else: genericpref = pref[0] genericpref += ':' + pref[1] val = None if type(DV.preferences[genericpref]['kind']) is type({}) or (DV.preferences[genericpref]['kind'][0:3] == 'int' and DV.preferences[genericpref]['kind'][0:4] != 'int:'): if DV.preferences[genericpref]['strict']: val = self.controls[i].GetSelection() if val: val = DV.preferences[genericpref]['order'][val - 1] else: val = '' else: val = self.controls[i].GetValue() if val == self.defaultvalue or val == '(default)': val = '' elif type(DV.preferences[genericpref]['kind']) is type({}) and val in DV.preferences[genericpref]['kind'].values(): for j in DV.preferences[genericpref]['kind'].iterkeys(): if val == DV.preferences[genericpref]['kind'][j]: val = j elif DV.preferences[genericpref]['kind'] == 'profile': val = self.controls[i].GetSelection() - 1 elif DV.preferences[genericpref]['kind'] == 'locale': val = self.controls[i].GetString(self.controls[i].GetSelection()) for loc in DV.languages.iterkeys(): if DV.languages[loc]['title'] == val: val = loc break elif DV.preferences[genericpref]['kind'][0:4] == 'int:': val = int(self.controls[i].GetValue()) elif DV.preferences[genericpref]['kind'][0] == '%': val = float(float(self.controls[i].GetValue())*float(int(DV.preferences[genericpref]['kind'][1:])) / 100.0) elif DV.preferences[genericpref]['kind'] == 'dir' or DV.preferences[genericpref]['kind'] == 'text': val = self.controls[i].GetValue() if genericpref == 'damnvid-profile:name': name = val elif DV.preferences[genericpref]['kind'] == 'bool': val = self.controls[i].IsChecked() # The str() representation takes care of True/False if val is not None: DV.prefs.sets(self.pane, prefname, DamnUnicode(val)) if name != None and self.tree.GetSelection() != self.treeroot and self.tree.GetItemParent(self.tree.GetSelection()) == self.profileroot: self.tree.SetItemText(self.tree.GetSelection(), name) self.prefpanelabel.SetLabel(name) | 04f97bdc224c0fd7eea4f0478c1b41aff4d050be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11142/04f97bdc224c0fd7eea4f0478c1b41aff4d050be/DamnVid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
23218,
3043,
12,
2890,
16,
871,
4672,
463,
301,
82,
1330,
2668,
9624,
3550,
871,
13537,
1093,
13,
508,
273,
599,
364,
277,
316,
365,
18,
24350,
18,
2165,
2452,
13332,
11307,
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,
603,
23218,
3043,
12,
2890,
16,
871,
4672,
463,
301,
82,
1330,
2668,
9624,
3550,
871,
13537,
1093,
13,
508,
273,
599,
364,
277,
316,
365,
18,
24350,
18,
2165,
2452,
13332,
11307,
273,
... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 941) else quickfix.StringField.__init__(self, 941, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
9803,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
9803,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
def verifyRpm(filename, verify, strict, payload, nodigest, small): | def verifyRpm(filename, verify, strict, payload, nodigest, hdrtags, keepdata): | def verifyRpm(filename, verify, strict, payload, nodigest, small): """Read in a complete rpm and verify its integrity.""" rpm = ReadRpm(filename, verify, strict=strict, nodigest=nodigest) keepdata = 1 hdrtags = rpmtag if nodigest == 1: keepdata = 0 if verify == 0: if small: for i in importanttags.keys(): value = rpmtag[i] importanttags[i] = value importanttags[value[0]] = value hdrtags = importanttags if rpm.readHeader(rpmsigtag, hdrtags, keepdata): return None if payload: rpm.readPayload(rpm.verifyCpio) rpm.closeFd() return rpm | c29b9b2e4992af6d2d2e055a6abeb64c05ab291e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/c29b9b2e4992af6d2d2e055a6abeb64c05ab291e/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
54,
7755,
12,
3459,
16,
3929,
16,
5490,
16,
2385,
16,
14003,
360,
395,
16,
7723,
4156,
16,
3455,
892,
4672,
3536,
1994,
316,
279,
3912,
25228,
471,
3929,
2097,
24425,
12123,
25228,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3929,
54,
7755,
12,
3459,
16,
3929,
16,
5490,
16,
2385,
16,
14003,
360,
395,
16,
7723,
4156,
16,
3455,
892,
4672,
3536,
1994,
316,
279,
3912,
25228,
471,
3929,
2097,
24425,
12123,
25228,... |
stageSummary = 'using %s with scale=%.2f' % (filename, flatscaling) | stageSummary = 'using %s with scale=%.2f' % (filename, illumscaling) | def IlluminationCorrection(exposure, illum, policy, stageSig = ipIsr.ISR_ILLUM, stageName = 'lsst.ip.isr.illuminationcorrection'): # common input test metadata = exposure.getMetadata() if chunkMetadata.exists(stageSig): pexLog.Trace(stageName, 4, '%s has already been run' % (stageSig)) return imetadata = illum.getMetadata() filenameKeyword = policy.getString('filenameKeyword') filename = imetadata(filenameKeyword) scalingKeyword = policy.getString('illumScaleKeyword') # e.g. MEAN illumscaling = dmetadata.getDouble(scalingKeyword) mi = exposure.getMaskedImage() #imi = afwImage.MaskedImageF(illum.getMaskedImage(), True) #if illumscaling != 1.: # imi /= illumscaling #mi /= imi mi.scaledDivides(1./illumscaling, illum.getMaskedImage()) # common outputs stageSummary = 'using %s with scale=%.2f' % (filename, flatscaling) pexLog.Trace(stageName, 4, '%s %s' % (stageSig, stageSummary)) metadata.setString(stageSig, '%s; %s' % (stageSummary, time.asctime())) | 9178ba52aa57399136f285c8a065b1707c990801 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6526/9178ba52aa57399136f285c8a065b1707c990801/IsrStages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
467,
13376,
1735,
20884,
12,
22739,
16,
277,
13376,
16,
3329,
16,
6009,
8267,
225,
273,
2359,
2520,
86,
18,
5127,
54,
67,
15125,
2799,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
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,
467,
13376,
1735,
20884,
12,
22739,
16,
277,
13376,
16,
3329,
16,
6009,
8267,
225,
273,
2359,
2520,
86,
18,
5127,
54,
67,
15125,
2799,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
18,
... |
__builtin__.credits = _Printer("credits", "Python development is led by BeOpen PythonLabs (www.pythonlabs.com).") | if sys.platform[:4] == 'java': __builtin__.credits = _Printer( "credits", "Jython is maintained by the Jython developers (www.jython.org).") else: __builtin__.credits = _Printer("credits", """\ Thanks to CWI, CNRI, BeOpen.com, Digital Creations and a cast of thousands for supporting Python development. See www.python.org for more information.""") | def __call__(self): self.__setup() prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q'): key = None if key == 'q': break | c95df656f022e3accdb0e586ac317c4f97965d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c95df656f022e3accdb0e586ac317c4f97965d5e/site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
365,
16186,
8401,
1435,
6866,
273,
296,
13616,
2000,
364,
1898,
16,
578,
1043,
261,
464,
2000,
13,
358,
9706,
30,
296,
7586,
273,
374,
1323,
404,
30,
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,
1001,
1991,
972,
12,
2890,
4672,
365,
16186,
8401,
1435,
6866,
273,
296,
13616,
2000,
364,
1898,
16,
578,
1043,
261,
464,
2000,
13,
358,
9706,
30,
296,
7586,
273,
374,
1323,
404,
30,
7... |
content = unicode(content) | content = _xmlprep(unicode(content, errors='replace')).encode("utf8") | def ofdb_url_get(url, data = None, as_post = False): (rc, content) = _myth_url_get(url, data, as_post) m = re.search(r'<\s*meta[^>]*charset\s*=\s*([^" ]+)', content, re.I) if m: charset = m.group(1) debug_out("Page charset reported as %s" % (charset)) content = unicode(content, charset) else: # hope it is ascii content = unicode(content) response_out(content) return (rc, content) | 5b17f44af5433ea865afaa08492738ac79b1b9e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13713/5b17f44af5433ea865afaa08492738ac79b1b9e9/ofdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
434,
1966,
67,
718,
67,
588,
12,
718,
16,
501,
273,
599,
16,
487,
67,
2767,
273,
1083,
4672,
261,
1310,
16,
913,
13,
273,
389,
4811,
451,
67,
718,
67,
588,
12,
718,
16,
501,
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,
434,
1966,
67,
718,
67,
588,
12,
718,
16,
501,
273,
599,
16,
487,
67,
2767,
273,
1083,
4672,
261,
1310,
16,
913,
13,
273,
389,
4811,
451,
67,
718,
67,
588,
12,
718,
16,
501,
16,
... |
patterns = [p for p in patterns if glob_matches_files(path + p)] | patterns = [p for p in patterns if glob_matches_files(path, p)] | def glob_matches_files(path): result = self.run("ls \"%s\"" % utils.sh_escape(path), ignore_status=True) return result.exit_status == 0 | 3224c2001b763d14722a89ae85fc6ae9c44bcae5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/3224c2001b763d14722a89ae85fc6ae9c44bcae5/abstract_ssh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4715,
67,
8436,
67,
2354,
12,
803,
4672,
563,
273,
365,
18,
2681,
2932,
3251,
22049,
87,
8530,
738,
2990,
18,
674,
67,
6939,
12,
803,
3631,
2305,
67,
2327,
33,
5510,
13,
327,
563,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4715,
67,
8436,
67,
2354,
12,
803,
4672,
563,
273,
365,
18,
2681,
2932,
3251,
22049,
87,
8530,
738,
2990,
18,
674,
67,
6939,
12,
803,
3631,
2305,
67,
2327,
33,
5510,
13,
327,
563,
18... |
elif value is not None and isinstance(prop, hyperdb.Number): setattr(row, key, int(value)) | elif isinstance(prop, hyperdb.Number): if value is None: value = 0 try: v = int(value) except ValueError: raise TypeError, "%s (%s) is not numeric" % (key, repr(value)) setattr(row, key, v) | def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb.DatabaseError, 'Database open read-only' view = self.getview(1) # node must exist & not be retired id = int(nodeid) ndx = view.find(id=id) if ndx < 0: raise IndexError, "%s has no node %s" % (self.classname, nodeid) row = view[ndx] if row._isdel: raise IndexError, "%s has no node %s" % (self.classname, nodeid) oldnode = self.uncommitted.setdefault(id, {}) changes = {} | abbc2c6f076f533f0b88cea6324a837392869dc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/abbc2c6f076f533f0b88cea6324a837392869dc1/back_metakit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
756,
350,
16,
2826,
5986,
2372,
4672,
353,
2704,
273,
374,
309,
2270,
2372,
18,
5332,
67,
856,
2668,
7,
5127,
12917,
11,
4672,
353,
2704,
273,
404,
1464,
2270,
2372,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
756,
350,
16,
2826,
5986,
2372,
4672,
353,
2704,
273,
374,
309,
2270,
2372,
18,
5332,
67,
856,
2668,
7,
5127,
12917,
11,
4672,
353,
2704,
273,
404,
1464,
2270,
2372,... |
Abelian variety factor of dimension 2 of J0(33) | Simple abelian subvariety 11a(3,33) of dimension 1 of J0(33) | def modular_symbols(self, sign=0): """ Return space of modular symbols (with given sign) associated to this modular abelian variety, if it can be found by cutting down using Hecke operators. Otherwise raise a RuntimeError exception. | 231a556974015ed454b20c5783447e82495d8183 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/231a556974015ed454b20c5783447e82495d8183/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
681,
2490,
67,
15536,
12,
2890,
16,
1573,
33,
20,
4672,
3536,
2000,
3476,
434,
681,
2490,
7963,
261,
1918,
864,
1573,
13,
3627,
358,
333,
681,
2490,
1223,
292,
2779,
1394,
14369,
16,
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,
681,
2490,
67,
15536,
12,
2890,
16,
1573,
33,
20,
4672,
3536,
2000,
3476,
434,
681,
2490,
7963,
261,
1918,
864,
1573,
13,
3627,
358,
333,
681,
2490,
1223,
292,
2779,
1394,
14369,
16,
3... |
('Paste', wxID_EDITPASTE)): tpe, key = PrefsKeys.keyDefs[name] | ('Paste', wxID_EDITPASTE), ('MoveLeft', wxID_EDITMOVELEFT), ('MoveRight', wxID_EDITMOVERIGHT), ('MoveUp', wxID_EDITMOVEUP), ('MoveDown', wxID_EDITMOVEDOWN), ('WidthInc', wxID_EDITWIDTHINC), ('WidthDec', wxID_EDITWIDTHDEC), ('HeightInc', wxID_EDITHEIGHTINC), ('HeightDec', wxID_EDITHEIGHTDEC), ): tpe, key, code = PrefsKeys.keyDefs[name] | def __init__(self, parent, inspector, model, compPal, companionClass, dataView): args = self.setupArgs(model.main, model.mainConstr.params, ['parent', 'id'], parent, companionClass) wxFrame.__init__(self, parent, -1, args['title'], args['pos'], args['size'])#, args['style'], args['name']) InspectableObjectCollectionView.__init__(self, inspector, model, compPal) | 2409984574299440bdc4e3c954b3574ca35f84c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2409984574299440bdc4e3c954b3574ca35f84c5/Designer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
22700,
16,
938,
16,
1161,
14320,
16,
1161,
304,
285,
797,
16,
501,
1767,
4672,
833,
273,
365,
18,
8401,
2615,
12,
2284,
18,
5254,
16,
938,
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,
1001,
2738,
972,
12,
2890,
16,
982,
16,
22700,
16,
938,
16,
1161,
14320,
16,
1161,
304,
285,
797,
16,
501,
1767,
4672,
833,
273,
365,
18,
8401,
2615,
12,
2284,
18,
5254,
16,
938,
18,... |
self.opendb('admin') file = self.db.file mime_type = file.get(nodeid, 'type') content = file.get(nodeid, 'content') lmt = file.get(nodeid, 'activity').timestamp() | if not pops.has_key('content'): raise NotFound, designator mime_type = klass.get(nodeid, 'type') content = klass.get(nodeid, 'content') lmt = klass.get(nodeid, 'activity').timestamp() | def serve_file(self, designator, dre=re.compile(r'([^\d]+)(\d+)')): ''' Serve the file from the content property of the designated item. ''' m = dre.match(str(designator)) if not m: raise NotFound, str(designator) classname, nodeid = m.group(1), m.group(2) if classname != 'file': raise NotFound, designator | 2f6b05e7d229b44e95d3fddb3c5e8e60912dfa5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/2f6b05e7d229b44e95d3fddb3c5e8e60912dfa5b/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12175,
67,
768,
12,
2890,
16,
8281,
639,
16,
302,
266,
33,
266,
18,
11100,
12,
86,
11,
19042,
72,
7941,
4713,
72,
29169,
3719,
30,
9163,
11115,
326,
585,
628,
326,
913,
1272,
434,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12175,
67,
768,
12,
2890,
16,
8281,
639,
16,
302,
266,
33,
266,
18,
11100,
12,
86,
11,
19042,
72,
7941,
4713,
72,
29169,
3719,
30,
9163,
11115,
326,
585,
628,
326,
913,
1272,
434,
32... |
try: color = self._colors[classification_state] except KeyError: color = wxColor(200, 200, 200) | color = self._colors[classification_state] | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 693f257b0d1dc3ae158e5b60409e58362344ebe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/693f257b0d1dc3ae158e5b60409e58362344ebe5/gamera_display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
12,
2890,
16,
3068,
16,
1604,
16,
6744,
16,
4917,
16,
1027,
16,
645,
16,
20956,
4672,
1476,
67,
1937,
273,
3068,
18,
967,
1767,
1685,
1435,
1476,
67,
7705,
273,
3068,
18,
967,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10184,
12,
2890,
16,
3068,
16,
1604,
16,
6744,
16,
4917,
16,
1027,
16,
645,
16,
20956,
4672,
1476,
67,
1937,
273,
3068,
18,
967,
1767,
1685,
1435,
1476,
67,
7705,
273,
3068,
18,
967,
... |
"%Y/%m/%d %H:%M:%S") | "%Y/%m/%d %H:%M:%S")[:6]) | def read_dagman_out(self, dagman_out_fileobj): """ Parse .dag.dagman.out file and update the status of each node. """ c = self.conn.cursor() | ad06544ea40fb6525fc2d835942023fdc29a1f5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/ad06544ea40fb6525fc2d835942023fdc29a1f5d/dagmanutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
30204,
4728,
67,
659,
12,
2890,
16,
22940,
4728,
67,
659,
67,
768,
2603,
4672,
3536,
2884,
263,
30204,
18,
30204,
4728,
18,
659,
585,
471,
1089,
326,
1267,
434,
1517,
756,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
30204,
4728,
67,
659,
12,
2890,
16,
22940,
4728,
67,
659,
67,
768,
2603,
4672,
3536,
2884,
263,
30204,
18,
30204,
4728,
18,
659,
585,
471,
1089,
326,
1267,
434,
1517,
756,
18,... |
decompressed_file.write(compressed_file.read()) | decompressed_file.write(data_arch.read(file_name)) | def _pymw_worker_manager(func_name_to_call, options): global _res_array _res_array = [] try: # Redirect stdout and stderr old_stdout = sys.stdout old_stderr = sys.stderr sys.stdout = cStringIO.StringIO() sys.stderr = cStringIO.StringIO() # If there is a zip file, unzip the contents if "arch_file" in options: data_arch = zipfile.PyZipFile(options["arch_file"]) archive_files = data_arch.namelist() for file_name in archive_files: compressed_file = data_arch.open(file_name) decompressed_file = open(file_name, "w") decompressed_file.write(compressed_file.read()) decompressed_file.close() data_arch.close() # Call the worker function pymw_worker_func(func_name_to_call, options) # Get any stdout/stderr printed during the worker execution out_str = sys.stdout.getvalue() err_str = sys.stderr.getvalue() sys.stdout.close() sys.stderr.close() # Revert stdout/stderr to originals sys.stdout = old_stdout sys.stderr = old_stderr # The interface is responsible for cleanup, so don't bother deleting the archive files # TODO: modify this to deal with other options (multiple results, etc) pymw_worker_write([_res_array[0], out_str, err_str], options) except Exception, e: sys.stdout = old_stdout sys.stderr = old_stderr exit(e) | 6635b06114059bf64ca43848d68413756e5a4ac4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8868/6635b06114059bf64ca43848d68413756e5a4ac4/pymw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2074,
81,
91,
67,
10124,
67,
4181,
12,
644,
67,
529,
67,
869,
67,
1991,
16,
702,
4672,
2552,
389,
455,
67,
1126,
389,
455,
67,
1126,
273,
5378,
775,
30,
468,
9942,
3909,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2074,
81,
91,
67,
10124,
67,
4181,
12,
644,
67,
529,
67,
869,
67,
1991,
16,
702,
4672,
2552,
389,
455,
67,
1126,
389,
455,
67,
1126,
273,
5378,
775,
30,
468,
9942,
3909,
471,
... |
self.literal_whitespace -= 1 del self.body[-1] self.body.append('}\n') def visit_line(self, node): self._line_start = len(self.body) def depart_line(self, node): if self._line_start == len(self.body): self.body.append('~') if self.table is not None: self.body.append('\\newline\n') else: self.body.append('\\\\\n') | self.body.append('\\end{DUlineblock}\n') | def depart_line_block(self, node): self.literal_whitespace -= 1 # remove the last \\ del self.body[-1] self.body.append('}\n') | dd0771cf885ff09f6722b0a4a2e7678eb07e67de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/dd0771cf885ff09f6722b0a4a2e7678eb07e67de/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
1369,
67,
2629,
12,
2890,
16,
756,
4672,
365,
18,
13107,
67,
18777,
3947,
404,
468,
1206,
326,
1142,
1736,
1464,
365,
18,
3432,
18919,
21,
65,
365,
18,
3432,
18,
6923,
2668,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
1369,
67,
2629,
12,
2890,
16,
756,
4672,
365,
18,
13107,
67,
18777,
3947,
404,
468,
1206,
326,
1142,
1736,
1464,
365,
18,
3432,
18919,
21,
65,
365,
18,
3432,
18,
6923,
2668,... |
_table = 'hr_timesheet_sheet_sheet' | def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context is None: context = {} if context.has_key('portal_gantt') and context['portal_gantt'] == 'planning' and context.has_key('active_id') and context['active_id']: cr.execute("""select rp.id from report_account_analytic_planning rp \ where rp.id in (select planning_id from project_task where project_id in (select id from project_project where id = %s))""" %(context['active_id'])) return map(lambda x: x[0], cr.fetchall()) return super(report_account_analytic_planning, self).search(cr, uid, args, offset, limit, order, context, count) | 2adf2a9777e63a6e4607fd01ba98c12072e53bbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/2adf2a9777e63a6e4607fd01ba98c12072e53bbe/portal_project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
4555,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
309,
819,
353,
599,
30,
819,
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,
1623,
12,
2890,
16,
4422,
16,
4555,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
309,
819,
353,
599,
30,
819,
273... | |
self.fill("yield") | self.write("(") self.write("yield") | def _Yield(self, t): self.fill("yield") if t.value: self.write(" (") self.dispatch(t.value) self.write(")") | cb0813c7fd0cbadb8e73d810beafa8afbceafda7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/cb0813c7fd0cbadb8e73d810beafa8afbceafda7/unparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16348,
12,
2890,
16,
268,
4672,
365,
18,
2626,
2932,
2932,
13,
365,
18,
2626,
2932,
23604,
7923,
309,
268,
18,
1132,
30,
365,
18,
2626,
2932,
7566,
13,
365,
18,
10739,
12,
88,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
16348,
12,
2890,
16,
268,
4672,
365,
18,
2626,
2932,
2932,
13,
365,
18,
2626,
2932,
23604,
7923,
309,
268,
18,
1132,
30,
365,
18,
2626,
2932,
7566,
13,
365,
18,
10739,
12,
88,
1... |
row.extend(header[base_x:]) | if not a.is_blocked(): row.extend(header[base_x:]) else: row.extend([''] * len(header[base_x:])) | def pdf(request, group, list, is_admin=False): """PDF version of list""" # Get accounts to show if list.accounts.all().count(): accounts = list.accounts.all() else: accounts = group.user_account_set.filter(active=True) # Create response filename = '%s-%s-%s' % (date.today(), group, list) response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' % slugify(filename) margin = 0.5*cm font_name = 'Times-Roman' font_name_bold = 'Times-Bold' font_size = 14 font_size_name = font_size - 2 font_size_short_name = font_size - 2 font_size_balance = font_size_name - 2 font_size_min = 5 head_height = 30 # pt foot_height = 15 # pt logo_height = 25 # pt blacklisted_color = Color(0,0,0) blacklisted_text_color = Color(0.63,0,0) even_color = Color(1,1,1) odd_color = Color(0.97,0.97,0.97) faint_color = Color(0.70, 0.70, 0.70) alternate_colors = [even_color, odd_color] if list.orientation == list.LANDSCAPE: height, width = A4 else: width, height = A4 # Create canvas for page and set fonts p = canvas.Canvas(response, (width,height)) if group.logo: # Find scaling ratio ratio = group.logo.width / group.logo.height # Load logo with correct scaling logo = Image(group.logo.path, width=logo_height*ratio, height=logo_height) # Draw on first page logo.drawOn(p, width - margin - logo_height*ratio, height - margin - logo_height) # Setup rest of header p.setFont(font_name, font_size) p.drawString(margin, height - margin - font_size, u'%s: %s' % (group, list.name)) p.setFont(font_name, font_size - 4) p.drawString(margin, height - margin - font_size - font_size + 2, u'%s: %s' % (_('Printed'), str(date.today()))) footer = [] if group.email: footer.append(group.email) if list.comment.strip(): footer.append(list.comment.replace('\n', ' ').replace('\r', ' ')) p.drawString(margin, margin, u' - '.join(footer)) blacklisted_note = _(u'Blacklisted accounts are marked with: ') p.drawString(width - margin - 10 - p.stringWidth(blacklisted_note, font_name, font_size - 4), margin, blacklisted_note) p.rect(width - margin - 10, margin, 8, 8, fill=1, stroke=0) p.setFont(font_name, font_size) if not accounts: no_accounts_message = _(u"Sorry, this list is empty.") p.drawString(margin, height - font_size - margin - head_height, no_accounts_message) p.save() return response # Store col widths col_width = [] header = [] if list.account_width: col_width.append(list.account_width) header.append(_(u'Name')) if list.short_name_width: col_width.append(list.short_name_width) header.append('') if list.balance_width: header.append(_(u'Balance')) col_width.append(list.balance_width) if list.short_name_width and list.account_width: GRID_STYLE.add('SPAN', (0,0), (1,0)) base_x = len(header) for c in list.column_set.all(): header.append(c.name) col_width.append(c.width) # Calculate relative col widths over to absolute points for i,w in enumerate(col_width): col_width[i] = float(w) / float((list.listcolumn_width or 0) + list.balance_width + (list.account_width or 0) + (list.short_name_width or 0)) * (width-2*margin) # Intialise table with header data = [header] for i,a in enumerate(accounts): color = alternate_colors[(i+1)%2] if list.double: i *= 2 extra_row_height = 1 else: extra_row_height = 0 i += 1 GRID_STYLE.add('BACKGROUND', (0,i), (-1,i+extra_row_height), color) if a.is_blocked(): if list.balance_width: GRID_STYLE.add('TEXTCOLOR', (1,i), (1,i), blacklisted_text_color) GRID_STYLE.add('BACKGROUND', (base_x+1,i), (-1,i+extra_row_height), blacklisted_color) row = [] if list.account_width: row.append(a.name) # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(row[-1], font_name, font_size_name) + 12 and font_size_name > font_size_min: font_size_name -= 1 if list.short_name_width: row.append(a.short_name or u'') # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(row[-1], font_name, font_size_name) + 12 and font_size_short_name > font_size_min: font_size_short_name -= 1 if list.balance_width: row.append('%d' % a.user_balance()) if a.needs_warning(): GRID_STYLE.add('FONTNAME', (0,i), (base_x-1,i), font_name_bold) # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(str(row[-1]), font_name, font_size_balance) + 12 and font_size_balance > font_size_min: font_size_balance -= 1 row.extend(header[base_x:]) data.append(row) if list.double: data.append([''] * len(row)) GRID_STYLE.add('SPAN', (0,i), (0,i+extra_row_height)) if list.balance_width: GRID_STYLE.add('SPAN', (1,i), (1,i+extra_row_height)) # Set font size for names GRID_STYLE.add('FONTSIZE', (0,1), (0,-1), font_size_name) GRID_STYLE.add('ALIGN', (0,0), (-1,-1), 'LEFT') GRID_STYLE.add('FONTNAME', (0,0), (-1,0), font_name_bold) # Set font size for balance if list.balance_width: GRID_STYLE.add('FONTSIZE', (base_x-1,1), (base_x-1,-1), font_size_balance) GRID_STYLE.add('ALIGN', (base_x-1,1), (base_x-1,-1), 'RIGHT') GRID_STYLE.add('TEXTCOLOR', (base_x,1), (-1,-1), faint_color) if list.double: if list.balance_width: GRID_STYLE.add('TOPPADDING', (2,1), (-1,-1), 0) GRID_STYLE.add('BOTTOMPADDING', (2,1), (-1,-1), 0) else: GRID_STYLE.add('TOPPADDING', (1,1), (-1,-1), 0) GRID_STYLE.add('BOTTOMPADDING', (1,1), (-1,-1), 0) GRID_STYLE.add('VALIGN', (0,1), (-1,-1), 'TOP') # Create table t = Table(data, colWidths=col_width, style=GRID_STYLE, repeatRows=1) rest = None while t: # Figure out how big table will be t_width, t_height = t.wrapOn(p, width-2*margin,height-margin-head_height-foot_height) if not rest and t_height > height - 2*margin - head_height: t,rest = t.split(width-2*margin, height - margin - head_height-foot_height) continue # Draw on canvas t.drawOn(p, margin, height - t_height - margin - head_height) if rest: # FIXME indicate print time etc on second page (also page count) # set t to the second table and reset rest t, rest= (rest, None) # Show new page p.showPage() # Remove header spacing head_height = 0 else: # Leave loop break p.save() return response | 73759a97e93c4dd3b3fd8283776ad2f199233efb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12178/73759a97e93c4dd3b3fd8283776ad2f199233efb/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8169,
12,
2293,
16,
1041,
16,
666,
16,
353,
67,
3666,
33,
8381,
4672,
3536,
17508,
1177,
434,
666,
8395,
225,
468,
968,
9484,
358,
2405,
309,
666,
18,
13739,
18,
454,
7675,
1883,
13332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8169,
12,
2293,
16,
1041,
16,
666,
16,
353,
67,
3666,
33,
8381,
4672,
3536,
17508,
1177,
434,
666,
8395,
225,
468,
968,
9484,
358,
2405,
309,
666,
18,
13739,
18,
454,
7675,
1883,
13332... |
req = "%s AND AncestorDepth IN (%s);" % (req,intListToString(depths)) res = self.db._query(req,connection) | req = "%s AND AncestorDepth IN (%s);" % ( req, intListToString( depths ) ) res = self.db._query( req, connection ) | def _getFileDecendents(self,fileIDs,depths,connection=False): connection = self._getConnection(connection) req = "SELECT AncestorID,FileID,AncestorDepth FROM FC_FileAncestors WHERE AncestorID IN (%s)" % intListToString(fileIDs) if depths: req = "%s AND AncestorDepth IN (%s);" % (req,intListToString(depths)) res = self.db._query(req,connection) if not res['OK']: return res fileIDAncestors = {} for ancestorID,fileID,depth in res['Value']: if not fileIDAncestors.has_key(ancestorID): fileIDAncestors[ancestorID] = {} fileIDAncestors[ancestorID][fileID] = depth return S_OK(fileIDAncestors) | 26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29925,
1799,
409,
4877,
12,
2890,
16,
768,
5103,
16,
5979,
87,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
1111,
273,
315,
4803,
1922,
7248,
734,
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,
29925,
1799,
409,
4877,
12,
2890,
16,
768,
5103,
16,
5979,
87,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
1111,
273,
315,
4803,
1922,
7248,
734,
16,
... |
dirtyBlocks = [self.UIRepositoryView.findUUID(theUUID) for theUUID in Block.dirtyBlocks] | dirtyBlocks = [view[theUUID] for theUUID in Block.dirtyBlocks] | def propagateAsynchronousNotifications(self): | dc0b91cd37f7100fa25be7d931729ba9e70e4a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/dc0b91cd37f7100fa25be7d931729ba9e70e4a43/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13551,
1463,
7121,
14111,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13551,
1463,
7121,
14111,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
marker.detach() | marker.detach() | def calcAverageCurves(self): ## ## self.averagingMethod == 'merge': mergedIterations = orngTest.ExperimentResults(1, self.splitByIterations[0].classifierNames, self.splitByIterations[0].classValues, self.splitByIterations[0].weights, classifiers=self.splitByIterations[0].classifiers, loaded=self.splitByIterations[0].loaded) i = 0 for isplit in self.splitByIterations: if self.showIterations[i]: for te in isplit.results: mergedIterations.results.append( te ) i += 1 self.mergedConvexHullData = [] if len(mergedIterations.results) > 0: curves = self.computeCurve(mergedIterations, self.targetClass, 1) convexCurves = self.computeCurve(mergedIterations, self.targetClass, 0) classifier = 0 for c in curves: x = [px for (px, py, pf) in c] y = [py for (px, py, pf) in c] self.mergedCKeys[classifier].setData(x, y) | 1832fe731d06d489aaa3db4d1ce896cbc0b56df2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/1832fe731d06d489aaa3db4d1ce896cbc0b56df2/OWROC.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
17115,
2408,
3324,
12,
2890,
4672,
7541,
7541,
365,
18,
21851,
5755,
1305,
422,
296,
2702,
4278,
5384,
21213,
273,
578,
3368,
4709,
18,
22338,
3447,
12,
21,
16,
365,
18,
4939,
858,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7029,
17115,
2408,
3324,
12,
2890,
4672,
7541,
7541,
365,
18,
21851,
5755,
1305,
422,
296,
2702,
4278,
5384,
21213,
273,
578,
3368,
4709,
18,
22338,
3447,
12,
21,
16,
365,
18,
4939,
858,... |
printed_file = '__file__==%r' % expected_file | printed_file = '__file__==%a' % expected_file | def _check_output(self, script_name, exit_code, data, expected_file, expected_argv0, expected_path0, expected_package): if verbose > 1: print("Output from test script %r:" % script_name) print(data) self.assertEqual(exit_code, 0) printed_file = '__file__==%r' % expected_file printed_package = '__package__==%r' % expected_package printed_argv0 = 'sys.argv[0]==%r' % expected_argv0 printed_path0 = 'sys.path[0]==%r' % expected_path0 printed_cwd = 'cwd==%r' % os.getcwd() if verbose > 1: print('Expected output:') print(printed_file) print(printed_package) print(printed_argv0) print(printed_cwd) self.assertIn(printed_file.encode('utf-8'), data) self.assertIn(printed_package.encode('utf-8'), data) self.assertIn(printed_argv0.encode('utf-8'), data) self.assertIn(printed_path0.encode('utf-8'), data) self.assertIn(printed_cwd.encode('utf-8'), data) | 81b0a8387e82360370314f09cc4fce2e86b49b56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/81b0a8387e82360370314f09cc4fce2e86b49b56/test_cmd_line_script.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
2844,
12,
2890,
16,
2728,
67,
529,
16,
2427,
67,
710,
16,
501,
16,
2665,
67,
768,
16,
2665,
67,
19485,
20,
16,
2665,
67,
803,
20,
16,
2665,
67,
5610,
4672,
309,
3988... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
67,
2844,
12,
2890,
16,
2728,
67,
529,
16,
2427,
67,
710,
16,
501,
16,
2665,
67,
768,
16,
2665,
67,
19485,
20,
16,
2665,
67,
803,
20,
16,
2665,
67,
5610,
4672,
309,
3988... |
globals_ = {"__name__" : "__main__"} locals_ = globals_ | import __main__ __main__.__dict__.clear() __main__.__dict__.update({"__name__" : "__main__", "__file__" : filename, "__builtins__": __builtins__, }) | def _runscript(self, filename): # Start with fresh empty copy of globals and locals and tell the script # that it's being run as __main__ to avoid scripts being able to access # the pdb.py namespace. globals_ = {"__name__" : "__main__"} locals_ = globals_ | c3bc7307436ce586ced4c7d9302c5f1d699957bc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/c3bc7307436ce586ced4c7d9302c5f1d699957bc/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
4263,
12,
2890,
16,
1544,
4672,
468,
3603,
598,
12186,
1008,
1610,
434,
10941,
471,
8985,
471,
9276,
326,
2728,
468,
716,
518,
1807,
3832,
1086,
487,
1001,
5254,
972,
358,
454... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
4263,
12,
2890,
16,
1544,
4672,
468,
3603,
598,
12186,
1008,
1610,
434,
10941,
471,
8985,
471,
9276,
326,
2728,
468,
716,
518,
1807,
3832,
1086,
487,
1001,
5254,
972,
358,
454... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.