<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reformat(source: str) -> str: """ Formats the source string to strip newlines on both ends and dedents the the entire string :param source: The string to reformat """


    value = source if source else ''
    return dedent(value.strip('\n')).strip()