<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def twitter_credential(name):
 """ Grab twitter credential from settings """

    credential_name = 'TWITTER_' + name.upper()
    if hasattr(settings, credential_name):
        return getattr(settings, credential_name)
    else:
        raise AttributeError('Missing twitter credential in settings: ' + credential_name)