<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_email(self):
 """Check if email exists on Stormpath. The email address is unique across all Stormpath applications. The username is only unique within a Stormpath application. """

        try:
            accounts = APPLICATION.accounts.search({'email': self.cleaned_data['email']})
            if len(accounts):
                msg = 'User with that email already exists.'
                raise forms.ValidationError(msg)
        except Error as e:
            raise forms.ValidationError(str(e))

        return self.cleaned_data['email']