<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_format(var, format_str):
 """Format all non-iterables inside of the iterable var using the format_str Example: will return ['2.0', ['1.0', '4.0'], '4.0', '1.0'] """

    if isinstance(var, (list, tuple)):
        new_var = map(lambda x: apply_format(x, format_str), var)
        if isinstance(var, tuple):
            new_var = '(' + ', '.join(new_var) + ')'
        elif isinstance(var, list):
            new_var = '[' + ', '.join(new_var) + ']'
        return '{}'.format(new_var)
    else:
        return format_str.format(var)