bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def makeInnerTiles(self): # inner grid lines group = Group()
defmakeInnerTiles(self):#innergridlinesgroup=Group()
5,900
def makeInnerTiles(self): # inner grid lines group = Group()
def makeInnerTiles(self): # inner grid lines group = Group()
5,901
def makeInnerTiles(self): # inner grid lines group = Group()
def makeInnerTiles(self): # inner grid lines group = Group()
5,902
def makeInnerTiles(self): # inner grid lines group = Group()
defmakeInnerTiles(self):#innergridlinesgroup=Group()
5,903
def makeInnerTiles(self): # inner grid lines group = Group()
def makeInnerTiles(self): # inner grid lines group = Group()
5,904
def makeInnerTiles(self): # inner grid lines group = Group()
def makeInnerTiles(self): # inner grid lines group = Group()
5,905
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...
def test(): D = Drawing(450, 650) d = 80 s = 60 for row in range(10): y = 530 - row*d 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:...
5,906
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...
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*d 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 range...
5,907
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...
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*d 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 range...
5,908
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...
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*d 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 range...
5,909
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...
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*d 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 range...
5,910
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...
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*d 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 range...
5,911
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...
def _listCellGeom(self, V,w,s,W=None,H=None): aW = w-s.leftPadding-s.rightPadding t = 0 w = 0 canv = getattr(self,'canv',None) 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].ge...
5,912
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...
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...
5,913
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...
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...
5,914
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]...
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] or ...
5,915
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]...
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]...
5,916
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...
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...
5,917
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...
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...
5,918
def UpdateRegattaRanking(self): self.SaveRankingData() self.LoadRegattaRanking()
def UpdateRegattaRanking(self): self.SaveRankingData() self.LoadRegattaRanking()
5,919
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
def ChechForSkipper(self, value, pos): for s in range(0, self.T_DetailRanking.rowCount()): 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
5,920
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...
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...
5,921
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...
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...
5,922
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...
def AddRace(self): cols = self.T_DetailRanking.columnCount() if cols == 2: cols += 1 TableHeader=[] for c in range(0, cols -1): TableHeader.append("%s %d"%("Race",(c))) TableHeader[0] = "Skipper" TableHeader.append("Tot") self.T_DetailRanking.setHorizontalHeaderLabels(TableHeader) self.T_DetailRanking.resizeColumnsToCo...
5,923
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...
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))) Table...
5,924
def _element_content(self, element): """ Distill the textual content recursively. Added since I do not know how to use the lib for this. (Tuttle) """
def _element_content(self, element): """ Distill the textual content recursively. Added since I do not know how to use the lib for this. (Tuttle) """
5,925
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
5,926
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
5,927
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
5,928
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]
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]
5,929
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 + ' '
def _make_msgstr(self, element, shrink = True): 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 + ' '
5,930
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 + ' '
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 + ' '
5,931
def read(self): """Reads in from all given ZPTs and builds up MessageCatalogs accordingly.
def read(self): """Reads in from all given ZPTs and builds up MessageCatalogs accordingly.
5,932
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
5,933
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
def _do_translate(self, element, domain): filename = self._curr_fn excerpt = self._make_excerpt(element) msgid = element.getAttribute('i18n:translate')
5,934
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...
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...
5,935
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.
defmerge(self,__loc_data__=None,__conflict_solve=None,**kw):"""S.merge(data,conflict,k=v1,k=v2,...)->mergedataandk=vintoS.
5,936
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.
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.
5,937
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...
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...
5,938
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...
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...
5,939
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...
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...
5,940
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,...
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,...
5,941
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,942
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,943
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,944
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,945
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...
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...
5,946
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'...
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'...
5,947
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...
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...
5,948
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('...
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('...
5,949
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('...
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('...
5,950
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()...
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()...
5,951
def __init__(self, *args, **kwargs): PlotProperties.__init__(self, **kwargs) self._prop.update(Streams._local_prop) self._parseargs(*args) self.set(**kwargs)
def __init__(self, *args, **kwargs): PlotProperties.__init__(self, **kwargs) self._prop.update(Streams._local_prop) self._parseargs(*args) self.set(**kwargs)
5,952
def set(self, **kwargs): PlotProperties.set(self, **kwargs)
def set(self, **kwargs): PlotProperties.set(self, **kwargs)
5,953
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. @...
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. ...
5,954
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,955
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,956
def plot(self, *args, **kwargs): """Draw line and scatter plots.
def plot(self, *args, **kwargs): """Draw line and scatter plots.
5,957
def plot3(self, *args, **kwargs): """Draw lines and points in 3D space.
def plot3(self, *args, **kwargs): """Draw lines and points in 3D space.
5,958
def plot3(self, *args, **kwargs): """Draw lines and points in 3D space.
def plot3(self, *args, **kwargs): """Draw lines and points in 3D space.
5,959
def __init__(self, browser=None): Activity.__init__(self)
def __init__(self, browser=None): Activity.__init__(self)
5,960
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...
def getCleanMsgstr(self): s = self.getMsgstr() space = ('\\n', '\\t') empty = ('&',) import re s = re.sub('&[^;]*;', ' ', s) s = re.sub('<[^>]*>', ' ', s) s = re.sub('<[^>]*/>', ' ', s) s = re.sub('</[^>]*>', ' ', s) for t in space: s = s.replace(t, ' ') for t in empty: s = s.replace(t, '') return s
5,961
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...
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...
5,962
def usage_exit(progname, msg=None): if msg: print msg print print "usage: %s connstring [-d dblib] outdir [propsfile]" % progname sys.exit(2)
def usage_exit(progname, msg=None): if msg: print msg print print "usage: %s [-d dbmodule] connstring outdir [propsfile]" % progname sys.exit(2)
5,963
def get_columns(self): return map(self.get_column, self._colnames)
def get_columns(self): return map(self.get_column, self._colnames)
5,964
def get_column_names(self): return self._col_names
def get_column_names(self): return self._col_names
5,965
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...
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...
5,966
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...
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", "table-%s.html" % table.name)) f = open(tablefilename, 'w') nav = '<a href="index.html">Table index</a> | <a h...
5,967
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...
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...
5,968
def first(row): return row[0]
def first(row): return row[0]
5,969
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...
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...
5,970
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...
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...
5,971
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...
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...
5,972
def __init__( self , host = '127.0.0.1' , port = 5154 ) :
def __init__( self , host = '127.0.0.1' , port = 5154 ) :
5,973
def queryGame( self ) :
def queryGame( self ) :
5,974
def queryGame( self ) :
def queryGame( self ) :
5,975
def queryGame( self ) :
def queryGame( self ) :
5,976
def queryGame( self ) :
def queryGame( self ) :
5,977
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...
def check_file(filename, lines): 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_unary_pm, check_singlular_opening_br...
5,978
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)
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)
5,979
command -nargs=+ HiLink hi def link <args>
command -nargs=+ HiLink hi def link <args>
5,980
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))
def print_decls(decldict, value): 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))
5,981
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))
def print_decls(decldict): for t, d in decldict.items(): d = [k for k, v in d.items() if v == value] if not d: continue d.sort() print 'syn keyword %s%s %s' % (syntax_name, normalize(t), ' '.join(d))
5,982
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
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
5,983
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
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
5,984
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
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
5,985
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
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
5,986
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
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
5,987
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
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
5,988
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
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
5,989
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
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
5,990
def __init__(self, mapping): self.__dict__.update(mapping)
def __init__(self, mapping): self.__dict__.update(mapping)
5,991
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)
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) mirror = min(a) + max(a) for i in range(n): a[i] = mean_value - a[i] Gwyddion.dump.write(data, filename)
5,992
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)
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] = mirror - a[i] Gwyddion.dump.write(data, filename)
5,993
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)
def recurse(each): cwd = os.getcwd() try: makefile = get_file('Makefile.am') except IOError: return each(makefile) subdirs = get_list(makefile, 'SUBDIRS') for s in subdirs: os.chdir(s) recurse(each) os.chdir(cwd)
5,994
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...
def check_missing_spaces_around(tokens, lines, warnings): "Check for missing spaces around <, >, =, etc." operators = '<', '>', '&&', '||', '?', '{' for t in 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 == t.line and...
5,995
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...
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 mbefore = t.prec.line == t.line and t....
5,996
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 %...
def check_missing_spaces_after(tokens, lines, warnings): "Check for missing spaces after comma, colon" operators = ',', ':' for t in 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 %d): %s' warnin...
5,997
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 %...
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 if t.succ.line == t.line and t.end == t.succ.col: w = 'Missing space after `%s\' (col %d): %s' warning...
5,998
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...
def check_missing_spaces_before(tokens, lines, warnings): "Check for missing spaces before }" operators = '}', for t in 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' warnings.append((t...
5,999