<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shape(self):
 """Copy the shape from TCMPS as a new numpy ndarray."""


        # Create C variables that will serve as out parameters for TCMPS.
        shape_ptr = _ctypes.POINTER(_ctypes.c_size_t)()  # size_t* shape_ptr
        dim = _ctypes.c_size_t()                         # size_t dim

        # Obtain pointer into memory owned by the C++ object self.handle.
        status_code = self._LIB.TCMPSGetFloatArrayShape(
            self.handle, _ctypes.byref(shape_ptr), _ctypes.byref(dim))
        assert status_code == 0, "Error calling TCMPSGetFloatArrayShape"

        return _shape_tuple_from_ctypes(shape_ptr, dim)