<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _writable(method):
 """Check that record is in defined status. :param method: Method to be decorated. :returns: Function decorated. """

    @wraps(method)
    def wrapper(self, *args, **kwargs):
        """Send record for indexing.

        :returns: Execution result of the decorated method.

        :raises InvalidOperationError: It occurs when the bucket is locked or
            deleted.
        """
        if self.bucket.locked or self.bucket.deleted:
            raise InvalidOperationError()
        return method(self, *args, **kwargs)
    return wrapper