<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resize(self, newsize, zeros=True):
 """ Resize the data arrays. This can only be performed on the container segment. Child segments must adjust their rawdata to point to the correct place. Since segments don't keep references to other segments, it is the user's responsibility to update any child segments that point to this segment's data. Numpy can't do an in-place resize on an array that has a view, so the data must be replaced and all segments that point to that raw data must also be changed. This has to happen outside this method because it doesn't know the segment list of segments using itself as a base. """

        if not self.can_resize:
            raise ValueError("Segment %s can't be resized" % str(self))
        # only makes sense for the container (outermost) object
        if not self.rawdata.is_base:
            raise ValueError("Only container segments can be resized")
        origsize = len(self)
        self.rawdata.resize(newsize)
        self.set_raw(self.rawdata)  # force attributes to be reset
        newsize = len(self)
        if zeros:
            if newsize > origsize:
                self.data[origsize:] = 0
                self.style[origsize:] = 0
        return origsize, newsize