rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py | ||
stripe = Rect(x, self.y, self.delta, h) | if x + self.delta > self.x + w: w1 = self.x + w - x else: w1 = self.delta stripe = Rect(x, self.y, w1, h) | def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
rmStripe = Rect(self.x + w - self.delta0, self.y, self.delta0, h) | rmStripe = Rect(x, self.y, self.x + w - x, h) | def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py | ||
stripe = Rect(self.x, y, w, self.delta) | if y + self.delta > self.y + w: h1 = self.y + w - y else: h1 = self.delta stripe = Rect(self.x, y, w, h1) | def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
umStripe = Rect(self.x, self.y + w - self.delta0, w, self.delta0) | umStripe = Rect(self.x, self.y + w - self.delta0, w, self.y + h - y) | def makeInnerTiles(self): # inner grid lines group = Group() | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
D = Drawing(450,650) for row in range(5): y = 530 - row*120 | D = Drawing(450, 650) d = 80 s = 60 for row in range(10): y = 530 - row*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
x = 20 + col*120 | x = 20 + col*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
x = 20 + col*120 | x = 20 + col*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
x = 20 + col*120 | x = 20 + col*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
x = 20 + col*120 | x = 20 + col*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
x = 20 + col*120 | x = 20 + col*d | def test(): D = Drawing(450,650) for row in range(5): y = 530 - row*120 if row == 0: for col in range(3): x = 20 + col*120 g = Grid0() g.x = x g.y = y g.useRects = 0 g.useLines = 1 if col == 0: pass elif col == 1: g.delta0 = 10 elif col == 2: g.orientation = 'horizontal' g.demo() D.add(g) elif row == 1: for col in ran... | 7085104ce6ab4adbb19ecef99f88fe6823d23ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/7085104ce6ab4adbb19ecef99f88fe6823d23ca2/grids.py |
canv = self.canv | canv = getattr(self,'canv',None) | def _listCellGeom(self, V,w,s,W=None,H=None): aW = w-s.leftPadding-s.rightPadding t = 0 w = 0 canv = self.canv for v in V: vw, vh = v.wrapOn(canv,aW, 72000) if W is not None: W.append(vw) if H is not None: H.append(vh) w = max(w,vw) t = t + vh + v.getSpaceBefore()+v.getSpaceAfter() return w, t - V[0].getSpaceBefore()-V... | ac08b354dfb430e6d5a38148b8b64404beb88ed6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ac08b354dfb430e6d5a38148b8b64404beb88ed6/tables.py |
fp = open(fileName,'rb') | fp = open(fileName,'rb') | def __init__(self, fileName): if not haveImages: warnOnce('Imaging Library not available, unable to import bitmaps') return #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._transparent = None self._d... | 755ef7ca95e1150cbdee6717356f2e5ed349b76c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/755ef7ca95e1150cbdee6717356f2e5ed349b76c/utils.py |
fp = fileName | fp = fileName | def __init__(self, fileName): if not haveImages: warnOnce('Imaging Library not available, unable to import bitmaps') return #start wih lots of null private fields, to be populated by #the relevant engine. self.fileName = fileName self._image = None self._width = None self._height = None self._transparent = None self._d... | 755ef7ca95e1150cbdee6717356f2e5ed349b76c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/755ef7ca95e1150cbdee6717356f2e5ed349b76c/utils.py |
def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] #this hosed my brain..redo it slowly (AR). #path = list(baseDir and (type(baseDir) not in SeqTypes and [baseDir]... | 116c72c67c6b27f5b1b2eccc3c09ab2c73dbacc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/116c72c67c6b27f5b1b2eccc3c09ab2c73dbacc2/utils.py | ||
path = [baseDir] | if type(baseDir) not in SeqTypes path = [baseDir] else: path = list(baseDir) path = filter(None,basDir) | def recursiveImport(modulename, baseDir=None, noCWD=0, debug=0): """Dynamically imports possible packagized module, or raises ImportError""" import imp parts = string.split(modulename, '.') name = parts[0] #this hosed my brain..redo it slowly (AR). #path = list(baseDir and (type(baseDir) not in SeqTypes and [baseDir]... | 116c72c67c6b27f5b1b2eccc3c09ab2c73dbacc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/116c72c67c6b27f5b1b2eccc3c09ab2c73dbacc2/utils.py |
datafile=qpath+job[:-3]+"sff" | fileext="sff" if os.path.splitext(datafilename)[1].lower()==".cff": fileext="cff" datafile=qpath+job[:-3]+fileext | def removejob(user,jobid,cslist): if (checkconfig() == -1) or (checkfaxuser(user,1) == 0): raise CSConfigError if not listtypes.has_key(cslist) or CheckJobID(jobid)==-1: raise -1 qpath=BuildListPath(cslist,user) job ="" if listtypes[cslist][1]==1: job=user+"-" job=job+listtypes[cslist][0]+"-"+jobid+".txt" #job=prefix... | 3e8516ced1d28098d6a81e516375588e6b019814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2867/3e8516ced1d28098d6a81e516375588e6b019814/capifaxwm.py |
raise CSUserInputError("nvalid input (fax) file") | raise CSUserInputError("Invalid input (fax) file") | def sendfax(user,dialstring,sourcefile,cstarttime="",addressee="",subject="",useprefix=None): if (checkconfig == -1) or (checkfaxuser(user,1) == 0) or (not sourcefile): raise CSConfigError if not dialstring: raise CSUserInputError("empty dialstring") if ((cs_helpers.getOption(CAPI_config,user,"outgoing_MSN","")=="") a... | 7949111017f6ca864cb99138b22c8a0c688c166d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2867/7949111017f6ca864cb99138b22c8a0c688c166d/capifaxwm.py |
self.SaveRankingData() self.LoadRegattaRanking() | pass | def UpdateRegattaRanking(self): self.SaveRankingData() self.LoadRegattaRanking() | 48d330ad5d0c166ff207c0d759fbd7ab4131c638 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/48d330ad5d0c166ff207c0d759fbd7ab4131c638/qtclass.py |
if str(value) == str(self.T_DetailRanking.item(s, 0).text()) and s != pos: return 0 | if self.T_DetailRanking.item(s, 0): newVal = self.T_DetailRanking.item(s, 0).text() if str(value) == str(newVal) and s != pos: return 0 | def ChechForSkipper(self, value, pos): for s in range(0, self.T_DetailRanking.rowCount()): if str(value) == str(self.T_DetailRanking.item(s, 0).text()) and s != pos: return 0 | ae5b281725cc9d00d153f756429775d079535a44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/ae5b281725cc9d00d153f756429775d079535a44/qtclass.py |
Ranks = {} | Ranks = {} risultati = datafile.options('result') if len(risultati) == 0: return | def LoadRegattaRanking(self): try: current_class = str(self.L_Regattas.currentItem().text()) if current_class[-1:] == '*': k = self.ShowQuestionDialog("Save data ?") if k == QtGui.QMessageBox.Yes: self.SaveRankingData(Regatta=current_class[:-1]) else: self.L_Regattas.currentItem().setText(current_class[:-1]) except: pa... | 4a6883fa9bdcd802ecec733f487c07f201fcceed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/4a6883fa9bdcd802ecec733f487c07f201fcceed/qtclass.py |
for c in range(0,len(Ranks[sk])): | lenRanks = len(Ranks[sk]) for c in range(0,lenRanks): | def LoadRegattaRanking(self): try: current_class = str(self.L_Regattas.currentItem().text()) if current_class[-1:] == '*': k = self.ShowQuestionDialog("Save data ?") if k == QtGui.QMessageBox.Yes: self.SaveRankingData(Regatta=current_class[:-1]) else: self.L_Regattas.currentItem().setText(current_class[:-1]) except: pa... | 4a6883fa9bdcd802ecec733f487c07f201fcceed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/4a6883fa9bdcd802ecec733f487c07f201fcceed/qtclass.py |
self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) | def AddRace(self): self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) cols = self.T_DetailRanking.columnCount() if cols == 2: self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) cols += 1 TableHeader=[] for c in range(0, cols -1): TableHeader.append("%s %d"%("Race",(c))) TableHe... | 4a6883fa9bdcd802ecec733f487c07f201fcceed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/4a6883fa9bdcd802ecec733f487c07f201fcceed/qtclass.py | |
self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) | self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount() -1) | def AddRace(self): self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) cols = self.T_DetailRanking.columnCount() if cols == 2: self.T_DetailRanking.insertColumn(self.T_DetailRanking.columnCount()-1) cols += 1 TableHeader=[] for c in range(0, cols -1): TableHeader.append("%s %d"%("Race",(c))) TableHe... | 4a6883fa9bdcd802ecec733f487c07f201fcceed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2446/4a6883fa9bdcd802ecec733f487c07f201fcceed/qtclass.py |
def _element_content(self, element): """ Distill the textual content recursively. Added since I do not know how to use the lib for this. (Tuttle) """ out = "" for child in element.childNodes: if child.nodeType == ELEMENT_NODE: out += self._element_content(child) elif child.nodeType == xml.dom.minidom.Node.TEXT_NODE: o... | def _element_content(self, element): """ Distill the textual content recursively. Added since I do not know how to use the lib for this. (Tuttle) """ | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py | |
print >> sys.stderr, 'Assuming rendered msgid in %s, not included:\n%s\n' % \ (self._curr_fn, element.toprettyxml(' ')) | print >> sys.stderr, 'Assuming rendered msgid in %s, not included:\n %s\n' % \ (self._curr_fn, element.toprettyxml(' ', '\n ')) | def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate') | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
msgid = self._element_content(element) print >> sys.stderr, 'Warning: Literal msgids should be avoided in %s, still adding:\n%s\n' % \ (self._curr_fn, element.toprettyxml(' ')) | msgid = self._make_msgstr(element, shrink = False) print >> sys.stderr, 'Warning: Literal msgids should be avoided in %s, still adding:\n %s\n' % \ (self._curr_fn, element.toprettyxml(' ', '\n ')) | def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate') | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
msgstr = self._make_msgstr(element) | msgstr = self._make_msgstr(element, shrink = True) | def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate') | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
print >> sys.stderr, 'Assuming rendered msgid in %s:\n%s\n' % \ | print >> sys.stderr, 'Assuming rendered msgid in %s, not included:\n%s\n' % \ | def _do_attributes(self, element, domain): rendered = [] if element.hasAttribute('tal:attributes'): attrs = element.getAttribute('tal:attributes').split(';') attrs = [attr.strip() for attr in attrs if attr.strip()] rendered = [attr.split()[0] for attr in attrs] | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
def _make_msgstr(self, element): | def _make_msgstr(self, element, shrink = True): | def _make_msgstr(self, element): node = copy.deepcopy(element) self._make_pretty(node) msgstr = '' for child in node.childNodes: chunk = child.toxml() # XXX Do we need to escape anything else? chunk = chunk.replace('"', '\\"') chunk = ' '.join(chunk.split()) msgstr += chunk + ' ' | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
chunk = ' '.join(chunk.split()) msgstr += chunk + ' ' | if shrink: chunk = ' '.join(chunk.split()) + ' ' msgstr += chunk | def _make_msgstr(self, element): node = copy.deepcopy(element) self._make_pretty(node) msgstr = '' for child in node.childNodes: chunk = child.toxml() # XXX Do we need to escape anything else? chunk = chunk.replace('"', '\\"') chunk = ' '.join(chunk.split()) msgstr += chunk + ' ' | 6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/6aa0b0eb22cae9c13a1af7deee19c79ed20b80d0/catalog.py |
msgstr = msgstr.strip() | lines = msgstr.split("\n") for i in range(len(lines)): lines[i] = ' ' + lines[i].strip() msgstr = ''.join(lines).strip() | def read(self): """Reads in from all given ZPTs and builds up MessageCatalogs accordingly. | 420b7965626388d804af33acc976a2fd3bbb0e06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/420b7965626388d804af33acc976a2fd3bbb0e06/catalog.py |
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate') | 8e6a5c01cded0db142c7abd841f0022b35806c20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/8e6a5c01cded0db142c7abd841f0022b35806c20/catalog.py | ||
if msgid: | else: | def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate') | 8e6a5c01cded0db142c7abd841f0022b35806c20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/8e6a5c01cded0db142c7abd841f0022b35806c20/catalog.py |
attrs['i18n:attributes'].split(';')] | attrs['i18n:attributes'].split(';') if i18nattr] | def _valid_i18ned_attr(attr, attrs): """This returns 1 for attributes attr that are part of attrs and are translated using i18n:attributes. It also returns 1 for any attr that does not exist at all in attrs.""" if attrs.has_key(attr) and _translatable(attrs[attr]): if attrs.has_key('i18n:attributes'): if attrs['i18n:a... | f962a6e83b222e7d30b9b05cee0d5718814e4d34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10323/f962a6e83b222e7d30b9b05cee0d5718814e4d34/untranslated.py |
def merge(self,__loc_data__=None,__conflict_solve=None,**kw): """S.merge(data,conflict,k=v1,k=v2,...) -> merge data and k=v into S. | 2d6ded9f7d7a6d62ac5b460b7428dd8baa77b458 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4224/2d6ded9f7d7a6d62ac5b460b7428dd8baa77b458/Struct.py | ||
for key in data_dict.keys(): | for key in data_dict: | def merge(self,__loc_data__=None,__conflict_solve=None,**kw): """S.merge(data,conflict,k=v1,k=v2,...) -> merge data and k=v into S. | 2d6ded9f7d7a6d62ac5b460b7428dd8baa77b458 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4224/2d6ded9f7d7a6d62ac5b460b7428dd8baa77b458/Struct.py |
origins.append([sx[i]/dar[0], center[1], center[2]]) | origins.append([sx[i], center[1], center[2]]) | def _add_slices(self, item, sgrid, contours=False): cvector = item.get('cvector') center = sgrid.GetCenter() dar = self._axis.get('daspect') sx, sy, sz = item.get('slices') if len(shape(sx)) == 2 and shape(sx) == shape(sy) == shape(sz): s = Surface(sx,sy,sz) sgrid2 = self._get_2d_structured_grid(s) plane = vtk.vtkStruc... | 8c9ac01e2abd6033fd126340689a7f8bfe3e4050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/8c9ac01e2abd6033fd126340689a7f8bfe3e4050/vtk_.py |
origins.append([center[0], sy[i]/dar[1], center[2]]) | origins.append([center[0], sy[i], center[2]]) | def _add_slices(self, item, sgrid, contours=False): cvector = item.get('cvector') center = sgrid.GetCenter() dar = self._axis.get('daspect') sx, sy, sz = item.get('slices') if len(shape(sx)) == 2 and shape(sx) == shape(sy) == shape(sz): s = Surface(sx,sy,sz) sgrid2 = self._get_2d_structured_grid(s) plane = vtk.vtkStruc... | 8c9ac01e2abd6033fd126340689a7f8bfe3e4050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/8c9ac01e2abd6033fd126340689a7f8bfe3e4050/vtk_.py |
origins.append([center[0], center[1], sz[i]/dar[2]]) | origins.append([center[0], center[1], sz[i]]) | def _add_slices(self, item, sgrid, contours=False): cvector = item.get('cvector') center = sgrid.GetCenter() dar = self._axis.get('daspect') sx, sy, sz = item.get('slices') if len(shape(sx)) == 2 and shape(sx) == shape(sy) == shape(sz): s = Surface(sx,sy,sz) sgrid2 = self._get_2d_structured_grid(s) plane = vtk.vtkStruc... | 8c9ac01e2abd6033fd126340689a7f8bfe3e4050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/8c9ac01e2abd6033fd126340689a7f8bfe3e4050/vtk_.py |
assert shape == cdata.shape, \ | assert v.shape == cdata.shape, \ | def _parseargs_isosurface(self, *args): nargs = len(args) if nargs >= 5 and nargs <= 6: # isosurface(X,Y,Z,V,isovalue) x, y, z, v = _check_xyzv(*args[:4]) isovalue = float(args[4]) elif nargs >= 2 and nargs <= 3: # isosurface(V,isovalue) x, y, z, v = _check_xyzv(args[0]) isovalue = float(args[1]) else: raise TypeError,... | 3d4852610074c49994bb5da6e5c34e0bc7aa82ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d4852610074c49994bb5da6e5c34e0bc7aa82ae/common.py |
legendcounter=len(ax.get('plotitems')) | def plot(self, *args, **kwargs): """Draw line and scatter plots. | d1440f554464eb2d76f851ece23ca1c31ebe15da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/d1440f554464eb2d76f851ece23ca1c31ebe15da/common.py | |
legendcounter = len(ax.get('plotitems'))-legendcounter | no_lines = len(lines) | def plot(self, *args, **kwargs): """Draw line and scatter plots. | d1440f554464eb2d76f851ece23ca1c31ebe15da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/d1440f554464eb2d76f851ece23ca1c31ebe15da/common.py |
if len(legends) == legendcounter: for i in range(legendcounter): legend = legends[legendcounter-i-1] | if len(legends) == no_lines: for i in range(no_lines): legend = legends[no_lines-i-1] | def plot(self, *args, **kwargs): """Draw line and scatter plots. | d1440f554464eb2d76f851ece23ca1c31ebe15da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/d1440f554464eb2d76f851ece23ca1c31ebe15da/common.py |
(len(legends), legendcounter) | (len(legends), no_lines) | def plot(self, *args, **kwargs): """Draw line and scatter plots. | d1440f554464eb2d76f851ece23ca1c31ebe15da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/d1440f554464eb2d76f851ece23ca1c31ebe15da/common.py |
for arg in ['--Numeric', '--numarray', ' --numpy']: | for arg in ['--Numeric', '--numarray', '--numpy']: try: __import__(arg[2:]) except: print "You don't have %s installed" %arg[2:] continue | def testMeshGrid_DenseFromNodenseMeshgridOutput(self): # sparse fails for dense output when input has singleton dimensions x = seq(-2,2,0.1) y = seq(-4,4,1) xx, yy = meshgrid(x,y) # xx and yy now has singleton dimension self.assertEqual(rank(xx), 2) self.assertEqual(rank(yy), 2) self.assertEqual(multiply.reduce(xx.shap... | cacd98c96f4cb36eb463203a218f6104a67258c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/cacd98c96f4cb36eb463203a218f6104a67258c6/numpytools.py |
def NumPy_type(a): """ @param a: NumPy array @return: "Numeric", "numarray", or "numpy", depending on which module that was used to generate the a array """ # check basic_NumPy type first to avoid possible import errors types = {'Numeric': 'Numeric.ArrayType', 'numarray': 'numarray.NumArray', 'numpy': 'numpy.ndarray'... | c5a8aed6d13cc63474ad134ec4e66c62d02ab165 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/c5a8aed6d13cc63474ad134ec4e66c62d02ab165/numpytools.py | ||
from easyviz.blt_ import * | from scitools.easyviz.blt_ import * | def test1(self): try: if 'pyx_' in _plts: use(_plts['pyx_'], globals()) figure() plot((2, 2, 3, 4), 'kv-', (3, 3, 4, 6), 'kv', x='auto') axis(-1, 5, -1, 10) title('A very long title') legend('line 1', 'line 2') #latextext = r"$2\pi\gamma k\Omega$" #$plt._g.text(0, 0, latextext) hold('on') plot((5, 3, 5, 5)) legend('li... | 2ae24cd5ae93f874a879dbd976e819a792bad21e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/2ae24cd5ae93f874a879dbd976e819a792bad21e/unittest_.py |
from easyviz.matplotlib_ import plt | from scitools.easyviz.matplotlib_ import plt | def test(self): self.setUp() try: figure() plot((1,2,3), (4,6,5), 'ro--') legend('tril') axis(0, 5, 0, 10) hold('on') plot((2,4,5), (4,4,4), '') legend('notrill', 'trill2') plot((1,2,3,4,5,6), (1,3,2,4,3,6), 'k:x') legend('nils') import Numeric x=Numeric.array((1,2,3,4)) plot(x, x**2, 'y') axis(0, 10, 0, 10) hardcopy('... | 2ae24cd5ae93f874a879dbd976e819a792bad21e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/2ae24cd5ae93f874a879dbd976e819a792bad21e/unittest_.py |
from easyviz.examples import * | from scitools.easyviz.examples import * | def test(self): self.setUp() try: figure() plot((1,2,3), (4,6,5), 'ro--') legend('tril') axis(0, 5, 0, 10) hold('on') plot((2,4,5), (4,4,4), '') legend('notrill', 'trill2') plot((1,2,3,4,5,6), (1,3,2,4,3,6), 'k:x') legend('nils') import Numeric x=Numeric.array((1,2,3,4)) plot(x, x**2, 'y') axis(0, 10, 0, 10) hardcopy('... | 2ae24cd5ae93f874a879dbd976e819a792bad21e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/2ae24cd5ae93f874a879dbd976e819a792bad21e/unittest_.py |
"python -c '''from easyviz.unittest_ import *;unittest.main()'''") | "python -c '''from scitools.easyviz.unittest_ import *;unittest.main()'''") | def main(): postscriptfiles = '' + \ " ".join(glob.glob('*.eps')) + \ " ".join(glob.glob('*.ps')) if len(postscriptfiles) > 0: print "Warning: you have old ps/eps files in testdir." print "These files might be overwritten by this test" print "The files are: ",postscriptfiles #rm *.ps *.eps *.pyc *~ -f #unittest.main()... | 2ae24cd5ae93f874a879dbd976e819a792bad21e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/2ae24cd5ae93f874a879dbd976e819a792bad21e/unittest_.py |
self.set(**kwargs) | def __init__(self, *args, **kwargs): PlotProperties.__init__(self, **kwargs) self._prop.update(Streams._local_prop) self._parseargs(*args) self.set(**kwargs) | b0aa04868c378158bd3e704a89c6441c72f1b5be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/b0aa04868c378158bd3e704a89c6441c72f1b5be/common.py | |
for key in 'stepsize tubescale ribbonwith'.split(): | for key in 'stepsize tubescale ribbonwidth'.split(): | def set(self, **kwargs): PlotProperties.set(self, **kwargs) | b0aa04868c378158bd3e704a89c6441c72f1b5be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/b0aa04868c378158bd3e704a89c6441c72f1b5be/common.py |
def system(command, verbose=True, failure_handling='exit') | def system(command, verbose=True, failure_handling='exit'): | def system(command, verbose=True, failure_handling='exit') """ Wrapping of the os.system command. Actually, the commands.getstatusoutput function is used, and the output from the system command is fetched. @param command: operating system command to be executed. @param verbose: False: no output, True: print command. @... | 7186d5f9afc13560062bcd4cbe80b91c25dd3969 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/7186d5f9afc13560062bcd4cbe80b91c25dd3969/misc.py |
- plot(y1,...,x=x) | - plot(y1,y2,...,x=x) | def plot(self, *args, **kwargs): """Draw line and scatter plots. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py |
for i in range(len(args)-1): if not isinstance(args[i], str): if isinstance(args[i+1], str): lines.append(Line(x=kwargs['x'], y=args[i], format=args[1+i])) else: lines.append(Line(x=kwargs['x'], y=args[i], format='')) if i == nargs-2: | if nargs == 1 or (nargs == 2 and isinstance(args[1], str)): if nargs == 1: lines.append(Line(x=kwargs['x'], y=args[0], format='')) else: lines.append(Line(x=kwargs['x'], y=args[0], format=args[1])) else: for i in range(len(args)-1): if not isinstance(args[i], str): if isinstance(args[i+1], str): | def plot(self, *args, **kwargs): """Draw line and scatter plots. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py |
y=args[i+1], | y=args[i], format=args[1+i])) else: lines.append(Line(x=kwargs['x'], y=args[i], | def plot(self, *args, **kwargs): """Draw line and scatter plots. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py |
for i in range(len(args)-1): if not isinstance(args[i], str): if isinstance(args[i+1], str): lines.append(Line(x=kwargs['x'], y=kwargs['y'], z=args[i], format=args[1+i])) else: lines.append(Line(x=kwargs['x'], y=kwargs['y'], z=args[i], format='')) if i == nargs-2: | if nargs == 1 or (nargs == 2 and isinstance(args[1], str)): if nargs == 1: lines.append(Line(x=kwargs['x'], y=kwargs['y'], z=args[0], format='')) else: lines.append(Line(x=kwargs['x'], y=kwargs['y'], z=args[0], format=args[1])) else: for i in range(len(args)-1): if not isinstance(args[i], str): if isinstance(args[i+1],... | def plot3(self, *args, **kwargs): """Draw lines and points in 3D space. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py |
z=args[i+1], | z=args[i], format=args[1+i])) else: lines.append(Line(x=kwargs['x'], y=kwargs['y'], z=args[i], | def plot3(self, *args, **kwargs): """Draw lines and points in 3D space. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py |
self._browser = WebBrowser() | self._browser = WebView() | def __init__(self, browser=None): Activity.__init__(self) | 8946f4e47fa34eab98c9b86bf7d960fc567018da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6905/8946f4e47fa34eab98c9b86bf7d960fc567018da/webactivity.py |
s = re.sub('&[A-Za-z.-]*;', ' ', s) s = re.sub('<[a-zA-Z0-9 =\\\\":/.-_?]*>', ' ', s) s = re.sub('<[a-zA-Z0-9 =\\\\":/.-_?]*/>', ' ', s) s = re.sub('</[a-zA-Z0-9]*>', ' ', s) | s = re.sub('&[^;]*;', ' ', s) s = re.sub('<[^>]*>', ' ', s) s = re.sub('<[^>]*/>', ' ', s) s = re.sub('</[^>]*>', ' ', s) | def getCleanMsgstr(self): s = self.getMsgstr() space = ('\\n', '\\t') empty = ('&',) import re s = re.sub('&[A-Za-z.-]*;', ' ', s) s = re.sub('<[a-zA-Z0-9 =\\\\":/.-_?]*>', ' ', s) s = re.sub('<[a-zA-Z0-9 =\\\\":/.-_?]*/>', ' ', s) s = re.sub('</[a-zA-Z0-9]*>', ' ', s) for t in space: s = s.replace(t, ' ') for t in emp... | 88a1cba5ce0a6a8c69383456ac6248279556d765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13181/88a1cba5ce0a6a8c69383456ac6248279556d765/POFile.py |
if x < lts - lwf + 1 and textToSearch[x + lwf] in string.letters: | if x < lts - lwf - 1 and textToSearch[x + lwf] in string.letters: | def searchWordInText(self, wordToFind, textToSearch, context, index): x = textToSearch.find(wordToFind, index) if x < 0: return (x, None) lwf = len(wordToFind) lts = len(textToSearch) if x > 0 and textToSearch[x - 1] in string.letters: return (x, None) if x < lts - lwf + 1 and textToSearch[x + lwf] in string.letters: r... | 665f0f099af255ae9f2a0d89a171ad7faab69c3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13181/665f0f099af255ae9f2a0d89a171ad7faab69c3a/POFile.py |
print "usage: %s connstring [-d dblib] outdir [propsfile]" % progname | print "usage: %s [-d dbmodule] connstring outdir [propsfile]" % progname | def usage_exit(progname, msg=None): if msg: print msg print print "usage: %s connstring [-d dblib] outdir [propsfile]" % progname sys.exit(2) | b7faa9968d0f0a325d29adbb8ce038e16354a472 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/b7faa9968d0f0a325d29adbb8ce038e16354a472/pgdbdoc.py |
def get_columns(self): return map(self.get_column, self._colnames) | 0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82/pgschema.py | ||
def get_column_names(self): return self._col_names | 0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82/pgschema.py | ||
nullable = (notnull != 't') | assert notnull in ('t', 'f', 1, 0), notnull nullable = (notnull not in ('t', 1)) | def _get_column_info(conn): Q = """SELECT c.relname, a.attname, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.atttypmod FROM pg_class c, pg_attribute a, pg_type t WHERE c.relname !~ '^pg_' and c.relname !~ '^Inv' and c.relkind = 'r' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid""" tables = {} for t... | 0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/0e0ee7904b1aeaa8825b9dcf8017a6e10f67bc82/pgschema.py |
self._index_items.append((table.name, "table", tablefilename)) | self._index_items.append((table.name, "table", "table-%s.html" % table.name)) | def _generate_table_pages(self): for table in self.tables: print "doing table", table.name tablefilename = os.path.join(self.outdir, "table-%s.html" % table.name) self._index_items.append((table.name, "table", tablefilename)) f = open(tablefilename, 'w') nav = '<a href="index.html">Table index</a> | <a href="symbol-ind... | 55145ff960540f212d14478508c2b47ce0c3ec0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/55145ff960540f212d14478508c2b47ce0c3ec0b/dbdoc.py |
tgargs = string.split(tgargs, '\\000') | if string.find(tgargs, '\000') != -1: tgargs = string.split(tgargs, '\000') else: tgargs = string.split(tgargs, '\\000') if len(tgargs) != 7: raise RuntimeError, "error parsing trigger args for foreign key: %s" \ % repr(tgargs) | def _get_foreign_keys(conn): """Find foreign keys by looking at triggers. (Query adapted from query posted to pgsql-general by Michael Fork according to http://www.geocrawler.com/mail/msg.php3?msg_id=4895586&list=12) """ fkeys = {} for (tgargs,) in _query(conn, ''' SELECT pt.tgargs FROM pg_class pc, pg_proc pg_proc, pg... | 0509e814fcecf4c755d5c98cbee943439ce01c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/0509e814fcecf4c755d5c98cbee943439ce01c0c/pgschema.py |
cols = string.replace(cols, ' ', ',') | def first(row): return row[0] | 0509e814fcecf4c755d5c98cbee943439ce01c0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/0509e814fcecf4c755d5c98cbee943439ce01c0c/pgschema.py | |
decode(data_type, 'DATE', 11, | decode(data_type, 'DATE', '11', | def _get_column_info(conn): "Get a dictionary of (table, [list of column details]) tuples for all tables" # AJT 13.11.2001 - Note date is hard coded to '11'. Probably should special # case this in the documentation class to ignore the length of dates. stmt = """SELECT table_name, column_name, data_type, nullable, decod... | b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc/oraschema.py |
for table, attr, typ, notnull, hasdef, length in _query(conn, stmt): | for table, attr, typ, nullable, hasdef, length in _query(conn, stmt): | def _get_column_info(conn): "Get a dictionary of (table, [list of column details]) tuples for all tables" # AJT 13.11.2001 - Note date is hard coded to '11'. Probably should special # case this in the documentation class to ignore the length of dates. stmt = """SELECT table_name, column_name, data_type, nullable, decod... | b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc/oraschema.py |
assert notnull in ('Y', 'N'), notnull nullable = (notnull == 'Y') | assert nullable in ('Y', 'N'), nullable nullable = (nullable == 'Y') | def _get_column_info(conn): "Get a dictionary of (table, [list of column details]) tuples for all tables" # AJT 13.11.2001 - Note date is hard coded to '11'. Probably should special # case this in the documentation class to ignore the length of dates. stmt = """SELECT table_name, column_name, data_type, nullable, decod... | b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4243/b0381eb0deed5317a5e4c83a4ecea7abc5e74dcc/oraschema.py |
if self.protocol not in [ '1910' ] : | if self.protocol not in [ '0014' ] : | def __init__( self , host = '127.0.0.1' , port = 5154 ) : | 45d4f996af16b74a08c47af45bd03809288e613d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4604/45d4f996af16b74a08c47af45bd03809288e613d/bzfquery.py |
data = struct.unpack( '>18H' , data ) | data = struct.unpack( '>21H' , data ) | def queryGame( self ) : | 45d4f996af16b74a08c47af45bd03809288e613d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4604/45d4f996af16b74a08c47af45bd03809288e613d/bzfquery.py |
redSize , greenSize , blueSize , purpleSize , rogueMax , \ redMax , greenMax , blueMax , purpleMax , shakeWins , \ shakeTimeout , maxPlayerScore , maxTeamScore , maxTime \ | redSize , greenSize , blueSize , purpleSize , obsSize, \ rogueMax , redMax , greenMax , blueMax , purpleMax , obsMax, \ shakeWins , shakeTimeout , maxPlayerScore , maxTeamScore , \ maxTime , elapsedTime \ | def queryGame( self ) : | 45d4f996af16b74a08c47af45bd03809288e613d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4604/45d4f996af16b74a08c47af45bd03809288e613d/bzfquery.py |
'rogue' : ( rogueSize , rogueMax ) , 'red' : ( redSize , redMax ) , 'green' : ( greenSize , greenMax ) , 'blue' : ( blueSize , blueMax ) , 'purple' : ( purpleSize , purpleMax ) , | 'rogue' : ( rogueSize , rogueMax ) , 'red' : ( redSize , redMax ) , 'green' : ( greenSize , greenMax ) , 'blue' : ( blueSize , blueMax ) , 'purple' : ( purpleSize , purpleMax ) , 'observer' : ( obsSize , obsMax ) , | def queryGame( self ) : | 45d4f996af16b74a08c47af45bd03809288e613d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4604/45d4f996af16b74a08c47af45bd03809288e613d/bzfquery.py |
'maxTime' : maxTime / 10. | 'maxTime' : maxTime / 10 , 'elapsedTime' : elapsedTime / 10 , | def queryGame( self ) : | 45d4f996af16b74a08c47af45bd03809288e613d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4604/45d4f996af16b74a08c47af45bd03809288e613d/bzfquery.py |
sys.stderr.write(filename + '\n') | def check_file(filename, lines): sys.stderr.write(filename + '\n') line_checks = [ check_tab_characters, check_long_lines ] token_checks = [ check_double_semicolons, check_missing_spaces_around, check_missing_spaces_after, check_extra_spaces_after, check_missing_spaces_before, check_extra_spaces_before, check_spaced_un... | a5f7b4634641d427bf087aa72f85d5dcceb025ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/a5f7b4634641d427bf087aa72f85d5dcceb025ef/check-coding-style.py | |
line = re.sub(r'[bB]ug '<a href="' + bugzilla_url + '\\1">\\g<0></a>', line) | def format_date(d): # Don't depend on locale months = (None, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December') d = time.strptime(d, '%Y-%m-%d') return '%s %d, %d' % (months[d.tm_mon], d.tm_mday, d.tm_year) | d298711b9a325b8a808cc15c7dbfada5395f6b17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/d298711b9a325b8a808cc15c7dbfada5395f6b17/gen-news.py | |
re_enum = re.compile(r'^\s+(?P<ident>[A-Z][A-Z0-9_]+)\s*=', re.M) | re_enum = re.compile(r'^\s+(?P<ident>[A-Z][A-Z0-9_]+)\s*[=,]', re.M) | command -nargs=+ HiLink hi def link <args> | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
def print_decls(decldict): | def print_decls(decldict, value): | def print_decls(decldict): for t, d in decldict.items(): d = d.keys() if not d: continue d.sort() print 'syn keyword %s%s %s' % (syntax_name, normalize(t), ' '.join(d)) | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
d = d.keys() | d = [k for k, v in d.items() if v == value] | def print_decls(decldict): for t, d in decldict.items(): d = d.keys() if not d: continue d.sort() print 'syn keyword %s%s %s' % (syntax_name, normalize(t), ' '.join(d)) | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
depdecls = dict([(x, {}) for x in types]) | deprecated_found = False identdefs = {} | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
insert_to = depdecls | value = 'deprecated' deprecated_found = True | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
insert_to = decls | value = None | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
insert_to[d['type']][d['ident']] = 1 | m = re_ident_macro.search(d['body']) if m: identdefs[d['ident']] = m.group('ident') decls[d['type']][d['ident']] = value | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
insert_to['CONSTANT'][e.group('ident')] = 1 | decls['CONSTANT'][e.group('ident')] = value for macro, body in identdefs.items(): for k, d in decls.items(): if not d.has_key(body): continue if k == 'FUNCTION' or k == 'MACRO': decls['MACRO'][macro] = decls['DEFINE'][macro] del decls['DEFINE'][macro] | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
override(depdecls, options['override']) | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py | |
print_decls(decls) if [x for x in depdecls.values() if x]: | print_decls(decls, None) if deprecated_found: | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
print_decls(depdecls) | print_decls(decls, 'deprecated') | def override(decldict, overides): for o, v in overides.items(): v = v.upper() has_it = False for k, d in decldict.items(): if d.has_key(o): has_it = True del d[o] if has_it: decldict[v][o] = 1 | f7d9779be336dd165ada7dd3923f3f7d87d4a728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/f7d9779be336dd165ada7dd3923f3f7d87d4a728/vim-syn-gen.py |
if not export_deprecated and d.body.find('<DEPRECATED/>'): | if not export_deprecated and d.body.find('<DEPRECATED/>') > -1: | def __init__(self, mapping): self.__dict__.update(mapping) | 3b3a16de35cc2eb71cf93cfcc152c886b02127f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/3b3a16de35cc2eb71cf93cfcc152c886b02127f9/vim-syn-gen.py |
mean_value = (min(a) + max(a))/2.0 | mirror = min(a) + max(a) | def run(args): run_mode = args.pop(0) assert run_mode in run_modes filename = args.pop(0) data = Gwyddion.dump.read(filename) dfield = data['/0/data'] a = dfield['data'] n = len(a) mean_value = (min(a) + max(a))/2.0 for i in range(n): a[i] = mean_value - a[i] Gwyddion.dump.write(data, filename) | 2a985203d3906454fb40e78992e5a6a752fd3300 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/2a985203d3906454fb40e78992e5a6a752fd3300/invert_python.py |
a[i] = mean_value - a[i] | a[i] = mirror - a[i] | def run(args): run_mode = args.pop(0) assert run_mode in run_modes filename = args.pop(0) data = Gwyddion.dump.read(filename) dfield = data['/0/data'] a = dfield['data'] n = len(a) mean_value = (min(a) + max(a))/2.0 for i in range(n): a[i] = mean_value - a[i] Gwyddion.dump.write(data, filename) | 2a985203d3906454fb40e78992e5a6a752fd3300 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/2a985203d3906454fb40e78992e5a6a752fd3300/invert_python.py |
makefile = get_file('Makefile.am') | try: makefile = get_file('Makefile.am') except IOError: return | def recurse(each): cwd = os.getcwd() makefile = get_file('Makefile.am') each(makefile) subdirs = get_list(makefile, 'SUBDIRS') for s in subdirs: os.chdir(s) recurse(each) os.chdir(cwd) | b41841f0a546a718e653ddee5491445caf99992d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/b41841f0a546a718e653ddee5491445caf99992d/update-msvc.py |
for i, t in enumerate(tokens): | for t in tokens: | def check_missing_spaces_around(tokens, lines, warnings): "Check for missing spaces around <, >, =, etc." operators = '<', '>', '&&', '||', '?', '{' for i, t in enumerate(tokens): if t.typ != Token.punct: continue if t.string not in operators and t.string.find('=') == -1: continue prec = tokens[i-1] mbefore = prec.line... | ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py |
prec = tokens[i-1] mbefore = prec.line == t.line and prec.end == t.col succ = tokens[i+1] mafter = succ.line == t.line and t.end == succ.col | mbefore = t.prec.line == t.line and t.prec.end == t.col mafter = t.succ.line == t.line and t.end == t.succ.col | def check_missing_spaces_around(tokens, lines, warnings): "Check for missing spaces around <, >, =, etc." operators = '<', '>', '&&', '||', '?', '{' for i, t in enumerate(tokens): if t.typ != Token.punct: continue if t.string not in operators and t.string.find('=') == -1: continue prec = tokens[i-1] mbefore = prec.line... | ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py |
for i, t in enumerate(tokens): | for t in tokens: | def check_missing_spaces_after(tokens, lines, warnings): "Check for missing spaces after comma, colon" operators = ',', ':' for i, t in enumerate(tokens): if t.typ != Token.punct or t.string not in operators: continue succ = tokens[i+1] if succ.line == t.line and t.end == succ.col: w = 'Missing space after `%s\' (col %... | ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py |
succ = tokens[i+1] if succ.line == t.line and t.end == succ.col: | if t.succ.line == t.line and t.end == t.succ.col: | def check_missing_spaces_after(tokens, lines, warnings): "Check for missing spaces after comma, colon" operators = ',', ':' for i, t in enumerate(tokens): if t.typ != Token.punct or t.string not in operators: continue succ = tokens[i+1] if succ.line == t.line and t.end == succ.col: w = 'Missing space after `%s\' (col %... | ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py |
for i, t in enumerate(tokens): | for t in tokens: | def check_missing_spaces_before(tokens, lines, warnings): "Check for missing spaces before }" operators = '}', for i, t in enumerate(tokens): if t.typ != Token.punct or t.string not in operators: continue prec = tokens[i-1] if prec.line == t.line and prec.end == t.col: w = 'Missing space before `%s\' (col %d): %s' warn... | ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/ecf9bde6b618739f9ef7098da2a7ad267a2f3d5f/check-coding-style.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.