Best Python code snippet using slash
tagging.py
Source:tagging.py
...38 return self._tags[tag_name]39 def __contains__(self, tag_name):40 return tag_name in self._tags41 has_tag = __contains__42 def _check_conflicting_tags(self, other):43 for (44 tag_name,45 tag_value,46 ) in other._tags.items(): # pylint: disable=protected-access47 if self.get(tag_name, NOTHING) not in (tag_value, NOTHING):48 raise TaggingConflict(49 "Conflicting tag: {} when adding {}, {}".format(50 tag_name, self, other51 )52 )53 def __add__(self, other):54 if other is NO_TAGS:55 return self56 self._check_conflicting_tags(other)57 new_tags = self._tags.copy()58 new_tags.update(other._tags) # pylint: disable=protected-access59 return Tags(new_tags)60 def copy(self):61 return Tags(self._tags.copy())62 def update(self, other):63 if other is NO_TAGS:64 return65 self._check_conflicting_tags(other)66 self._tags.update(other._tags) # pylint: disable=protected-access67 def get(self, *args, **kwargs):68 return self._tags.get(*args, **kwargs)69 def matches_pattern(self, pattern, exact=False):70 if "=" in pattern:71 key, predicate = pattern.split("=", 1)72 value = self._tags.get(key, NOTHING)73 return value is not NOTHING and str(value) == predicate74 for key, value in self._tags.items():75 if exact:76 if pattern == key:77 return True78 else:79 if pattern in key:...
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!!