bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def distance(x, y): if (x < 0): x = -x if (y < 0): y = y*-1 return x + y | def distance(x, y): if (x < 0) and (y > 0): return y + abs(x) if (y < 0) and (x > 0): return x + abs(y) return abs(x - y) | 458,100 |
def finalize_options(self): if self.fix_python: import sys if sys.executable.endswith('/python2'): # this should be more sophisticated, but this # works for our needs here self.requires = self.requires.replace('python ', 'python2 ') self.build_requires = self.build_requires.replace('python ', 'python2 ') self.release =... | def finalize_options(self): if self.fix_python: import sys if sys.executable.endswith('/python2'): # this should be more sophisticated, but this # works for our needs here self.requires = self.requires.replace('python ', 'python2 ') self.build_requires = self.build_requires.replace('python ', 'python2 ') self.release =... | 458,101 |
def _get_recids_foreach_ontology(recids=None, collections=None, taxonomy=None): """Returns an array containing hash objects containing the collection, its corresponding ontology and the records belonging to the given collection.""" rec_onts = [] # User specified record IDs. if recids: rec_onts.append({ 'ontology': tax... | def _get_recids_foreach_ontology(recids=None, collections=None, taxonomy=None): """Returns an array containing hash objects containing the collection, its corresponding ontology and the records belonging to the given collection.""" rec_onts = [] # User specified record IDs. if recids: rec_onts.append({ 'ontology': tax... | 458,102 |
def get_keywords_body(keywords, req, recid, argd): """Returns the body associated with the keywords.""" body = [] rec = get_record(recid) extend_argd(argd) if keywords: weights_available = 0 not in zip(*keywords)[1] else: req.write('There are no keywords associated with this document.<br>' \ '<form action="" method="... | def get_keywords_body(keywords, req, recid, argd): """Returns the body associated with the keywords.""" body = [] rec = get_record(recid) extend_argd(argd) if keywords: weights_available = 0 not in zip(*keywords)[1] else: req.write('There are no keywords associated with this document.<br>' \ '<form action="" method="... | 458,103 |
def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | 458,104 |
def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | 458,105 |
def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | def __init__(self): self.screen = pygame.display.set_mode((800, 600),1) pygame.display.set_caption("Guaduelo v0.1") self.loader = Loader() self.game_board = GameBoard() self.side_panel = SidePanel() self.robot_mouse = RobotMouse() self.ai_player = AIPlayer(3) self.side_panel.ai_level = self.ai_player.level self.side... | 458,106 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,107 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,108 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,109 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,110 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,111 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,112 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,113 |
def main_loop(self): clock = pygame.time.Clock() | def elif event.key == K_F11: pygame.display.toggle_fullscreen() main_loop(self): elif event.key == K_F11: pygame.display.toggle_fullscreen() clock elif event.key == K_F11: pygame.display.toggle_fullscreen() = elif event.key == K_F11: pygame.display.toggle_fullscreen() pygame.time.Clock() | 458,114 |
def main_loop(self): clock = pygame.time.Clock() | def main_loop(self): clock = pygame.time.Clock() | 458,115 |
def __init__(self): self.loader = Loader() self.desk = self.loader.load_image("back.png") self.back = self.desk.copy() | def __init__(self): self.loader = Loader() self.desk = self.loader.load_image("back.png") self.back = self.desk.copy() | 458,116 |
def render_gameover(self,result): self.back.blit(self.desk,(0,0)) y = 275 x = 300 t = ["Empate!","Ganaste!","Perdiste!"] self._title(t[result],y,x); y+=50 self._text("Pulsa el raton para volver a jugar!",y,x) | def render_gameover(self,result): self.back.blit(self.desk,(0,0)) y = 275 x = 300 t = ["Empate!","Jugador Uno!","Jugador Dos!"] if t[result] != t[0]: self._title('Bien',y - 80,x) self._title(t[result],y,x); y+=50 self._text("Pulsa el raton para volver a jugar!",y,x) | 458,117 |
def execute_task(self, cr, uid, ids, context=None): """ Execute the task """ if context is None: context = {} | def execute_task(self, cr, uid, ids, context=None): """ Execute the task """ if context is None: context = {} | 458,118 |
def post(self, lot_id, type) : min_date = self.request.get('mindate') max_date = self.request.get('maxdate') min_hour = self.request.get('minhour') min_minute = self.request.get('minminute') max_hour = self.request.get('maxhour') max_minute = self.request.get('maxminute') | def post(self, lot_id, type) : min_date = self.request.get('mindate') max_date = self.request.get('maxdate') min_hour = self.request.get('minhour') min_minute = self.request.get('minminute') max_hour = self.request.get('maxhour') max_minute = self.request.get('maxminute') | 458,119 |
def post(self, lot_id, type) : min_date = self.request.get('mindate') max_date = self.request.get('maxdate') min_hour = self.request.get('minhour') min_minute = self.request.get('minminute') max_hour = self.request.get('maxhour') max_minute = self.request.get('maxminute') | def post(self, lot_id, type) : min_date = self.request.get('mindate') max_date = self.request.get('maxdate') min_hour = self.request.get('minhour') min_minute = self.request.get('minminute') max_hour = self.request.get('maxhour') max_minute = self.request.get('maxminute') | 458,120 |
def __init__(self, node_name): self.node_name = node_name | def __init__(self, node_name): self.node_name = node_name | 458,121 |
def __init__(self, node_name): self.node_name = node_name self.tucked = False | def __init__(self, node_name): self.node_name = node_name self.tucked = False | 458,122 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,123 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,124 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,125 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,126 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,127 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,128 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,129 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,130 |
def usage(): print __doc__ % vars() rospy.signal_shutdown("Help requested") | def usage(): print __doc__ % vars() rospy.signal_shutdown("Help requested") | 458,131 |
def usage(): print __doc__ % vars() rospy.signal_shutdown("Help requested") | def usage(): print __doc__ % vars() rospy.signal_shutdown("Help requested") | 458,132 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | 458,133 |
def stateCb(self, msg): l_sum_tucked = 0 l_sum_untucked = 0 r_sum_tucked = 0 r_sum_untucked = 0 for name_state, name_desi, value_state, value_l_tucked, value_l_untucked, value_r_tucked, value_r_untucked in zip(msg.joint_names, joint_names, msg.actual.positions , l_arm_tucked, l_arm_untucked, r_arm_tucked, r_arm_untucke... | defelse: rospy.spin() stateCb(self,else: rospy.spin() msg):else: rospy.spin() l_sum_tuckedelse: rospy.spin() =else: rospy.spin() 0else: rospy.spin() l_sum_untuckedelse: rospy.spin() =else: rospy.spin() 0else: rospy.spin() r_sum_tuckedelse: rospy.spin() =else: rospy.spin() 0else: rospy.spin() r_sum_untuckede... | 458,134 |
def is_address(s): return IPV4_ADDRESS_REGEX.match(s) is not None | def is_address(s): return IPV4_ADDRESS_REGEX.match(s) is not None | 458,135 |
def principalRemovingHandler(ev): sites = [getSite()] if sites[0] is not None: if IPortal.providedBy(site.__parent__): site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): manager.... | def principalRemovingHandler(ev): sites = [getSite()] if sites[0] is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): manager.unassign... | 458,136 |
def principalRemovingHandler(ev): site = getSite() if site is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] else: sites = [site] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): ma... | def principalRemovingHandler(ev): sites = [getSite()] if sites[0] is not None: if IPortal.providedBy(site.__parent__): site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] else: sites = [site] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, co... | 458,137 |
def principalRemovingHandler(ev): site = getSite() if site is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] else: sites = [site] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): ma... | def principalRemovingHandler(ev): site = getSite() if site is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): manager.unassignPersona... | 458,138 |
def principalRemovingHandler(ev): sites = [getSite()] if sites[0] is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): manager.unassign... | def principalRemovingHandler(ev): site = getSite() sites = [site] if site is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): manager.... | 458,139 |
def principalRemovingHandler(ev): site = getSite() if site is not None and site.__parent__ is not None: sites = [site.__parent__] + [site for site in site.__parent__.values() if ISite.providedBy(site)] else: sites = [site] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): man... | def principalRemovingHandler(ev): site = getSite() if site is not None: if site.__parent__ is not None: site = site.__parent__ sites = [site] + [site for site in site.values() if ISite.providedBy(site)] else: sites = [site] for site in sites: for name, manager in getUtilitiesFor(IPersonalSpaceManager, context=site): ma... | 458,140 |
def recognize_and_align(image,linerec,lmodel,beam=1000,nocseg=0): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's seg... | def recognize_and_align(image,linerec,lmodel,beam=1000,nocseg=0): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's seg... | 458,141 |
def add_line(fst,s): s = re.sub('\s+',' ',s) state = fst.Start() if state<0: state = fst.AddState() fst.SetStart(state) for i in range(len(s)): c = ord(s[i]) if c>=32 and c<128: pass else: # print "skipping %d"%c raise Exception("bad character %d in '%s'"%(c,s)) continue nstate = fst.AddState() if s[i]==" ": fst.AddArc... | def add_line(fst,s): s = re.sub('\s+',' ',s) state = fst.Start() if state<0: state = fst.AddState() fst.SetStart(state) for i in range(len(s)): c = ord(s[i]) if c>=32 and c<128: pass else: # print "skipping %d"%c raise Exception("bad character %d in '%s' (%s)"%(c,s,type(s))) continue nstate = fst.AddState() if s[i]==" ... | 458,142 |
def make_line_fst(lines): fst = Fst() for line in lines: add_line(fst,line) det = Fst() openfst.Determinize(fst,det) openfst.Minimize(det) temp = "/tmp/%d.fst"%os.getpid() det.Write(temp) result = ocropus.make_OcroFST() result.load(temp) os.unlink(temp) return result | def make_line_fst(lines): fst = Fst() count = 0 for line in lines: count += 1 try: add_line(fst,line) except: print "on line",count raise det = Fst() openfst.Determinize(fst,det) openfst.Minimize(det) temp = "/tmp/%d.fst"%os.getpid() det.Write(temp) result = ocropus.make_OcroFST() result.load(temp) os.unlink(temp) retu... | 458,143 |
def lines_of_file(file): for line in open(file).readlines(): if line[-1]=="\n": line = line[:-1] if line=="": continue yield line | def lines_of_file(file): for line in open(file).readlines(): if line[-1]=="\n": line = line[:-1] if line=="": continue yield unicode(line,"utf-8") | 458,144 |
def __init__(self,cmodel=None,segmenter="DpSegmenter",best=10,maxcost=10.0, minheight=0.5,minaspect=0.5,maxaspect=20.0): self.debug = 0 self.segmenter = components.make_ISegmentLine(segmenter) self.grouper = components.make_IGrouper("SimpleGrouper") # self.grouper.pset("maxdist",5) # self.grouper.pset("maxrange",5) sel... | def __init__(self,cmodel=None,segmenter="DpSegmenter",best=10,maxcost=10.0,minheight=0.5): self.debug = 0 self.segmenter = components.make_ISegmentLine(segmenter) self.grouper = components.make_IGrouper("SimpleGrouper") # self.grouper.pset("maxdist",5) # self.grouper.pset("maxrange",5) self.cmodel = cmodel self.best = ... | 458,145 |
def __init__(self,cmodel=None,segmenter="DpSegmenter",best=10,maxcost=10.0, minheight=0.5,minaspect=0.5,maxaspect=20.0): self.debug = 0 self.segmenter = components.make_ISegmentLine(segmenter) self.grouper = components.make_IGrouper("SimpleGrouper") # self.grouper.pset("maxdist",5) # self.grouper.pset("maxrange",5) sel... | def __init__(self,cmodel=None,segmenter="DpSegmenter",best=10,maxcost=10.0, minheight=0.5,minaspect=0.5,maxaspect=20.0): self.debug = 0 self.segmenter = components.make_ISegmentLine(segmenter) self.grouper = components.make_IGrouper("SimpleGrouper") # self.grouper.pset("maxdist",5) # self.grouper.pset("maxrange",5) sel... | 458,146 |
def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | 458,147 |
def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | 458,148 |
def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | def recognizeLineSeg(self,lattice,rseg,image,keep=0): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | 458,149 |
def recognize_and_align(image,linerec,lmodel,beam=10000): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's segment num... | def recognize_and_align(image,linerec,lmodel,beam=10000): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's segment num... | 458,150 |
def recognize_and_align(image,linerec,lmodel,beam=10000): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's segment num... | def recognize_and_align(image,linerec,lmodel,beam=10000): """Perform line recognition with the given line recognizer and language model. Outputs an object containing the result (as a Python string), the costs, the rseg, the cseg, the lattice and the total cost. The recognition lattice needs to have rseg's segment num... | 458,151 |
def compute_alignment(lattice,rseg,lmodel,beam=10000): """Given a lattice produced by a recognizer, a raw segmentation, and a language model, computes the best solution, the cseg, and the corresponding costs. These are returned as Python data structures. The recognition lattice needs to have rseg's segment numbers as ... | def compute_alignment(lattice,rseg,lmodel,beam=10000): """Given a lattice produced by a recognizer, a raw segmentation, and a language model, computes the best solution, the cseg, and the corresponding costs. These are returned as Python data structures. The recognition lattice needs to have rseg's segment numbers as ... | 458,152 |
def __init__(self): self.nonspace_cost = 4.0 self.space_cost = 4.0 self.aspect_threshold = 2.0 self.maxrange = 30 | def __init__(self): self.nonspace_cost = 4.0 self.space_cost = 9999.0 self.aspect_threshold = 2.0 self.maxrange = 30 | 458,153 |
def set_defaults(self): self.debug = 0 self.segmenter = components.make_ISegmentLine("DpSegmenter") self.grouper = components.make_IGrouper("SimpleGrouper") self.cmodel = None self.best = 10 self.maxcost = 10.0 self.reject_cost = 10.0 self.min_height = 0.5 self.rho_scale = 1.0 self.maxoverlap = 0.8 self.spacemodel = Si... | def set_defaults(self): self.debug = 0 self.segmenter = components.make_ISegmentLine("DpSegmenter") self.grouper = components.make_IGrouper("SimpleGrouper") self.cmodel = None self.best = 10 self.maxcost = 30.0 self.reject_cost = 10.0 self.min_height = 0.5 self.rho_scale = 1.0 self.maxoverlap = 0.8 self.spacemodel = Si... | 458,154 |
def recognizeLineSeg(self,lattice,rseg,image): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | def recognizeLineSeg(self,lattice,rseg,image): """Recognize a line. lattice: result of recognition rseg: intarray where the raw segmentation will be put image: line image to be recognized""" | 458,155 |
def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | 458,156 |
def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | 458,157 |
def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | def test_save(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) self.assertEquals(False, current.save()) self.failIf('plone.app.drafts.targetKey' in response.cookies) self.failIf('plone.app.drafts.draftName' in response.cookies) self.failIf('plone.app.drafts.path... | 458,158 |
def test_discard(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) current.discard() deletedToken = {'expires': 'Wed, 31-Dec-97 23:59:59 GMT', 'max_age': 0, 'path': '/', 'value': 'deleted'} self.assertEquals(deletedToken, response.cookies['plone.app.drafts.targe... | def test_discard(self): request = self.app.REQUEST response = request.response current = ICurrentDraftManagement(request) current.discard() deletedToken = {'expires': 'Wed, 31-Dec-97 23:59:59 GMT', 'max_age': 0, 'path': '/', 'quoted': True, 'value': 'deleted'} self.assertEquals(deletedToken, response.cookies['plone.... | 458,159 |
def beforeAttributeValueState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == u"\"": self.state = self.attributeValueDoubleQuotedState elif data == u"&": self.state = self.attributeValueUnQuotedState self.stream.unget(data); elif data == u"'": self... | def beforeAttributeValueState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == u"\"": self.state = self.attributeValueDoubleQuotedState elif data == u"&": self.state = self.attributeValueUnQuotedState self.stream.unget(data); elif data == u"'": self... | 458,160 |
def attributeValueUnQuotedState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeAttributeNameState elif data == u"&": self.processEntityInAttribute(">") elif data == u">": self.emitCurrentToken() elif data in (u'"', u"'", u"=", u"<", u"`"): self.tokenQueue.append({"type": tokenTypes... | def attributeValueUnQuotedState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeAttributeNameState elif data == u"&": self.processEntityInAttribute(">") elif data == u">": self.emitCurrentToken() elif data in (u'"', u"'", u"=", u"<", u"`"): self.tokenQueue.append({"type": tokenTypes... | 458,161 |
def startTagInput(self, token): self.parser.parseError("unexpected-input-in-select") if not self.tree.elementInScope("select", variant="select"): assert self.parser.innerHTML self.endTagSelect(impliedTagToken("select")) return token | def startTagInput(self, token): self.parser.parseError("unexpected-input-in-select") if self.tree.elementInScope("select", variant="select"): self.endTagSelect(impliedTagToken("select")) return token | 458,162 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,163 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,164 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,165 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,166 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,167 |
def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... | 458,168 |
def __init__(self, parser, tree): Phase.__init__(self, parser, tree) | def __init__(self, parser, tree): Phase.__init__(self, parser, tree) | 458,169 |
def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 458,170 |
def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 458,171 |
def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 458,172 |
def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 458,173 |
def endTagHtml(self, token): self.endTagBody(impliedTagToken("body")) if not self.parser.innerHTML: self.parser.phase.processEndTag(token) | def endTagHtml(self, token): if self.tree.elementInScope("body"): self.endTagBody(impliedTagToken("body")) self.parser.phase.processEndTag(token) | 458,174 |
def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) return token else: # innerHTML case assert self.parser.innerHTML self.parser.parseError() | def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) return token else: # innerHTML caseself.parser.parseError() | 458,175 |
def startTagMeta(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True | def startTagMeta(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True | 458,176 |
def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False | def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False | 458,177 |
def processCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) self.parser.framesetOK = False | def processCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) self.parser.framesetOK = False | 458,178 |
def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False | def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False | 458,179 |
def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True): """ strict - raise an exception when a parse error is encountered | def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True, debug=False): """ strict - raise an exception when a parse error is encountered | 458,180 |
def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True): """ strict - raise an exception when a parse error is encountered | def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True): """ strict - raise an exception when a parse error is encountered | 458,181 |
def log(function): """Logger that records which phase processes each token""" type_names = dict((value, key) for key, value in constants.tokenTypes.iteritems()) def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except... | def getPhases(debug): def log(function): """Logger that records which phase processes each token""" type_names = dict((value, key) for key, value in constants.tokenTypes.iteritems()) def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[... | 458,182 |
def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except: print token raise if token['type'] in constants.tagTokenTypes: info["name"] = token['name'] | def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except: print token raise if token['type'] in constants.tagTokenTypes: info["name"] = token['name'] | 458,183 |
def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 458,184 |
def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() self.parser.phase.processEndTag(token) | def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) self.anythingElse() self.parser.phase.processStartTag(token) def processEndTag(self, token): self.parser.parseError("expected-doctype-but-got-end-tag... | 458,185 |
def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() self.parser.phase.processEndTag(token) | def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() self.parser.phase.processEndTag(token) | 458,186 |
def processSpaceCharactersDropNewline(self, token): # Sometimes (start of <pre>, <listing>, and <textarea> blocks) we # want to drop leading newlines data = token["data"] self.processSpaceCharacters = self.processSpaceCharactersNonPre if (data.startswith("\n") and self.tree.openElements[-1].name in ("pre", "listing", "... | def processSpaceCharactersDropNewline(self, token): # Sometimes (start of <pre>, <listing>, and <textarea> blocks) we # want to drop leading newlines data = token["data"] self.processSpaceCharacters = self.processSpaceCharactersNonPre if (data.startswith("\n") and self.tree.openElements[-1].name in ("pre", "listing", "... | 458,187 |
def startTagForm(self, token): if self.tree.formPointer: self.parser.parseError(u"unexpected-start-tag", {"name": "form"}) else: if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.tree.formPointer = self.tree.openElements[-1] | def startTagForm(self, token): if self.tree.formPointer: self.parser.parseError(u"unexpected-start-tag", {"name": "form"}) else: if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.tree.formPointer = self.tree.openElements[-1] | 458,188 |
def startTagListItem(self, token): self.parser.framesetOK = False | def startTagListItem(self, token): self.parser.framesetOK = False | 458,189 |
def startTagNobr(self, token): self.tree.reconstructActiveFormattingElements() if self.tree.elementInScope("nobr"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "nobr", "endName": "nobr"}) self.processEndTag(impliedTagToken("nobr")) # XXX Need tests that trigger the following self.tree.r... | def startTagNobr(self, token): self.tree.reconstructActiveFormattingElements() if self.tree.elementInScope("nobr"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "nobr", "endName": "nobr"}) self.processEndTag(impliedTagToken("nobr")) # XXX Need tests that trigger the following self.tree.r... | 458,190 |
def startTagButton(self, token): if self.tree.elementInScope("button"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "button", "endName": "button"}) self.processEndTag(impliedTagToken("button")) self.parser.phase.processStartTag(token) else: self.tree.reconstructActiveFormattingElements(... | def startTagButton(self, token): if self.tree.elementInScope("button"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "button", "endName": "button"}) self.processEndTag(impliedTagToken("button")) self.parser.phase.processStartTag(token) else: self.tree.reconstructActiveFormattingElements(... | 458,191 |
def startTagAppletMarqueeObject(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertElement(token) self.tree.activeFormattingElements.append(Marker) self.parser.framesetOK = False | def startTagAppletMarqueeObject(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertElement(token) self.tree.activeFormattingElements.append(Marker) self.parser.framesetOK = False | 458,192 |
def startTagTable(self, token): if self.parser.compatMode != "quirks": if self.tree.elementInScope("p"): self.processEndTag(impliedTagToken("p")) self.tree.insertElement(token) self.parser.framesetOK = False self.parser.phase = self.parser.phases["inTable"] | def startTagTable(self, token): if self.parser.compatMode != "quirks": if self.tree.elementInScope("p"): self.processEndTag(impliedTagToken("p")) self.tree.insertElement(token) self.parser.framesetOK = False self.parser.phase = self.parser.phases["inTable"] | 458,193 |
def startTagMath(self, token): self.tree.reconstructActiveFormattingElements() self.parser.adjustMathMLAttributes(token) self.parser.adjustForeignAttributes(token) token["namespace"] = namespaces["mathml"] self.tree.insertElement(token) #Need to get the parse error right for the case where the token #has a namespace no... | def startTagMath(self, token): self.tree.reconstructActiveFormattingElements() self.parser.adjustMathMLAttributes(token) self.parser.adjustForeignAttributes(token) token["namespace"] = namespaces["mathml"] self.tree.insertElement(token) #Need to get the parse error right for the case where the token #has a namespace no... | 458,194 |
def startTagMisplaced(self, token): """ Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" """ self.parser.parseError("unex... | def startTagMisplaced(self, token): """ Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" """ self.parser.parseError("unex... | 458,195 |
def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... | def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... | 458,196 |
def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... | def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... | 458,197 |
def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | 458,198 |
def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | 458,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.