def __new__(cls, value, session=None):
value = np.asarray(value)<EOL>if (value.shape[value.ndim - <NUM_LIT:1>] == <NUM_LIT:1>):<EOL><INDENT>value = value.squeeze(axis=value.ndim - <NUM_LIT:1>)<EOL><DEDENT>value = np.atleast_1d(value)<EOL>if not session:<EOL><INDENT>return value.view(cls)<EOL><DEDENT>obj = np.empty(value.size, dtype=value.dtype).view(cls)<EOL>for (i, item) in enumerate(value.ravel()):<EOL><INDENT>for name in value.dtype.names:<EOL><INDENT>obj[i][name] = _extract(item[name], session)<EOL><DEDENT><DEDENT>return obj.reshape(value.shape)<EOL>
Create a struct array from a value and optional Octave session.