<commit_before>#include <CoreGraphics/CoreGraphics.h>
#include <iostream>

namespace {
CFMachPortRef eventtap_;

CGEventRef callback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* refcon) {
  switch (type) {
  case kCGEventKeyDown:
    std::cout << "kCGEventKeyDown" << std::endl;
    break;
  case kCGEventKeyUp:
    std::cout << "kCGEventKeyUp" << std::endl;
  default:
    std::cout << "callback:" << type << std::endl;
    break;
  }
  return event;
}
}

int main(int argc, const char* argv[]) {
  eventtap_ = CGEventTapCreate(kCGHIDEventTap,
                               kCGHeadInsertEventTap,
                               kCGEventTapOptionDefault,
                               CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventKeyUp),
                               callback,
                               NULL);

  auto run_loop_source = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventtap_, 0);
  CFRunLoopAddSource(CFRunLoopGetCurrent(), run_loop_source, kCFRunLoopCommonModes);
  CGEventTapEnable(eventtap_, 1);
  CFRelease(run_loop_source);

  CFRunLoopRun();

  return 0;
}<commit_msg>use nullptr<commit_after>#include <CoreGraphics/CoreGraphics.h>
#include <iostream>

namespace {
CFMachPortRef eventtap_;

CGEventRef callback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* refcon) {
  switch (type) {
  case kCGEventKeyDown:
    std::cout << "kCGEventKeyDown" << std::endl;
    break;
  case kCGEventKeyUp:
    std::cout << "kCGEventKeyUp" << std::endl;
  default:
    std::cout << "callback:" << type << std::endl;
    break;
  }
  return event;
}
}

int main(int argc, const char* argv[]) {
  eventtap_ = CGEventTapCreate(kCGHIDEventTap,
                               kCGHeadInsertEventTap,
                               kCGEventTapOptionDefault,
                               CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventKeyUp),
                               callback,
                               nullptr);

  auto run_loop_source = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventtap_, 0);
  CFRunLoopAddSource(CFRunLoopGetCurrent(), run_loop_source, kCFRunLoopCommonModes);
  CGEventTapEnable(eventtap_, 1);
  CFRelease(run_loop_source);

  CFRunLoopRun();

  return 0;
}
{'fraction_non_alphanumeric': 0.10021978021978022, 'fraction_numerical': 0.0026373626373626374, 'mean_word_length': 2.8972602739726026, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 7, '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': '4104987', 'n_tokens_mistral': 752, 'n_tokens_neox': 723, 'n_words': 131}