code: def from_format(
      string,  # type: str
      fmt,  # type: str
      tz=UTC,  # type: Union[str, _Timezone]
      locale=None,  # type: Union[str, None]
  ):  # type: (...) -> DateTime
      
      parts = _formatter.parse(string, fmt, now(), locale=locale)
      if parts["tz"] is None:
          parts["tz"] = tz
  
      return datetime(**parts)
docs: Creates a DateTime instance from a specific format.