<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_format( string, # type: str fmt, # type: str tz=UTC, # type: Union[str, _Timezone] locale=None, # type: Union[str, None] """ Creates a DateTime instance from a specific format. """

    parts = _formatter.parse(string, fmt, now(), locale=locale)
    if parts["tz"] is None:
        parts["tz"] = tz

    return datetime(**parts)