<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def credentials_required(method_func):
 """ Decorator for methods that checks that the client has credentials. Throws a CredentialsMissingError when they are absent. """

    def _checkcredentials(self, *args, **kwargs):
        if self.username and self.password:
            return method_func(self, *args, **kwargs)
        else:
            raise CredentialsMissingError("This is a private method. \
You must provide a username and password when you initialize the \
DocumentCloud client to attempt this type of request.")

    return wraps(method_func)(_checkcredentials)