<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_fmt_v4(data_type, size, channel_type=v4c.CHANNEL_TYPE_VALUE):
 """convert mdf version 4 channel data type to numpy dtype format string Parameters data_type : int mdf channel data type size : int data bit size channel_type: int mdf channel type Returns ------- fmt : str numpy compatible data type format string """

    if data_type in v4c.NON_SCALAR_TYPES:
        size = size // 8

        if data_type == v4c.DATA_TYPE_BYTEARRAY:
            if channel_type == v4c.CHANNEL_TYPE_VALUE:
                fmt = f"({size},)u1"
            else:
                if size == 4:
                    fmt = "<u4"
                elif size == 8:
                    fmt = "<u8"

        elif data_type in v4c.STRING_TYPES:
            if channel_type == v4c.CHANNEL_TYPE_VALUE:
                fmt = f"S{size}"
            else:
                if size == 4:
                    fmt = "<u4"
                elif size == 8:
                    fmt = "<u8"

        elif data_type == v4c.DATA_TYPE_CANOPEN_DATE:
            fmt = "V7"

        elif data_type == v4c.DATA_TYPE_CANOPEN_TIME:
            fmt = "V6"

    else:

        if size <= 8:
            size = 1
        elif size <= 16:
            size = 2
        elif size <= 32:
            size = 4
        elif size <= 64:
            size = 8
        else:
            size = size // 8

        if data_type == v4c.DATA_TYPE_UNSIGNED_INTEL:
            fmt = f"<u{size}"

        elif data_type == v4c.DATA_TYPE_UNSIGNED_MOTOROLA:
            fmt = f">u{size}"

        elif data_type == v4c.DATA_TYPE_SIGNED_INTEL:
            fmt = f"<i{size}"

        elif data_type == v4c.DATA_TYPE_SIGNED_MOTOROLA:
            fmt = f">i{size}"

        elif data_type == v4c.DATA_TYPE_REAL_INTEL:
            fmt = f"<f{size}"

        elif data_type == v4c.DATA_TYPE_REAL_MOTOROLA:
            fmt = f">f{size}"

    return fmt