def METHOD_NAME(file, data, type):
    if type not in TypeNames.keys():
        raise ValueError(
            f"Trying to write number with unknown dataformat.\n"
            f"Input: {type}\n"
            f"Supported types: {list(TypeNames.keys())}"
        )
    np.array(data).astype(TypeNames[type]).tofile(file)