Best Python code snippet using toolium_python
pluginmanager.py
Source:pluginmanager.py
...88 def get_wrapper(self, ID:str)->Wrapper:89 '''è·åå
è£
å¨æ件å®ä¾, 失败è¿åNone90 '''91 return self.get_plugin(ID, Wrapper)92 def get_default_wrapper(self)->DefaultWrapper:93 '''è·åä¸ä¸ªé»è®¤çpayloadå
è£
å¨å®ä¾94 '''95 return DefaultWrapper()96 def get_plugin_id(self, plugin:Plugin)->Union[str, None]:97 '''æ ¹æ®æ件å®ä¾è·åæ件对åºçID98 :params plugin: éè¦æ¥æ¾IDçæ件å®ä¾99 :returns: è¿åæ件å®ä¾å¯¹åºçæ件IDï¼å¤±è´¥è¿åNone100 '''101 for ID, p in self.__plugin_map.items():102 if plugin.__class__ == p:103 return ID104 return None105 @property106 def plugins_map(self)->Dict[str, Type[Plugin]]:...
manager.py
Source:manager.py
2import panda3d.core as pc3from game.nodes.manager import Manager as GameManager4logger = logging.getLogger(__name__)5class Manager(GameManager):6 def get_default_wrapper(self, obj):7 if isinstance(obj, pc.NodePath):8 return self.wrappers['NodePath']9 else:10 return self.wrappers['NonGraphObject']11 def get_common_wrapper(self, comps):12 # Get method resolution orders for each wrapper for all the indicated13 # components.14 mros = []15 for comp in comps:16 comp_cls = self.get_wrapper(comp.data)17 if comp_cls is not None:18 mros.append(comp_cls.__mro__)19 if not mros:20 return self.get_default_wrapper(comps[0].data)21 # Intersect the mros to get the common classes.22 first_mro = mros[0]23 common_bases = sorted(24 set(first_mro).intersection(*mros),25 key=first_mro.index26 )27 dicts = {}28 dicts.update({'change_mro': False})29 try:30 common_wrapper = type(31 common_bases[0].__name__,32 tuple(common_bases),33 dicts#{'change_mro': False}34 )...
mobile_page_object.py
Source:mobile_page_object.py
...4from arc.page_objects.page_object import PageObject5class MobilePageObject(PageObject):6 def __new__(cls, driver_wrapper=None):7 if cls.__name__.startswith('Base'):8 __driver_wrapper = driver_wrapper if driver_wrapper else DriverManager.get_default_wrapper()9 __os_name = 'ios' if __driver_wrapper.is_ios_test() else 'android'10 __class_name = cls.__name__.replace('Base', __os_name.capitalize())11 try:12 return getattr(importlib.import_module(cls.__module__), __class_name)(__driver_wrapper)13 except AttributeError:14 __module_name = cls.__module__.replace('.base.', '.{}.'.format(__os_name))15 return getattr(importlib.import_module(__module_name), __class_name)(__driver_wrapper)16 else:...
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!!