<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compile_struct(fmt, cache=None):
 """ returns a struct.Struct instance compiled from fmt. If fmt has already been compiled, it will return the previously compiled Struct instance from the cache. """


    if cache is None:
        cache = _struct_cache

    sfmt = cache.get(fmt, None)
    if not sfmt:
        sfmt = Struct(fmt)
        cache[fmt] = sfmt
    return sfmt