bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def runTest(self): ret = self.runCommand("show arch", "show-arch") print ret
def runTest(self): ret = self.runCommand("show arch", "show-arch") print ret
453,500
def breakpoint_locations_test(self): """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
def breakpoint_locations_test(self): """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
453,501
def test_with_dsym(self): """Test 'image lookup -t days' and check for correct display.""" self.buildDsym() self.image_lookup_for_enum_type()
def test_with_dsym(self): """Test 'image lookup -t days' and check for correct display.""" self.buildDsym() self.image_lookup_for_enum_type()
453,502
def getNodes(self): return self.nodes
def getNodes(self): return self.nodes
453,503
def __eq__(self, n): if n.lid == self.lid: return 1 else: return 0
def __eq__(self, n): if n.lid == self.lid: return True else: return 0
453,504
def __eq__(self, n): if n.lid == self.lid: return 1 else: return 0
def __eq__(self, n): if n.lid == self.lid: return 1 else: return 0
453,505
def __init__(self,maphandler): self.mh = maphandler
def __init__(self,maphandler): self.mh = maphandler
453,506
def _getBestOpenNode(self): bestNode = None for n in self.on: if not bestNode: bestNode = n else: if n.score<=bestNode.score: bestNode = n return bestNode
def _getBestOpenNode(self): bestNode = None for n in self.on: if not bestNode: bestNode = n else: if n.score<=bestNode.score: bestNode = n return bestNode
453,507
def _tracePath(self,n): nodes = []; totalCost = n.mCost; p = n.parent; nodes.insert(0,n); while 1: if p.parent is None: break
def _tracePath(self,n): nodes = [] totalCost = n.mCost p = n.parent nodes.insert(0,n) while 1: if p.parent is None: break
453,508
def _tracePath(self,n): nodes = []; totalCost = n.mCost; p = n.parent; nodes.insert(0,n); while 1: if p.parent is None: break
def _tracePath(self,n): nodes = []; totalCost = n.mCost; p = n.parent; nodes.insert(0,n); while 1: if p.parent is None: break
453,509
def _tracePath(self,n): nodes = []; totalCost = n.mCost; p = n.parent; nodes.insert(0,n); while 1: if p.parent is None: break
def _tracePath(self,n): nodes = []; totalCost = n.mCost; p = n.parent; nodes.insert(0,n); while 1: if p.parent is None: break
453,510
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
453,511
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
453,512
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
def _handleNode(self,node,end): i = self.o.index(node.lid) self.on.pop(i) self.o.pop(i) self.c.append(node.lid)
453,513
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
453,514
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
453,515
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
453,516
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
def findPath(self,fromlocation, tolocation): self.o = [] self.on = [] self.c = []
453,517
def __eq__(self, l): """MUST BE IMPLEMENTED""" if l.x == self.x and l.y == self.y: return 1 else: return 0
def __eq__(self, l): """MUST BE IMPLEMENTED""" if l.x == self.x and l.y == self.y: return True else: return 0
453,518
def __eq__(self, l): """MUST BE IMPLEMENTED""" if l.x == self.x and l.y == self.y: return 1 else: return 0
def __eq__(self, l): """MUST BE IMPLEMENTED""" if l.x == self.x and l.y == self.y: return 1 else: return 0
453,519
def getNode(self, location): """MUST BE IMPLEMENTED""" x = location.x y = location.y if x<0 or x>=self.w or y<0 or y>=self.h: return None d = self.m[(y*self.w)+x] if d == -1: return None
def getNode(self, location): """MUST BE IMPLEMENTED""" x = location.x y = location.y if x<0 or x>=self.w or y<0 or y>=self.h: return None d = self.m[(y*self.w)+x] if d == -1: return None
453,520
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
453,521
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
453,522
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
453,523
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
def getAdjacentNodes(self, curnode, dest): """MUST BE IMPLEMENTED""" result = [] cl = curnode.location dl = dest n = self._handleNode(cl.x+1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x-1,cl.y,curnode,dl.x,dl.y) if n: result.append(n) n = self._handleNode(cl.x,cl.y+1,curnode,dl.x,dl.y) if ...
453,524
def _handleNode(self,x,y,fromnode,destx,desty): n = self.getNode(SQ_Location(x,y)) if n is not None: dx = max(x,destx) - min(x,destx) dy = max(y,desty) - min(y,desty) emCost = dx+dy n.mCost += fromnode.mCost n.score = n.mCost+emCost n.parent=fromnode return n
def _handleNode(self,x,y,fromnode,destx,desty): n = self.getNode(SQ_Location(x,y)) if n is not None: dx = max(x,destx) - min(x,destx) dy = max(y,desty) - min(y,desty) emCost = dx+dy n.mCost += fromnode.mCost n.score = n.mCost+emCost n.parent=fromnode return n
453,525
def _handleNode(self,x,y,fromnode,destx,desty): n = self.getNode(SQ_Location(x,y)) if n is not None: dx = max(x,destx) - min(x,destx) dy = max(y,desty) - min(y,desty) emCost = dx+dy n.mCost += fromnode.mCost n.score = n.mCost+emCost n.parent=fromnode return n
def _handleNode(self,x,y,fromnode,destx,desty): n = self.getNode(SQ_Location(x,y)) if n is not None: dx = max(x,destx) - min(x,destx) dy = max(y,desty) - min(y,desty) emCost = dx+dy n.mCost += fromnode.mCost n.score = n.mCost+emCost n.parent=fromnode return n
453,526
def visitCallFunc(self, node, func=None): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) funcs = callfunc_targets(node, self.mergeinh)
def visitCallFunc(self, node, func=None): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) funcs = callfunc_targets(node, self.mergeinh)
453,527
def visitCallFunc(self, node, func=None): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) funcs = callfunc_targets(node, self.mergeinh)
def visitCallFunc(self, node, func=None): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) funcs = callfunc_targets(node, self.mergeinh)
453,528
def visit_callfunc_args(self, funcs, node, func): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) target = funcs[0] # XXX
def visit_callfunc_args(self, funcs, node, func): objexpr, ident, direct_call, method_call, constructor, parent_constr = analyze_callfunc(node) target = funcs[0] # XXX
453,529
def visitMod(self, node, func=None): # --- non-str % .. if [t for t in getgx().merged_inh[node.left] if t[0].ident != 'str_']: self.visitBinary(node.left, node.right, '__mod__', '%', func) return
def visitMod(self, node, func=None): # --- non-str % .. if [t for t in getgx().merged_inh[node.left] if t[0].ident != 'str_']: self.visitBinary(node.left, node.right, '__mod__', '%', func) return
453,530
def visitPrint(self, node, func=None, print_space=True): self.start('print2(') if node.dest: self.visitm(node.dest, ', ', func) if print_space: self.append('1,') else: self.append('0,') self.append(str(len(node.nodes))) for n in node.nodes: types = [t[0].ident for t in self.mergeinh[n]] if 'float_' in types or 'int_' i...
def visitPrint(self, node, func=None, print_space=True): self.start('print2(') if node.dest: self.visitm(node.dest, ', ', func) if print_space: self.append('1,') else: self.append('0,') self.append(str(len(node.nodes))) for n in node.nodes: types = [t[0].ident for t in self.mergeinh[n]] if 'float_' in types or 'int_' i...
453,531
def visitFrom(self, node, parent=None): if not node in getmv().importnodes: # XXX use (func, node) as parent.. error("please place all imports (no 'try:' etc) at the top of the file", node) if hasattr(node, 'level') and node.level: error("relative imports are not supported", node)
deffor import_name, import_mod in mod.mv.imports.items(): var = defaultvar(import_name, None) var.imported = True getgx().types[inode(var)] = set([(import_mod, 0)]) self.imports[import_name] = import_mod visitFrom(self,for import_name, import_mod in mod.mv.imports.items(): var = defaultvar(import_name, None) var.import...
453,532
def wopper(x): print 'wopper', x
def wopper(x): print 'wopper', x
453,533
def __init__(self, x): super(B, self).__init__(x) super(C, self).__init__(3*x) A.__init__(self, 2*x) C.__init__(self, 3*x) print 'b', x
def __init__(self, x): super(B, self).__init__(x) super(C, self).__init__(3*x) A.__init__(self, 2*x) C.__init__(self, 3*x) print 'b', x
453,534
def __init__(self, root, viewports): self.root = root self.viewports = viewports self.topButtonFrame = Frame(root) self.topButtonFrame.pack(side=TOP) self.botButtonFrame = Frame(root) self.botButtonFrame.pack(side=BOTTOM) self.button = Button(self.topButtonFrame, text="Quit", command=self.shutdown) self.button.pack(sid...
def __init__(self, root, viewports): self.root = root self.viewports = viewports self.topButtonFrame = Frame(root) self.topButtonFrame.pack(side=TOP) self.botButtonFrame = Frame(root) self.botButtonFrame.pack(side=BOTTOM) self.button = Button(self.topButtonFrame, text="Quit", command=self.shutdown) self.button.pack(sid...
453,535
def __init__(self): self.constraints = set() self.allvars = set() self.allfuncs = set() self.allclasses = set() self.cnode = {} self.types = {} self.templates = 0 self.modules = {} self.inheritance_relations = {} self.inheritance_tempvars = {} self.parent_nodes = {} self.inherited = set() self.nrcltypes = 8; self.empty...
def __init__(self): self.constraints = set() self.allvars = set() self.allfuncs = set() self.allclasses = set() self.cnode = {} self.types = {} self.templates = 0 self.modules = {} self.inheritance_relations = {} self.inheritance_tempvars = {} self.parent_nodes = {} self.inherited = set() self.nrcltypes = 8; self.empty...
453,536
def main(): setgx(newgx()) print '*** SHED SKIN Python-to-C++ Compiler 0.6 ***' print 'Copyright 2005-2010 Mark Dufour; License GNU GPL version 3 (See LICENSE)' print # --- some checks major, minor = sys.version_info[:2] if (major, minor) not in [(2, 4), (2, 5), (2, 6)]: print '*ERROR* Shed Skin is not compatible wit...
def main(): setgx(newgx()) print '*** SHED SKIN Python-to-C++ Compiler 0.6 ***' print 'Copyright 2005-2010 Mark Dufour; License GNU GPL version 3 (See LICENSE)' print # --- some checks major, minor = sys.version_info[:2] if (major, minor) not in [(2, 4), (2, 5), (2, 6)]: print '*ERROR* Shed Skin is not compatible wit...
453,537
def set_timer(self): self.timer = gobject.timeout_add(20, self.fire_timer)
def set_timer(self): self.timer = gobject.timeout_add(20, self.fire_timer)
453,538
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.CPU_clock = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.timer: gobject.source_remove(self.timer) widget.set_label("_Continue") self.CPU_clock = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
453,539
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.CPU_clock = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.timer = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
453,540
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.CPU_clock = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.CPU_clock = None else: self.set_timer() widget.set_label("_Pause")
453,541
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, emptycsites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = list(nr_classes[dcpa]) noconf = set([n for n in csites if len(n.paths)==1]+emptycsites) others = len(csites) + len(emptyc...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, emptycsites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = list(nr_classes[dcpa]) noconf = set([n for n in csites if len(n.paths)==1]+emptycsites) others = len(csites) + len(emptyc...
453,542
def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.exp...
def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.exp...
453,543
def visitCallFunc(self, node, func=None): # XXX clean up!! newnode = cnode(node, parent=func)
def visitCallFunc(self, node, func=None): # XXX clean up!! newnode = cnode(node, parent=func)
453,544
def lookahead(): # mods: [list(int)] global lit_mask lit_mask = [1]
def lookahead(): # mods: [list(int)] global lit_mask lit_mask = [1]
453,545
def get_selector(self, temp, item, i): rvalue_node = getgx().item_rvalue[item] sel = '__getitem__(%d)' % i if self.only_classes(rvalue_node, ('list',)): sel = '__getfast__(%d)' % i elif i < 2 and self.only_classes(rvalue_node, ('tuple2',)): sel = ['__getfirst__()', '__getsecond__()'][i] return '%s->%s' % (temp, sel)
def get_selector(self, temp, item, i): rvalue_node = getgx().item_rvalue[item] sel = '__getitem__(%d)' % i if i < 2 and self.only_classes(rvalue_node, ('tuple2',)): sel = ['__getfirst__()', '__getsecond__()'][i] elif self.getfast(rvalue_node): sel = '__getfast__(%d)' % i elif i < 2 and self.only_classes(rvalue_node, ('...
453,546
def get_selector(self, temp, item, i): rvalue_node = getgx().item_rvalue[item] sel = '__getitem__(%d)' % i if self.only_classes(rvalue_node, ('list',)): sel = '__getfast__(%d)' % i elif i < 2 and self.only_classes(rvalue_node, ('tuple2',)): sel = ['__getfirst__()', '__getsecond__()'][i] return '%s->%s' % (temp, sel)
def get_selector(self, temp, item, i): rvalue_node = getgx().item_rvalue[item] sel = '__getitem__(%d)' % i if self.only_classes(rvalue_node, ('list',)): sel = '__getfast__(%d)' % i return '%s->%s' % (temp, sel)
453,547
def visitGetattr(self, node, func=None): cl, module = lookup_class_module(node.expr, inode(node).mv, func)
def visitGetattr(self, node, func=None): cl, module = lookup_class_module(node.expr, inode(node).mv, func)
453,548
def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.exp...
def supercall(self, orig, parent): node = orig.node while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ is...
453,549
def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.exp...
def supercall(self, node, parent): while isinstance(parent, function): parent = parent.parent if (isinstance(node.expr, CallFunc) and \ node.attrname not in ('__getattr__', '__setattr__') and \ isinstance(node.expr.node, Name) and \ node.expr.node.name == 'super'): if (len(node.expr.args) >= 2 and \ isinstance(node.exp...
453,550
def visitCallFunc(self, node, func=None): # XXX clean up!! newnode = cnode(node, parent=func)
def visitCallFunc(self, node, func=None): # XXX clean up!! newnode = cnode(node, parent=func)
453,551
def main(): setgx(newgx()) print '*** SHED SKIN Python-to-C++ Compiler 0.4 ***' print 'Copyright 2005-2009 Mark Dufour; License GNU GPL version 3 (See LICENSE)' print # --- some checks major, minor = sys.version_info[:2] if (major, minor) not in [(2, 4), (2, 5), (2, 6)]: print '*ERROR* Shed Skin is not compatible wit...
def main(): setgx(newgx()) print '*** SHED SKIN Python-to-C++ Compiler 0.5 ***' print 'Copyright 2005-2010 Mark Dufour; License GNU GPL version 3 (See LICENSE)' print # --- some checks major, minor = sys.version_info[:2] if (major, minor) not in [(2, 4), (2, 5), (2, 6)]: print '*ERROR* Shed Skin is not compatible wit...
453,552
def record(univ): ctime = univ.ttime points_file=open(univ.folder_name+'/points'+(str(ctime/1000000)),'w') points_file.write('points: '+ str(univ.points) +' rewarded: ' + str(univ.reward)) connex_final_file=open(univ.folder_name+'/connex'+(str(ctime/1000000)),'w') food_file=open(univ.folder_name+'/burger_time','w') out...
def record(univ): ctime = univ.ttime points_file=open(univ.folder_name+'/points'+(str(ctime/1000000)),'w') points_file.write('points: '+ str(univ.points) +' rewarded: ' + str(univ.reward)) connex_final_file=open(univ.folder_name+'/connex'+(str(ctime/1000000)),'w') food_file=open(univ.folder_name+'/burger_time','w') out...
453,553
def class_copy(cl, dcpa): for var in cl.vars.values(): # XXX if not inode(var) in getgx().types: continue # XXX research later inode(var).copy(dcpa, 0) getgx().types[getgx().cnode[var, dcpa, 0]] = inode(var).types().copy() for n in inode(var).in_: # XXX if isinstance(n.thing, Const): addconstraint(n, getgx().cnode[va...
def class_copy(cl, dcpa): for var in cl.vars.values(): # XXX if not inode(var) in getgx().types: continue # XXX research later inode(var).copy(dcpa, 0) getgx().types[getgx().cnode[var, dcpa, 0]] = inode(var).types().copy() for n in inode(var).in_: # XXX if isinstance(n.thing, Const): addconstraint(n, getgx().cnode[va...
453,554
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklistgetgx().checkcallfunc = [] # XXX# --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed.add...
453,555
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
defpropagate():#print'propagate'seed_nodes()worklist=init_worklist()#print'worklist',worklistgetgx().checkcallfunc=[]#XXX#---checkwhetherseedednodesareobject/argumenttocallchanged=set()forwinworklist:forcallfuncinw.callfuncs:#print'seedchanged',w.callfunc,w.dcpa,w.cpachanged.add(getgx().cnode[callfunc,w.dcpa,w.cpa])#--...
453,556
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
453,557
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
453,558
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
defpropagate():#print'propagate'seed_nodes()worklist=init_worklist()#print'worklist',worklistgetgx().checkcallfunc=[]#XXX#---checkwhetherseedednodesareobject/argumenttocallchanged=set()forwinworklist:forcallfuncinw.callfuncs:#print'seedchanged',w.callfunc,w.dcpa,w.cpachanged.add(getgx().cnode[callfunc,w.dcpa,w.cpa])#--...
453,559
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
defpropagate():#print'propagate'seed_nodes()worklist=init_worklist()#print'worklist',worklistgetgx().checkcallfunc=[]#XXX#---checkwhetherseedednodesareobject/argumenttocallchanged=set()forwinworklist:forcallfuncinw.callfuncs:#print'seedchanged',w.callfunc,w.dcpa,w.cpachanged.add(getgx().cnode[callfunc,w.dcpa,w.cpa])#--...
453,560
def create_template(func, dcpa, c, worklist): # --- unseen cartesian product: create new template if not dcpa in func.cp: func.cp[dcpa] = {} func.cp[dcpa][c] = cpa = len(func.cp[dcpa]) # XXX +1 #if not func.mv.module.builtin and not func.ident in ['__getattr__', '__setattr__']: #if func.ident == 'product': # print...
defcreate_template(func,dcpa,c,worklist):#---unseencartesianproduct:createnewtemplateifnotdcpainfunc.cp:func.cp[dcpa]={}func.cp[dcpa][c]=cpa=len(func.cp[dcpa])#XXX+1#ifnotfunc.mv.module.builtinandnotfunc.identin['__getattr__','__setattr__']:#iffunc.ident=='product':#print'template',(func,dcpa),cgetgx().templates+=1func...
453,561
def iterative_dataflow_analysis(): print '[iterative type analysis..]' backup = backup_network() while True: getgx().iterations += 1 if getgx().iterations > 30: print '\n*WARNING* reached maximum number of iterations' break # --- propagate using cartesian product algorithm getgx().new_alloc_info = {} #print 'table' #...
defiterative_dataflow_analysis():print'[iterativetypeanalysis..]'backup=backup_network()whileTrue:getgx().iterations+=1ifgetgx().iterations>30:print'\n*WARNING*reachedmaximumnumberofiterations'break#---propagateusingcartesianproductalgorithmgetgx().new_alloc_info={}#print'table'#print'\n'.join([repr(e)+':'+repr(l)fore,...
453,562
def iterative_dataflow_analysis(): print '[iterative type analysis..]' backup = backup_network() while True: getgx().iterations += 1 if getgx().iterations > 30: print '\n*WARNING* reached maximum number of iterations' break # --- propagate using cartesian product algorithm getgx().new_alloc_info = {} #print 'table' #...
def iterative_dataflow_analysis(): print '[iterative type analysis..]' backup = backup_network() while True: getgx().iterations += 1 if getgx().iterations > 30: print '\n*WARNING* reached maximum number of iterations' break # --- propagate using cartesian product algorithm getgx().new_alloc_info = {} #print 'table' #...
453,563
def iterative_dataflow_analysis(): print '[iterative type analysis..]' backup = backup_network() while True: getgx().iterations += 1 if getgx().iterations > 30: print '\n*WARNING* reached maximum number of iterations' break # --- propagate using cartesian product algorithm getgx().new_alloc_info = {} #print 'table' #...
defiterative_dataflow_analysis():print'[iterativetypeanalysis..]'backup=backup_network()whileTrue:getgx().iterations+=1ifgetgx().iterations>30:print'\n*WARNING*reachedmaximumnumberofiterations'break#---propagateusingcartesianproductalgorithmgetgx().new_alloc_info={}#print'table'#print'\n'.join([repr(e)+':'+repr(l)fore,...
453,564
def iterative_dataflow_analysis(): print '[iterative type analysis..]' backup = backup_network() while True: getgx().iterations += 1 if getgx().iterations > 30: print '\n*WARNING* reached maximum number of iterations' break # --- propagate using cartesian product algorithm getgx().new_alloc_info = {} #print 'table' #...
defiterative_dataflow_analysis():print'[iterativetypeanalysis..]'backup=backup_network()whileTrue:getgx().iterations+=1ifgetgx().iterations>30:print'\n*WARNING*reachedmaximumnumberofiterations'break#---propagateusingcartesianproductalgorithmgetgx().new_alloc_info={}#print'table'#print'\n'.join([repr(e)+':'+repr(l)fore,...
453,565
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cartfor node in func.nodes: if node.constructor and isinstance(node.thing,...
453,566
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
453,567
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
453,568
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
453,569
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
453,570
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
defifa_seed_template(func,cart,dcpa,cpa,worklist):ifcart!=None:#(Nonemeanswearenotintheprocessofpropagation)#print'funccopy',func.ident#,func.nodesifisinstance(func.parent,class_):#selfcart=((func.parent,dcpa),)+cartfornodeinfunc.nodes:ifnode.constructorandisinstance(node.thing,(List,Dict,Tuple,ListComp,CallFunc)):#pri...
453,571
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
453,572
def ifa_seed_template(func, cart, dcpa, cpa, worklist): if cart != None: # (None means we are not in the process of propagation) #print 'funccopy', func.ident #, func.nodes if isinstance(func.parent, class_): # self cart = ((func.parent, dcpa),)+cart for node in func.nodes: if node.constructor and isinstance(node.thin...
defifa_seed_template(func,cart,dcpa,cpa,worklist):ifcart!=None:#(Nonemeanswearenotintheprocessofpropagation)#print'funccopy',func.ident#,func.nodesifisinstance(func.parent,class_):#selfcart=((func.parent,dcpa),)+cartfornodeinfunc.nodes:ifnode.constructorandisinstance(node.thing,(List,Dict,Tuple,ListComp,CallFunc)):#pri...
453,573
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites = ifa_flow_graph(cl, dcpa, node) if len(csites) == 1: continue if DEBUG: print...
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites, emptycsites = ifa_flow_graph(cl, dcpa, node) if len(csites)+len(emptycsites) ...
453,574
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites = ifa_flow_graph(cl, dcpa, node) if len(csites) == 1: continue if DEBUG: print...
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites = ifa_flow_graph(cl, dcpa, node) if len(csites) == 1: continue if DEBUG: print...
453,575
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, emptycsites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites =...
453,576
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = list(nr_classes[dcpa]) noconf = set([n for n in csites if len(n.paths)==1]+emptycsites) others = len(csites) + len(emptycsites) - len(...
453,577
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
453,578
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
453,579
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
def ifa_split_no_confusion(cl, dcpa, varnum, classes_nr, nr_classes, csites, allnodes, split): '''creation sites on single path: split them off, possibly reusing contour''' attr_types = nr_classes[dcpa] noconf = set([n for n in csites if len(n.paths)==1]) others = len(csites) - len(noconf) subtype_csites = {} for node ...
453,580
def ifa_flow_graph(cl, dcpa, node): creation_points, paths, assignsets = {}, {}, {} allnodes = set() csites = [] # --- determine assignment sets for a in node.in_: types = getgx().types[a] if types: if a.thing in getgx().assign_target: # XXX *args target = getgx().cnode[getgx().assign_target[a.thing], a.dcpa, a.cpa] #...
def ifa_flow_graph(cl, dcpa, node): creation_points, paths, assignsets = {}, {}, {} allnodes = set() csites = [] # --- determine assignment sets for a in node.in_: types = getgx().types[a] if types: if a.thing in getgx().assign_target: # XXX *args target = getgx().cnode[getgx().assign_target[a.thing], a.dcpa, a.cpa] #...
453,581
def hasmethod(cl, name): # XXX shared.py return name in cl.funcs and not cl.funcs[name].inherited and cpp.hmcpa(cl.funcs[name])
def hasmethod(cl, name): # XXX shared.py return name in cl.funcs and not cl.funcs[name].invisible and not cl.funcs[name].inherited and cpp.hmcpa(cl.funcs[name])
453,582
def woef(x): print x
def woef(x): print x
453,583
def _sum(l): # l: [pyiter(A)] first = True # [int] for e in l: # [pyiter(A)] if first: # [] result = e # [A] first = False # [int] else: result += e # [A] return result ...
def _sum(l): # l: [pyiter(A)] first = True # [int] for e in l: # [pyiter(A)] if first: # [] result = e # [A] first = False # [int] else: result += e # [A] return result ...
453,584
def solve_file(filename, sep, action): #=lambda x: x): "Parse a file into a sequence of 81-char descriptions and solve them." results = [action(search(parse_grid(grid))) for grid in file(filename).read().strip().split(sep)] print "## Got %d out of %d" % ( sum([(r is not False) for r in results]), len(results)) return r...
def solve_file(filename, sep, action): #=lambda x: x): "Parse a file into a sequence of 81-char descriptions and solve them." results = [action(search(parse_grid(grid))) for grid in file(filename).read().strip().split(sep)] print "## Got %d out of %d" % ( sum([(r is not None) for r in results]), len(results)) return re...
453,585
def map(ident): if cplusplus: return ident+' *' return conv.get(ident, ident)
def map(ident): if cplusplus: return ident+' *' return conv.get(ident, ident)
453,586
print >>gv.out, 'typedef struct {'
print >>gv.out, 'typedef struct {'
453,587
print >>gv.out, 'typedef struct {'
print >>gv.out, 'typedef struct {'
453,588
def convert_methods(gv, cl, declare): if declare: print >>gv.out, ' PyObject *__to_py__();' else: print >>gv.out, 'namespace __%s__ { /* XXX */\n' % cl.module.ident print >>gv.out, 'PyObject *%s::__to_py__() {' % cl.cpp_name print >>gv.out, ' if(__ss_proxy->has_key(this))' print >>gv.out, ' return (PyObje...
def convert_methods(gv, cl, declare): if declare: print >>gv.out, ' PyObject *__to_py__();' else: print >>gv.out, 'namespace __%s__ { /* XXX */\n' % cl.module.ident print >>gv.out, 'PyObject *%s::__to_py__() {' % cpp.nokeywords(cl.ident) print >>gv.out, ' if(__ss_proxy->has_key(this))' print >>gv.out, ' r...
453,589
def convert_methods(gv, cl, declare): if declare: print >>gv.out, ' PyObject *__to_py__();' else: print >>gv.out, 'namespace __%s__ { /* XXX */\n' % cl.module.ident print >>gv.out, 'PyObject *%s::__to_py__() {' % cl.cpp_name print >>gv.out, ' if(__ss_proxy->has_key(this))' print >>gv.out, ' return (PyObje...
def convert_methods(gv, cl, declare): if declare: print >>gv.out, ' PyObject *__to_py__();' else: print >>gv.out, 'namespace __%s__ { /* XXX */\n' % cl.module.ident print >>gv.out, 'PyObject *%s::__to_py__() {' % cl.cpp_name print >>gv.out, ' if(__ss_proxy->has_key(this))' print >>gv.out, ' return (PyObje...
453,590
print >>gv.out, 'typedef struct {'
print >>gv.out, 'typedef struct {'
453,591
def virtuals(self, cl, declare): for ident, subclasses in cl.virtuals.items(): if not subclasses: continue
def virtuals(self, cl, declare): for ident, subclasses in cl.virtuals.items(): if not subclasses: continue
453,592
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
def propagate(): #print 'propagate' seed_nodes() worklist = init_worklist() #print 'worklist', worklist getgx().checkcallfunc = [] # XXX # --- check whether seeded nodes are object/argument to call changed = set() for w in worklist: for callfunc in w.callfuncs: #print 'seed changed', w.callfunc, w.dcpa, w.cpa changed...
453,593
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites, emptycsites = ifa_flow_graph(cl, dcpa, node) if len(csites)+len(emptycsites) ...
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites, emptycsites = ifa_flow_graph(cl, dcpa, node) if len(csites)+len(emptycsites) ...
453,594
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites, emptycsites = ifa_flow_graph(cl, dcpa, node) if len(csites)+len(emptycsites) ...
def ifa_split_vars(cl, dcpa, vars, nr_classes, classes_nr, split): for (varnum, var) in enumerate(vars): if not (var, dcpa, 0) in getgx().cnode: continue node = getgx().cnode[var, dcpa, 0] creation_points, paths, assignsets, allnodes, csites, emptycsites = ifa_flow_graph(cl, dcpa, node) if len(csites)+len(emptycsites) ...
453,595
def main(args): BH.parse_cmd_line(args)
def main(args): BH.parse_cmd_line(args)
453,596
def _copy_array_if_base_present(a): """ Copies the array if its base points to a parent array. """ if a.base is not None: return a.copy() elif np.issubsctype(a, np.float32): return array(a, dtype=np.double) else: return a
def _copy_array_if_base_present(a): """ Copies the array if its base points to a parent array. """ if a.base is not None: return a.copy() elif np.issubsctype(a, np.float32): return np.array(a, dtype=np.double) else: return a
453,597
def fullsplit(path, result=None): """ Split a pathname into components (the opposite of os.path.join) in a platform-neutral way. """ if result is None: result = [] head, tail = os.path.split(path) if head == '': return [tail] + result if head == path: return result return fullsplit(head, [tail] + result)
def fullsplit(path, result=None): """ Split a pathname into components (the opposite of os.path.join) in a platform-neutral way. """ if result is None: result = [] head, tail = os.path.split(path) if head == '': return [tail] + result if head == path: return result return fullsplit(head, [tail] + result)
453,598
def __init__(self, field_name='', field=None, key_type=None, to_field=None, to_field_name=None, required=True, label='', localize=False, initial=None, widget=None, help_text='', ajax_func=None, queryset=None, error_messages=None, show_hidden_initial=False, shadow_field_name=None, *args, **kwargs):
def __init__(self, field_name='', field=None, key_type=None, to_field=None, to_field_name=None, required=True, label='', localize=False, initial=None, widget=None, help_text='', ajax_func=None, queryset=None, error_messages=None, show_hidden_initial=False, shadow_field_name=None, *args, **kwargs):
453,599