<commit_before>def schedule(time='1h', first_in=10)
  
  SCHEDULER.every time, :first_in => first_in+rand(30) do
    yield
  end
end

def send_metric_with_targets event, data, options = {}
  send_event event, { current: data['actual'], annual_target: data['annual_target'], ytd_target: data['ytd_target']}.merge(options)
end<commit_msg>handle zero data in target things<commit_after>def schedule(time='1h', first_in=10)
  
  SCHEDULER.every time, :first_in => first_in+rand(30) do
    yield
  end
end

def send_metric_with_targets event, data, options = {}
  if data == 0 || data.nil?
    data = {
      'actual' => 0,
      'annual_target' => 0,
      'ytd_target' => 0
    }
  end
  send_event event, { current: data['actual'], annual_target: data['annual_target'], ytd_target: data['ytd_target']}.merge(options)
end
{'fraction_non_alphanumeric': 0.14058679706601468, 'fraction_numerical': 0.017114914425427872, 'mean_word_length': 4.6482758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1149421', 'n_tokens_mistral': 301, 'n_tokens_neox': 290, 'n_words': 66}