Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class _E(data.__class__, EncapsulatedNode):
pass
_E.__name__ = str(node.tag)
_E._node = node
return _E(data)
def represent_encapsulated_node(s, o):
value = s.represent_data(o.__class__.__bases__[0](o))
value.tag = o.__class__.__name__
return value
ShyamlSafeDumper.add_multi_representer(EncapsulatedNode,
represent_encapsulated_node)
ShyamlSafeLoader.add_constructor(None, mk_encapsulated_node)
##
## Key specifier
##
def tokenize(s):
r"""Returns an iterable through all subparts of string splitted by '.'
So:
>>> list(tokenize('foo.bar.wiz'))
['foo', 'bar', 'wiz']