<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clear_cache(input=None):
 """Clear the production or sandbox redis cache."""

    if input is not None:
        n = input
    else:
        n = _choose_from_list(["Production cache", "Sandbox cache"], "Which cache would you like to clear?")

    if n == 0:
        local("redis-cli -n {} FLUSHDB".format(REDIS_PRODUCTION_CACHE_DB))
    else:
        local("redis-cli -n {} FLUSHDB".format(REDIS_SANDBOX_CACHE_DB))