code: def _set_account_policy(name, policy):
      '''
      Set a value in the user accountPolicy. For use by this module only
  
      :param str name: The user name
      :param str policy: The policy to apply
  
      :return: True if success, otherwise False
      :rtype: bool
  
      :raises: CommandExecutionError on user not found or any other unknown error
      '''
      cmd = 'pwpolicy -u {0} -setpolicy "{1}"'.format(name, policy)
  
      try:
          return salt.utils.mac_utils.execute_return_success(cmd)
      except CommandExecutionError as exc:
          if 'Error: user <{0}> not found'.format(name) in exc.strerror:
              raise CommandExecutionError('User not found: {0}'.format(name))
          raise CommandExecutionError('Unknown error: {0}'.format(exc.strerror)f _set_account_policy(name, policy):
      '''
      Set a value in the user accountPolicy. For use by this module only
  
      :param str name: The user name
      :param str policy: The policy to apply
  
      :return: True if success, otherwise False
      :rtype: bool
  
      :raises: CommandExecutionError on user not found or any other unknown error
      '''
      cmd = 'pwpolicy -u {0} -setpolicy "{1}"'.format(name, policy)
  
      try:
          return salt.utils.mac_utils.execute_return_success(cmd)
      except CommandExecutionError as exc:
          if 'Error: user <{0}> not found'.format(name) in exc.strerror:
              raise CommandExecutionError('User not found: {0}'.format(name))
          raise CommandExecutionError('Unknown error: {0}'.format(exc.strerror))
docs: Set a value in the user accountPolicy. For use by this module only
  
      :param str name: The user name
      :param str policy: The policy to apply
  
      :return: True if success, otherwise False
      :rtype: bool
  
      :raises: CommandExecutionError on user not found or any other unknown error