<commit_before># Encoding: utf-8

module Windows
  # helpers for the dhcp_server backup LWRP
  module Printerbackup
    def config_exists(*)
      activity = new_resource.activity
      Chef::Log.info('Checking for current print server backup status')
      if activity.eql?('export')
        current_printqueue_backup
        Chef::Log.info('Chef detected current print queue backup')
      elsif activity.eql?('import')
        import_printqueue_backup
        Chef::Log.info('Chef completed print server backup to filesystem')
      end
    end

    def current_printqueue_backup
      location = new_resource.location
      maxage = new_resource.maxage
      # force maxage to 1 if a zero value is supplied
      if maxage == 0
        maxage = 1
      end
      maxage_seconds = maxage * 3600
      if ::File.exist?(location)
        filemodtime = ::File.mtime(location)
      else
        filemodtime = Time.now
      end
      now = Time.now
      # max age of file before another backup is 16 hours
      cutofftime = now - maxage_seconds
      filemodtime < cutofftime
    end<commit_msg>tweak<commit_after># Encoding: utf-8

module Windows
  # helpers for the dhcp_server backup LWRP
  module Printerbackup
    def config_exists(*)
      activity = new_resource.activity
      Chef::Log.info('Checking for current print server backup status')
      if activity.eql?('export')
        current_printqueue_backup
        Chef::Log.info('Chef detected current print queue backup')
      elsif activity.eql?('import')
        import_printqueue_backup
        Chef::Log.info('Chef completed print server backup to filesystem')
      end
    end

    def current_printqueue_backup
      location = new_resource.location
      maxage = new_resource.maxage
      # force maxage to 1 if a zero value is supplied
      maxage = 1 if maxage == 0
      maxage_seconds = maxage * 3600
      if ::File.exist?(location)
        filemodtime = ::File.mtime(location)
      else
        filemodtime = Time.now
      end
      now = Time.now
      # max age of file before another backup is 16 hours
      cutofftime = now - maxage_seconds
      filemodtime < cutofftime
    end
{'fraction_non_alphanumeric': 0.06918819188191883, 'fraction_numerical': 0.00922509225092251, 'mean_word_length': 2.567434210526316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5858336', 'n_tokens_mistral': 637, 'n_tokens_neox': 614, 'n_words': 190}