<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def derive(self, new_version: Union[tuple, list]=None) -> "Model": """ Inherit the new model from the current one - used for versioning. \ This operation is in-place. :param new_version: The version of the new model. :return: The derived model - self. """

        meta = self.meta
        first_time = self._initial_version == self.version
        if new_version is None:
            new_version = meta["version"]
            new_version[-1] += 1
        if not isinstance(new_version, (tuple, list)):
            raise ValueError("new_version must be either a list or a tuple, got %s"
                             % type(new_version))
        meta["version"] = list(new_version)
        if first_time:
            meta["parent"] = meta["uuid"]
        meta["uuid"] = str(uuid.uuid4())
        return self