code: def create_config(cnf_file, uid, overwrite):
      
      conf = None
  
      # needed also on suse, because pyClamd module
      if not os.path.exists(settings.DEB_CONF_PATH):
          os.makedirs(settings.DEB_CONF_PATH, 0755)
          os.chown(settings.DEB_CONF_PATH, uid, -1)
  
      if not os.path.exists(cnf_file):       # create new conf file
          conf = CLEAN_CONFIG
      elif overwrite:                        # ovewrite old conf file
          backup_name = cnf_file + "_"
          if not os.path.exists(backup_name):
              shutil.copyfile(cnf_file, backup_name)
              os.chown(backup_name, uid, -1)
  
          conf = CLEAN_CONFIG
      else:                                  # switch variables in existing file
          with open(cnf_file) as f:
              conf = f.read()
  
      # write the conf file
      with open(cnf_file, "w") as f:
          f.write(update_configuration(conf))
  
      # permission check (uid)
      os.chown(cnf_file, uid, -1)
      os.chmod(cnf_file, 0644)
  
      symlink = settings.DEB_CONF_PATH + settings.CONF_FILE
      if not settings.is_deb_system() and not os.path.exists(symlink):
          os.symlink(cnf_file, symlink)
          os.chown(symlink, uid, -1)
          os.chmod(symlink, 0644)
docs: Creates configuration file and the directory where it should be stored and
      set correct permissions.
  
      Args:
          cnf_file (str): Path to the configuration file.
          uid (int): User ID - will be used for chown.
          overwrite (bool): Overwrite the configuration with :attr:`CLEAN_CONFIG`.