code: def __paint(self, event):
      # calculate square that is belong this click
      if (
          (event.x >= 0)
          and (event.x < 320)
          and (event.y >= 0)
          and (event.y < 320)
      ):
          x1, y1 = math.floor(event.x / 10), math.floor(event.y / 10)
  
          self.__user_pattern[y1 * 32 + x1] = 1
  
          index2 = (y1 + 1) * 32 + x1
          index3 = y1 * 32 + (x1 + 1)
          index4 = (y1 + 1) * 32 + (x1 + 1)
  
          if index2 < len(self.__user_pattern):
              self.__user_pattern[index2] = 1
          if index3 < len(self.__user_pattern):
              self.__user_pattern[index3] = 1
          if index4 < len(self.__user_pattern):
              self.__user_pattern[index4] = 1
  
          display_x1, display_y1 = x1 * 10, y1 * 10
          display_x2, display_y2 = display_x1 + 20, display_y1 + 20
  
          self.__widget.create_rectangle(
              display_x1,
              display_y1,
              display_x2,
              display_y2,
              fill=self.__color,
              width=0,
          )
  
imports: from pyclustering.nnet.som import som, type_conn
  from pyclustering.samples.definitions import IMAGE_DIGIT_SAMPLES
  from pyclustering.utils import read_image, rgb2gray
  from tkinter import *
  from tkinter import messagebox
  import math
  import pickle
  import os
  import random
label_desc: Use image node_id 2 for calling the digit_application obj's underlying member method code with example usage: obj.__paint(event) without return types