<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_credentials(env=None):
 """ Gets the TextMagic credentials from current environment :param env: environment :return: username, token """

    environ = env or os.environ
    try:
        username = environ["TEXTMAGIC_USERNAME"]
        token = environ["TEXTMAGIC_AUTH_TOKEN"]
        return username, token
    except KeyError:
        return None, None