code: def _check_configure_args(configure_args: Dict[str, Any]) -> Dict[str, Any]:
      
      # SSID must always be present
      if not configure_args.get('ssid')\
         or not isinstance(configure_args['ssid'], str):
          raise ConfigureArgsError("SSID must be specified")
      # If specified, hidden must be a bool
      if not configure_args.get('hidden'):
          configure_args['hidden'] = False
      elif not isinstance(configure_args['hidden'], bool):
          raise ConfigureArgsError('If specified, hidden must be a bool')
  
      configure_args['securityType'] = _deduce_security(configure_args)
  
      # If we have wpa2-personal, we need a psk
      if configure_args['securityType'] == nmcli.SECURITY_TYPES.WPA_PSK:
          if not configure_args.get('psk'):
              raise ConfigureArgsError(
                  'If securityType is wpa-psk, psk must be specified')
          return configure_args
  
      # If we have wpa2-enterprise, we need eap config, and we need to check
      # it
      if configure_args['securityType'] == nmcli.SECURITY_TYPES.WPA_EAP:
          if not configure_args.get('eapConfig'):
              raise ConfigureArgsError(
                  'If securityType is wpa-eap, eapConfig must be specified')
          configure_args['eapConfig']\
              = _eap_check_config(configure_args['eapConfig'])
          return configure_args
  
      # If we’re still here we have no security and we’re done
      return configure_args
docs: Check the arguments passed to configure.
  
      Raises an exception on failure. On success, returns a dict of
      configure_args with any necessary mutations.