Best Python code snippet using tempest_python
update.py
Source:update.py  
...25        updates = []26        for label, url in self.urls.items():27            updates_tags = self._find_updates(url)28            for u in updates_tags:29                updates.append(self._process_update_tag(u, label, url))30        self.updates = pd.DataFrame(updates)31    def _process_update_tag(self, update_tag, label, url):32        update_url = self._url_from_raw_html(update_tag)33        if not update_url:34            update_url = url35        return {36            'municipality': self.municipality,37            'institution': self.institution,38            'label': label,39            'title': self._title_from_raw_html(update_tag),40            'date': self._date_from_raw_html(update_tag),41            'content': self._content_from_raw_html(update_tag),42            'url': update_url43        }44    def wait_staleness(self, element):45        def not_staleness_of(element):...update_dataset.py
Source:update_dataset.py  
...82    for path, row in data.items():83        if posixpath.dirname(path) == '/system/${LIB}':84            row[1] = 'FWK-ONLY'85    # Helper function to update the tag and the comments of an entry86    def update_tag(path, tag, comments=None):87        try:88            data[path][1] = tag89            if comments is not None:90                data[path][2] = comments91        except KeyError:92            data[path] = [path, tag, comments if comments is not None else '']93    # Helper function to find the subdir and the module name94    def get_subdir_and_name(name, name_path_dict, prefix_core, prefix_vendor):95        try:96            path = name_path_dict[name + '.vendor']97            assert path.startswith(prefix_vendor)98            name_vendor = path[len(prefix_vendor):]99        except KeyError:100            name_vendor = name + '.so'101        try:102            path = name_path_dict[name]103            assert path.startswith(prefix_core)104            name_core = path[len(prefix_core):]105        except KeyError:106            name_core = name + '.so'107        assert name_core == name_vendor108        return name_core109    # Update LL-NDK tags110    prefix_core = '/system/${LIB}/'111    for name in llndk:112        try:113            path = name_path_dict[name]114            assert path.startswith(prefix_core)115            name = path[len(prefix_core):]116        except KeyError:117            name = name + '.so'118        update_tag('/system/${LIB}/' + name, 'LL-NDK')119    # Update VNDK-SP and VNDK-SP-Private tags120    prefix_core = '/system/${LIB}/'121    prefix_vendor = '/system/${LIB}/vndk-sp${VNDK_VER}/'122    for name in (vndk_sp - vndk_private):123        name = get_subdir_and_name(name, name_path_dict, prefix_core,124                                   prefix_vendor)125        update_tag(prefix_core + name, 'VNDK-SP')126        update_tag(prefix_vendor + name, 'VNDK-SP')127    for name in (vndk_sp & vndk_private):128        name = get_subdir_and_name(name, name_path_dict, prefix_core,129                                   prefix_vendor)130        update_tag(prefix_core + name, 'VNDK-SP-Private')131        update_tag(prefix_vendor + name, 'VNDK-SP-Private')132    # Update VNDK and VNDK-Private tags133    prefix_core = '/system/${LIB}/'134    prefix_vendor = '/system/${LIB}/vndk${VNDK_VER}/'135    for name in (vndk - vndk_private):136        name = get_subdir_and_name(name, name_path_dict, prefix_core,137                                   prefix_vendor)138        update_tag(prefix_core + name, 'VNDK')139        update_tag(prefix_vendor + name, 'VNDK')140    for name in (vndk & vndk_private):141        name = get_subdir_and_name(name, name_path_dict, prefix_core,142                                   prefix_vendor)143        update_tag(prefix_core + name, 'VNDK-Private')144        update_tag(prefix_vendor + name, 'VNDK-Private')145    # Workaround for FWK-ONLY-RS146    libs = [147        'libft2',148        'libmediandk',149    ]150    for name in libs:151        update_tag('/system/${LIB}/' + name + '.so', 'FWK-ONLY-RS')152    # Workaround for LL-NDK-Private153    libs = [154        'ld-android',155        'libc_malloc_debug',156        'libnetd_client',157    ]158    for name in libs:159        update_tag('/system/${LIB}/' + name + '.so', 'LL-NDK-Private')160    # Workaround for extra VNDK-SP-Private.  The extra VNDK-SP-Private shared161    # libraries are VNDK-SP-Private when BOARD_VNDK_VERSION is set but are not162    # VNDK-SP-Private when BOARD_VNDK_VERSION is set.163    libs = [164        'libdexfile',165    ]166    prefix_core = '/system/${LIB}/'167    prefix_vendor = '/system/${LIB}/vndk-sp${VNDK_VER}/'168    for name in libs:169        assert name not in vndk_sp170        assert name not in vndk_private171        name = get_subdir_and_name(name, name_path_dict, prefix_core,172                                   prefix_vendor)173        update_tag(prefix_core + name, 'VNDK-SP-Private',174                   'Workaround for degenerated VDNK')175        update_tag(prefix_vendor + name, 'VNDK-SP-Private',176                   'Workaround for degenerated VDNK')177    # Workaround for libclang_rt.asan178    prefix = 'libclang_rt.asan'179    if any(name.startswith(prefix) for name in llndk):180        for path in list(data.keys()):181            if os.path.basename(path).startswith(prefix):182                update_tag(path, 'LL-NDK')183    # Workaround for libclang_rt.ubsan_standalone184    prefix = 'libclang_rt.ubsan_standalone'185    if any(name.startswith(prefix) for name in vndk):186        for path in list(data.keys()):187            if os.path.basename(path).startswith(prefix):188                update_tag(path, 'VNDK')189    # Merge regular expression patterns into final dataset190    for regex in regex_patterns:191        data[regex[0]] = regex192    # Write updated eligible list file193    with open(args.output, 'w') as fp:194        writer = csv.writer(fp, lineterminator='\n')195        writer.writerow(header)196        writer.writerows(sorted(data.values()))197if __name__ == '__main__':...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!!
