@@ -0,0 +1,1194 @@
+# protobuf_.py%0D%0A%0D%0A# Imports%0D%0Aimport numpy as np%0D%0A%0D%0A# load_array%0D%0Adef load_array(s, stem, n=1, delimiter='_'):%0D%0A    attrs = %5B'%25s%25s%25d' %25 (stem, delimiter, n)%5D%0D%0A    if n == 1:%0D%0A        attrs.append(stem)%0D%0A%0D%0A    for attr in attrs:%0D%0A        l = getattr(s, attr, None)%0D%0A        if l is not None:%0D%0A            break%0D%0A    else:%0D%0A        raise ValueError('unable to find attrs: %25s' %25 str(attrs))%0D%0A%0D%0A    A = np.asarray(l)%0D%0A    if n %3E 1:%0D%0A        A = A.reshape(-1, n)%0D%0A    return A%0D%0A%0D%0A# append_array%0D%0Adef append_array(s, stem, A, clear=False, delimiter='_'):%0D%0A    A = np.asarray(A)%0D%0A    if A.ndim == 1:%0D%0A        attrs = %5B'%25s%25s1' %25 (stem, delimiter), stem%5D%0D%0A        A = A%5B:, np.newaxis%5D%0D%0A    elif A.ndim == 2:%0D%0A        attrs = %5B'%25s%25s%25d' %25 (stem, delimiter, A.shape%5B1%5D)%5D%0D%0A        pass%0D%0A    else:%0D%0A        raise ValueError('cannot handle A with ndim = %25d' %25 A.ndim)%0D%0A%0D%0A    for attr in attrs:%0D%0A        l = getattr(s, attr, None)%0D%0A        if l is not None:%0D%0A            break%0D%0A    else:%0D%0A        raise ValueError('unable to find attrs: %25s' %25 str(attrs))%0D%0A%0D%0A    if clear:%0D%0A        del l%5B:%5D%0D%0A    a = A.ravel()%0D%0A    if a.dtype == bool:%0D%0A        a = (bool(a_) for a_ in a)%0D%0A    for a_ in a:%0D%0A        l.append(a_)%0D%0A

Add python/protobuf_.py