def size(key, shape):
 dims = []
 for i in range(2):
  selection = np.arange(shape[i])[key[i]]
  size = np.size(selection)
  dims.append(size)
 return tuple(dims)

def size ( key , shape ) : dims = [ ] for i in range ( 2 ) : selection = np . arange ( shape [ i ] ) [ key [ i ] ] size = np . size ( selection ) dims . append ( size ) return tuple ( dims )
size -> str convert the length of a bytestream to human readable form .