# -*- coding: utf-8 -*- # http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
except ImportError: num = None
except ImportError: from yaml import SafeLoader, SafeDumper
'Object', 'SObject', 'String', 'Unicode', 'Int', 'Float', 'Complex', 'Bool', 'Timestamp', 'DateTimestamp', 'StringPattern', 'UnicodePattern', 'StringChoice', 'List', 'Dict', 'Tuple', 'Union', 'Choice', 'Any']
return dumper.represent_scalar( 'tag:yaml.org,2002:str', str(data), style=style)
None: lambda x: x, '|': literal, '>': folded, "'": singlequoted, '"': doublequoted}
None: list, 'block': blist, 'flow': flist}
return dumper.represent_sequence( 'tag:yaml.org,2002:seq', data, flow_style=flow_style)
return dumper.represent_float(float(data))
return dumper.represent_int(int(data))
return cc_to_us_regex2.sub('\\1_\\2', cc_to_us_regex1.sub( '\\1_\\2\\3', s)).lower()
return s.encode('utf-8')
return s
return cc_to_us(xmltagname)
else:
'''Decorator to enhance functions taking stream objects.
Wraps a function f(..., stream, ...) so that it can also be called as f(..., filename='myfilename', ...) or as f(..., string='mydata', ...). '''
kwargs['stream'] = stream return f(*args, **kwargs)
def wrap_generator(gen): try: for x in gen: yield x
except GeneratorExit: pass
stream.close()
return wrap_generator(retval)
else:
elif string is not None: assert mode == 'r', \ 'Keyword argument string=... cannot be used in dumper ' \ 'function.'
kwargs['stream'] = BytesIO(string.encode('utf-8')) return f(*args, **kwargs)
else: assert mode == 'w', \ 'Use keyword argument stream=... or filename=... in ' \ 'loader function.'
sout = BytesIO() f(stream=sout, *args, **kwargs) return sout.getvalue().decode('utf-8')
global g_iprop if kwargs.get('position', None) is None: kwargs['position'] = g_iprop
g_iprop += 1
self.classname = classname self.args = args self.kwargs = kwargs
def init_propertystuff(cls):
self, default=None, optional=False, xmlstyle='element', xmltagname=None, xmlns=None, help=None, position=None):
global g_iprop self.position = position else:
self._default_cmp = self._default.make() else:
else: return self._default_cmp == val
if self.name is not None: return self.name elif self.parent is not None: return 'element of %s' % self.parent.xname() else: return '?'
+ make_xmltagname_from_name(self.name) elif self.xmltagname: return self.get_xmlns() + ' ' + self.xmltagname else: assert False
def get_property(cls, name): for prop in cls.properties: if prop.name == name: return prop
raise ValueError()
def remove_property(cls, name):
prop = cls.get_property(name)
if not prop.multivalued: del cls.xmltagname_to_class[prop.effective_xmltagname] del cls.xmltagname_to_name[prop.effective_xmltagname] else: del cls.xmltagname_to_class[prop.content_t.effective_xmltagname] del cls.xmltagname_to_name_multivalued[ prop.content_t.effective_xmltagname]
if cls.content_property is prop: cls.content_property = None
cls.properties.remove(prop) cls.propnames.remove(name)
return prop
def add_property(cls, name, prop):
for tc in prop.choices: tc.effective_xmltagname = tc.get_xmltagname() cls.xmltagname_to_class[tc.effective_xmltagname] = tc.cls cls.xmltagname_to_name[tc.effective_xmltagname] = prop.name else: prop.content_t.get_xmltagname() prop.content_t.effective_xmltagname] = prop.content_t.cls prop.content_t.effective_xmltagname] = prop.name
def ivals(cls, val): for prop in cls.properties: yield getattr(val, prop.name)
def ipropvals(cls, val):
def inamevals(cls, val): for prop in cls.properties: yield prop.name, getattr(val, prop.name)
not (prop.optional or (prop.multivalued and not v)) or (not prop.is_default(v))):
yield prop, prop.to_save_xml(v) else:
def translate_from_xml(cls, list_of_pairs, strict): d = {} for k, v in list_of_pairs: if k in cls.xmltagname_to_name_multivalued: k2 = cls.xmltagname_to_name_multivalued[k] if k2 not in d: d[k2] = []
d[k2].append(v) elif k in cls.xmltagname_to_name: k2 = cls.xmltagname_to_name[k] if k2 in d: raise ArgumentError( 'Unexpectedly found more than one child element "%s" ' 'within "%s".' % (k, cls.tagname))
d[k2] = v elif k is None: if cls.content_property: k2 = cls.content_property.name d[k2] = v else: if strict: raise ArgumentError( 'Unexpected child element "%s" found within "%s".' % ( k, cls.tagname))
return d
self.strict and not is_exact
except ValueError: raise ValidationError( '%s: could not convert "%s" to type %s' % ( self.xname(), val, self.cls.__name__)) else: raise ValidationError( '%s: "%s" (type: %s) is not of type %s' % ( self.xname(), val, type(val), self.cls.__name__))
and isinstance(val, self.cls) and \ hasattr(val, 'T'): # derived classes only: validate with derived class validator validator = val.T.instance
return self.cls(val)
setattr(val, prop.name, newpropval)
return self.to_save(val)
if self.multivalued: for x in v: elems.append((self.content_t.effective_xmltagname, x)) else: elems.append((self.effective_xmltagname, v))
else: self.dummy_cls.__name__) else: self.dummy_cls.__module__, self.dummy_cls.__name__) else:
return '``%s``%s' % (cls, sadd)
else:
def props_help_string(cls):
prop.classname_for_help(strip_module=cls.dummy_cls.__module__)]
def class_help_string(cls):
def class_signature(cls): r = [] for prop in cls.properties: d = prop.default() if d is not None: arg = repr(d)
elif prop.optional: arg = 'None'
else: arg = '...'
r.append('%s=%s' % (prop.name, arg))
return '(%s)' % ', '.join(r)
def help(cls): return cls.props_help_string()
else:
else:
else:
else:
else: T.tagname = classname else: else: T.tagname = classname
for defer in prop.deferred(): g_deferred_content.setdefault( defer.classname[:-2], []).append((prop, defer)) g_deferred.setdefault( defer.classname[:-2], []).append((T, k, prop))
else:
g_deferred.setdefault(prop.classname[:-2], []).append( (T, k, prop))
for prop, defer in g_deferred_content[classname]: prop.process_deferred( defer, T(*defer.args, **defer.kwargs))
del g_deferred_content[classname]
for (T_, k_, prop_) in g_deferred.get(classname, []): if isinstance(prop_, Defer): prop_ = T(*prop_.args, **prop_.kwargs)
if not prop_.deferred(): T_.add_property(k_, prop_)
del g_deferred[classname]
return x.make() else:
self.cls = cls self.args = args self.kwargs = kwargs
return self.cls( *[make_default(x) for x in self.args], **dict((k, make_default(v)) for (k, v) in self.kwargs.items()))
return
else: raise ArgumentError('Missing argument to %s: %s' % ( self.T.tagname, prop.name)) else:
raise ArgumentError('Invalid argument to %s: %s' % ( self.T.tagname, ', '.join(list(kwargs.keys()))))
def D(cls, *args, **kwargs): return DefaultMaker(cls, args, kwargs)
self.validate(regularize=True, depth=depth)
return dump(self, stream=stream, filename=filename, header=header)
self, stream=None, filename=None, header=False, ns_ignore=False): return dump_xml( self, stream=stream, filename=filename, header=header, ns_ignore=ns_ignore)
return load(stream=stream, filename=filename, string=string)
ns_ignore=False):
if ns_hints is None: ns_hints = [cls.T.instance.get_xmlns()]
return load_xml( stream=stream, filename=filename, string=string, ns_hints=ns_hints, ns_ignore=ns_ignore)
def __str__(self): return self.dump()
''' Get dict of guts object attributes.
:param obj: :py:class`Object` object '''
return dict(obj.T.inamevals(obj))
if isinstance(val, (str, newstr)): return self.cls(val)
return val
return str(val)
return str(val)
if isinstance(val, Object): val.validate(regularize, depth)
return val
return repr(value)
return repr(value)
if isinstance(val, list) or isinstance(val, tuple): assert len(val) == 2 val = complex(*val)
elif not isinstance(val, complex): val = complex(val)
return val
return repr(value)
return repr(value)
if isinstance(val, (str, newstr)): if val.lower().strip() in ('0', 'false'): return False
return bool(val)
return repr(bool(value)).lower()
(make_default(k), make_default(v)) for (k, v) in self._default.items())
return None else:
del val[key] val[newkey] = newele
for (k, v) in val.items())
raise NotImplementedError()
self.content_t.classname_for_help(strip_module=strip_module)
return None else:
return [self.content_t.to_save_xml(v) for v in val]
return [self.content_t]
if defer is self.content_t: self.content_t = t_inst
self.content_t.classname_for_help(strip_module=strip_module)
class TL(List): class __T(List.T): def __init__(self, *args, **kwargs): List.T.__init__(self, content_t=t.T(), *args, **kwargs)
return TL
make_default(x) for x in self._default)
else: self.content_t.default() for x in range(self.n)) else:
return True
if self.n is not None and len(val) != self.n: raise ValidationError( '%s should have length %i' % (self.xname(), self.n))
if not regularize: for ele in val: self.content_t.validate(ele, regularize, depth-1)
return val else: newval = [] isnew = False for ele in val: newele = self.content_t.validate(ele, regularize, depth-1) newval.append(newele) if newele is not ele: isnew = True
if isnew: return tuple(newval) else: return val
return tuple(self.content_t.to_save(v) for v in val)
return [self.content_t.to_save_xml(v) for v in val]
self.n, self.content_t.classname_for_help( strip_module=strip_module)) else: self.content_t.classname_for_help( strip_module=strip_module))
if isinstance(val, datetime.datetime): tt = val.utctimetuple() val = calendar.timegm(tt) + val.microsecond * 1e-6
elif isinstance(val, datetime.date): tt = val.timetuple() val = float(calendar.timegm(tt))
elif isinstance(val, (str, newstr)): val = val.strip() tz_offset = 0
m = re_tz.search(val) if m: sh = m.group(2) sm = m.group(4) tz_offset = (int(sh)*3600 if sh else 0) \ + (int(sm)*60 if sm else 0)
val = re_tz.sub('', val)
if len(val) > 10 and val[10] == 'T': val = val.replace('T', ' ', 1)
try: val = str_to_time(val) - tz_offset except TimeStrError: raise ValidationError( '%s: cannot parse time/date: %s' % (self.xname(), val))
elif isinstance(val, int): val = float(val)
else: raise ValidationError( '%s: cannot convert "%s" to float' % (self.xname(), val))
return val
return datetime.datetime.utcfromtimestamp(val)
return datetime.datetime.utcfromtimestamp(val).isoformat() + 'Z'
if isinstance(val, datetime.datetime): tt = val.utctimetuple() val = calendar.timegm(tt) + val.microsecond * 1e-6
elif isinstance(val, datetime.date): tt = val.timetuple() val = float(calendar.timegm(tt))
elif isinstance(val, (str, newstr)): val = str_to_time(val, format='%Y-%m-%d')
elif isinstance(val, int): val = float(val)
return val
return time_to_str(val, format='%Y-%m-%d')
return time_to_str(val, format='%Y-%m-%d')
'''Any ``str`` matching pattern ``%(pattern)s``.'''
self.pattern = pattern else:
pat = self.pattern if not re.search(pat, val): raise ValidationError('%s: "%s" does not match pattern %s' % ( self.xname(), val, repr(pat)))
def class_help_string(cls):
'''Any ``unicode`` matching pattern ``%(pattern)s``.'''
self.pattern = pattern else:
pat = self.pattern if not re.search(pat, val, flags=re.UNICODE): raise ValidationError('%s: "%s" does not match pattern %s' % ( self.xname(), val, repr(pat)))
def class_help_string(cls):
'''Any ``str`` out of ``%(choices)s``.'''
else:
self.ignore_case = ignore_case else:
self.choices = [x.upper() for x in self.choices]
val = val.upper()
raise ValidationError( '%s: "%s" is not a valid choice out of %s' % ( self.xname(), val, repr(self.choices)))
def class_help_string(cls):
# this will not always work...
self.members = members else:
assert self.members e2 = None for member in self.members: try: return member.validate(val, regularize, depth=depth) except ValidationError as e: e2 = e
raise e2
self.choices = choices else:
(t.cls, t.get_xmltagname()) for t in self.choices)
if self.optional and val is None: return val
t = None for tc in self.choices: is_derived = isinstance(val, tc.cls) is_exact = type(val) == tc.cls if not (not tc.strict and not is_derived or tc.strict and not is_exact):
t = tc break
if t is None: if regularize: ok = False for tc in self.choices: try: val = tc.regularize_extra(val) ok = True t = tc break except (ValidationError, ValueError): pass
if not ok: raise ValidationError( '%s: could not convert "%s" to any type out of ' '(%s)' % (self.xname(), val, ','.join( x.cls.__name__ for x in self.choices))) else: raise ValidationError( '%s: "%s" (type: %s) is not of any type out of ' '(%s)' % (self.xname(), val, type(val), ','.join( x.cls.__name__ for x in self.choices)))
validator = t if type(val) != t.cls and isinstance(val, t.cls): validator = val.T.instance
validator.validate_extra(val)
if depth != 0: val = validator.validate_children(val, regularize, depth)
return val
elems.append(( self.cls_to_xmltagname[type(v)].split(' ', 1)[-1], v))
object, stream, header=False, Dumper=GutsSafeDumper, _dump_function=yaml.dump):
else: enc = no_encode
stream.write(enc(u'%YAML 1.1\n')) if isinstance(header, (str, newstr)): banner = u'\n'.join('# ' + x for x in header.splitlines()) + '\n' stream.write(enc(banner))
object, stream=stream, encoding='utf-8', explicit_start=True, Dumper=Dumper)
_dump(object, stream=stream, header=header, _dump_function=yaml.dump_all)
return list(yaml.load_all(stream=stream, Loader=Loader))
return yaml.load_all(stream=stream, Loader=Loader)
'!'+data.T.tagname, data.T.inamevals_to_save(data), flow_style=False)
# hack for compatibility with early GF Store versions r'^pyrocko\.(trace|gf\.(meta|seismosizer)|fomosto\.' r'(dummy|poel|qseis|qssp))\.' )
'tag:yaml.org,2002:map', data, flow_style=False)
'tag:yaml.org,2002:str', unicode(data))
ns_ignore=False):
self.stack = [] self.queue = [] self.namespaces = defaultdict(list) self.add_namespace_maps = add_namespace_maps self.strict = strict self.ns_hints = ns_hints self.ns_ignore = ns_ignore
if self.ns_ignore: ns_name = ns_name.split(' ')[-1]
if -1 == ns_name.find(' '): if self.ns_hints is None and ns_name in g_guessable_xmlns: self.ns_hints = g_guessable_xmlns[ns_name]
if self.ns_hints: ns_names = [ ns_hint + ' ' + ns_name for ns_hint in self.ns_hints]
elif self.ns_hints is None: ns_names = [' ' + ns_name]
else: ns_names = [ns_name]
for ns_name in ns_names: if self.stack and self.stack[-1][1] is not None: cls = self.stack[-1][1].T.xmltagname_to_class.get( ns_name, None)
if cls is not None and ( not issubclass(cls, Object) or issubclass(cls, SObject)): cls = None else: cls = g_xmltagname_to_class.get(ns_name, None)
if cls: break
self.stack.append((ns_name, cls, attrs, [], []))
ns_name, cls, attrs, content2, content1 = self.stack.pop()
ns = ns_name.split(' ', 1)[0]
if cls is not None: content2.extend( (ns + ' ' + k if -1 == k.find(' ') else k, v) for (k, v) in attrs.items()) content2.append((None, ''.join(content1))) o = cls(**cls.T.translate_from_xml(content2, self.strict)) o.validate(regularize=True, depth=1) if self.add_namespace_maps: o.namespace_map = self.get_current_namespace_map()
if self.stack and not all(x[1] is None for x in self.stack): self.stack[-1][-2].append((ns_name, o)) else: self.queue.append(o) else: content = [''.join(content1)] if self.stack: for c in content: self.stack[-1][-2].append((ns_name, c))
if self.stack: self.stack[-1][-1].append(char_content)
self.namespaces[ns].append(uri)
self.namespaces[ns].pop()
return dict((k, v[-1]) for (k, v) in self.namespaces.items() if v)
queue = self.queue self.queue = [] return queue
stream, bufsize=100000, add_namespace_maps=False, strict=False, ns_hints=None, ns_ignore=False):
from xml.parsers.expat import ParserCreate
parser = ParserCreate('UTF-8', namespace_separator=' ')
handler = Constructor( add_namespace_maps=add_namespace_maps, strict=strict, ns_hints=ns_hints, ns_ignore=ns_ignore)
parser.StartElementHandler = handler.start_element parser.EndElementHandler = handler.end_element parser.CharacterDataHandler = handler.characters parser.StartNamespaceDeclHandler = handler.start_namespace parser.EndNamespaceDeclHandler = handler.end_namespace
while True: data = stream.read(bufsize) parser.Parse(data, bool(not data)) for element in handler.get_queued_elements(): yield element
if not data: break
return list(_iload_all_xml(*args, **kwargs))
g = _iload_all_xml(*args, **kwargs) return next(g)
if not getattr(stream, 'encoding', None): enc = encode_utf8 else: enc = no_encode
_dump_xml_header(stream, header)
beg = u'<%s>\n' % root_element_name end = u'</%s>\n' % root_element_name
stream.write(enc(beg))
for ob in objects: _dump_xml(ob, stream=stream)
stream.write(enc(end))
if not getattr(stream, 'encoding', None): enc = encode_utf8 else: enc = no_encode
stream.write(enc(u'<?xml version="1.0" encoding="UTF-8" ?>\n')) if isinstance(banner, (str, newstr)): stream.write(enc(u'<!-- %s -->\n' % banner))
obj, stream, depth=0, ns_name=None, header=False, ns_map=[], ns_ignore=False):
from xml.sax.saxutils import escape, quoteattr
if not getattr(stream, 'encoding', None): enc = encode_utf8 else: enc = no_encode
if depth == 0 and header: _dump_xml_header(stream, header)
indent = ' '*depth*2 if ns_name is None: ns_name = obj.T.instance.get_xmltagname()
if -1 != ns_name.find(' '): ns, name = ns_name.split(' ') else: ns, name = '', ns_name
if isinstance(obj, Object): obj.validate(depth=1) attrs = [] elems = []
added_ns = False if not ns_ignore and ns and (not ns_map or ns_map[-1] != ns): attrs.append(('xmlns', ns)) ns_map.append(ns) added_ns = True
for prop, v in obj.T.ipropvals_to_save(obj, xmlmode=True): if prop.xmlstyle == 'attribute': assert not prop.multivalued assert not isinstance(v, Object) attrs.append((prop.effective_xmltagname, v))
elif prop.xmlstyle == 'content': assert not prop.multivalued assert not isinstance(v, Object) elems.append((None, v))
else: prop.extend_xmlelements(elems, v)
attr_str = '' if attrs: attr_str = ' ' + ' '.join( '%s=%s' % (k.split(' ')[-1], quoteattr(str(v))) for (k, v) in attrs)
if not elems: stream.write(enc(u'%s<%s%s />\n' % (indent, name, attr_str))) else: oneline = len(elems) == 1 and elems[0][0] is None stream.write(enc(u'%s<%s%s>%s' % ( indent, name, attr_str, '' if oneline else '\n')))
for (k, v) in elems: if k is None: stream.write(enc(escape(newstr(v), {'\0': '�'}))) else: _dump_xml(v, stream, depth+1, k, False, ns_map, ns_ignore)
stream.write(enc(u'%s</%s>\n' % ( '' if oneline else indent, name)))
if added_ns: ns_map.pop()
else: stream.write(enc(u'%s<%s>%s</%s>\n' % ( indent, name, escape(newstr(obj), {'\0': '�'}), name)))
if typ is None or isinstance(x, typ): yield path, x
if isinstance(x, Object): for (prop, val) in x.T.ipropvals(x): if prop.multivalued: if val is not None: for iele, ele in enumerate(val): for y in walk(ele, typ, path=path + ((prop.name, iele),)): yield y else: for y in walk(val, typ, path=path+(prop.name,)): yield y
''' Clone guts object tree.
Traverses guts object tree and recursively clones all guts attributes, falling back to :py:func:`copy.deepcopy` for non-guts objects. Objects deriving from :py:class:`Object` are instantiated using their respective init function. Multiply referenced objects in the source tree are multiply referenced also in the destination tree.
This function can be used to clone guts objects ignoring any contained run-time state, i.e. any of their attributes not defined as a guts property. '''
x_copy = pool[id(x)]
else: elif prop.multivalued is dict: y_copy = dict( (clone(zk, pool), clone(zv, pool)) for (zk, zv) in y.items()) else: y_copy = type(y)(clone(z, pool) for z in y) else: y_copy = y
else:
'''This exception is raised for invalid ypath specifications.'''
ident = r'[a-zA-Z][a-zA-Z0-9_]*' rint = r'-?[0-9]+' m = re.match( r'^(%s)(\[((%s)?(:)(%s)?|(%s))\])?$' % (ident, rint, rint, rint), yname)
if not m: raise YPathError('Syntax error in component: "%s"' % yname)
d = dict( name=m.group(1))
if m.group(2): if m.group(5): istart = iend = None if m.group(4): istart = int(m.group(4)) if m.group(6): iend = int(m.group(6))
d['slice'] = (istart, iend) else: d['index'] = int(m.group(7))
return d
if ynames: for sobj in iter_elements(obj, ynames): yield sobj else: yield obj
''' Generator yielding elements matching a given ypath specification.
:param obj: guts :py:class:`Object` instance :param ypath: Dot-separated object path (e.g. 'root.child.child'). To access list objects use slice notatation (e.g. 'root.child[:].child[1:3].child[1]').
Raises :py:exc:`YPathError` on failure. '''
try: if isinstance(ypath, str): ynames = ypath.split('.') else: ynames = ypath
yname = ynames[0] ynames = ynames[1:] d = _parse_yname(yname) if d['name'] not in obj.T.propnames: raise AttributeError(d['name'])
obj = getattr(obj, d['name'])
if 'index' in d: sobj = obj[d['index']] for ssobj in _decend(sobj, ynames): yield ssobj
elif 'slice' in d: for i in range(*slice(*d['slice']).indices(len(obj))): sobj = obj[i] for ssobj in _decend(sobj, ynames): yield ssobj else: for sobj in _decend(obj, ynames): yield sobj
except (AttributeError, IndexError) as e: raise YPathError('Invalid ypath: "%s" (%s)' % (ypath, str(e)))
''' Get all elements matching a given ypath specification.
:param obj: guts :py:class:`Object` instance :param ypath: Dot-separated object path (e.g. 'root.child.child'). To access list objects use slice notatation (e.g. 'root.child[:].child[1:3].child[1]').
Raises :py:exc:`YPathError` on failure. ''' return list(iter_elements(obj, ypath))
''' Set elements matching a given ypath specification.
:param obj: guts :py:class:`Object` instance :param ypath: Dot-separated object path (e.g. 'root.child.child'). To access list objects use slice notatation (e.g. 'root.child[:].child[1:3].child[1]'). :param value: All matching elements will be set to `value`. :param validate: Whether to validate affected subtrees. :param regularize: Whether to regularize affected subtrees.
Raises :py:exc:`YPathError` on failure. '''
ynames = ypath.split('.') try: d = _parse_yname(ynames[-1]) for sobj in iter_elements(obj, ynames[:-1]): if d['name'] not in sobj.T.propnames: raise AttributeError(d['name'])
if 'index' in d: ssobj = getattr(sobj, d['name']) ssobj[d['index']] = value elif 'slice' in d: ssobj = getattr(sobj, d['name']) for i in range(*slice(*d['slice']).indices(len(ssobj))): ssobj[i] = value else: setattr(sobj, d['name'], value) if regularize: sobj.regularize() if validate: sobj.validate()
except (AttributeError, IndexError, YPathError) as e: raise YPathError('Invalid ypath: "%s" (%s)' % (ypath, str(e)))
if typ is None or isinstance(x, typ): yield path, stack + (x,)
if isinstance(x, Object): for (prop, val) in x.T.ipropvals(x): if prop.multivalued: if val is not None: for iele, ele in enumerate(val): for y in zip_walk( ele, typ, path=path + ((prop.name, iele),), stack=stack + (x,)):
yield y else: for y in zip_walk(val, typ, path=path+(prop.name,), stack=stack + (x,)): yield y
if isinstance(x, tuple): return '%s[%i]' % x else: return x
return '.'.join(path_element(x) for x in path)
def dump(*args, **kwargs):
def load(*args, **kwargs):
return load(string=s, *args, **kwargs)
def dump_all(*args, **kwargs): return _dump_all(*args, **kwargs)
def load_all(*args, **kwargs): return _load_all(*args, **kwargs)
def iload_all(*args, **kwargs): return _iload_all(*args, **kwargs)
def dump_xml(*args, **kwargs): return _dump_xml(*args, **kwargs)
def load_xml(*args, **kwargs): return _load_xml(*args, **kwargs)
return load_xml(string=s, *args, **kwargs)
def dump_all_xml(*args, **kwargs): return _dump_all_xml(*args, **kwargs)
def load_all_xml(*args, **kwargs): return _load_all_xml(*args, **kwargs)
def iload_all_xml(*args, **kwargs): return _iload_all_xml(*args, **kwargs)
'guts_types', 'TBase', 'ValidationError', 'ArgumentError', 'Defer', 'dump', 'load', 'dump_all', 'load_all', 'iload_all', 'dump_xml', 'load_xml', 'dump_all_xml', 'load_all_xml', 'iload_all_xml', 'load_string', 'load_xml_string', 'make_typed_list_class', 'walk', 'zip_walk', 'path_to_str' ] |