Best Python code snippet using pandera_python
CharClass.py
Source:CharClass.py  
...56    def unaccept_eps(self):57        self.start.eps_set.remove(self.end)58    def build(self, text):59        text = trim_blank(text)60        self.build_complex(text)61    def build_complex(self, text):62        sub_strs = get_substrs_by_or(text)63        if len(sub_strs) > 1:64            new_end = NFA_Node()65            for s in sub_strs:66                sub_automata = Thompson_AutoMata()67                sub_automata.build_complex(s)68                self.end.eps_set.add(sub_automata.start)69                sub_automata.end.eps_set.add(new_end)70            self.end = new_end71        else:72            self.build_single(sub_strs[0])73    def print_graph(self):74        q = []75        tabu = set()76        q.append(self.start)77        tabu.add(self.start)78        while len(q) != 0:79            #print(q[0].index)80            tmp = q[0]81            q = q[1:]82            for k, v in tmp.edges.iteritems():83                if v in tabu:84                    continue85                tabu.add(v)86                q.append(v)87            for v in tmp.eps_set:88                if v in tabu:89                    continue90                tabu.add(v)91                q.append(v)92    # the regex @depth 0 is a not with | rule93    def build_single(self, text):94        right = -195        if len(text) == 0:  # null str, eps trans96            return97        if text[0] == '(':98            right = get_match_right_bra(text, 0)99            assert right != -1, 'scan fail @substr %s' % (text,)100            am = Thompson_AutoMata()101            # do not build text[now : right + 1], it leads to a left recurs102            am.build_complex(text[1: right])103            # (...)*104            if right + 1 < len(text) and text[right + 1] == '*':105                self.start.eps_set.add(am.start)106                am.end.eps_set.add(self.end)107                am.end.eps_set.add(am.start)108                right = right + 2109            # ()(...)110            else:111                self.end.eps_set.add(am.start)112                self.end = am.end113                right += 1114        else:115            am = Thompson_AutoMata()116            am.unaccept_eps()117            if text[0] == '\\':118                am.start.edges[text[1]] = am.end119            else:120                am.start.edges[text[0]] = am.end121            self.end.eps_set.add(am.start)122            self.end = am.end123            if text[0] == '\\':124                right = 2125            else:126                right = 1127        am1 = Thompson_AutoMata()128        am1.build_complex(text[right:])129        # use an eps trans to merge the end state of cur automata \130        # and the begin state of new automata131        self.end.eps_set.add(am1.start)132        self.end = am1.end133if __name__ == '__main__':134    test_str = ''135    a = Thompson_AutoMata()136    a.build(test_str)...fun3d_aim.py
Source:fun3d_aim.py  
...56    @fluid_solver_settings.setter57    def fluid_solver_settings(self, new_settings:FluidSolverSettings):58        self._fluid_solver_settings = new_settings59    @property60    def build_complex(self) -> bool:61        return self._build_complex62    @build_complex.setter63    def build_complex(self, new_bool:bool):64        self._build_complex = new_bool65        if new_bool is True:66            self._print_perturb = True67    @property68    def analysis_type(self) -> str:69        return self._analysis_type70    @property71    def analysis_dir(self) -> str:72        return self.aim.analysisDir  73    @property74    def flow_directory(self) -> str:75        return os.path.join(self.analysis_dir, "Flow")76    @property77    def adjoint_directory(self) -> str:...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
