<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _make_cache_key(key_prefix):
 """Make cache key from prefix Borrowed from Flask-Cache extension """

    if callable(key_prefix):
        cache_key = key_prefix()
    elif '%s' in key_prefix:
        cache_key = key_prefix % request.path
    else:
        cache_key = key_prefix

    cache_key = cache_key.encode('utf-8')

    return cache_key