<commit_before>#include <stdio.h>
#include <string.h>
#include <hiredis/hiredis.h>

#include "version.h" 

void print_version(){
  printf(
    VERSION_STRING, 
    VERSION_MAJOR, 
    VERSION_MINOR, 
    VERSION_MICRO
  );
}

void print_usage(char *bin){
  printf(USAGE_STRING, bin);
}

int main(int argc, char **argv){
  redisContext *c;
  int similarityFunc = 0;
  /* redisReply *reply; */

  if(argc < 2){
    print_usage(argv[0]);
    return 1;
  }

  if(!strcmp(argv[1], "--version")){
    print_version();
    return 0;
  }

  if(!strcmp(argv[1], "--jaccard")) 
    similarityFunc = 1;

  if(!strcmp(argv[1], "--cosine"))  
    similarityFunc = 2;

  if(!similarityFunc){
    printf("invalid option: %s\n", argv[1]);
    return 1;
  } else if(argc != 4){
    printf("wrong number of arguments\n");
    print_usage(argv[0]);
    return 1;
  }

  struct timeval timeout = { 1, 500000 }; 
  c = redisConnectWithTimeout("127.0.0.2", 6379, timeout); 

  if(c->err){
    printf("connection to redis failed: %s\n", c->errstr);
    return 1;
  }

  return 0;
}
<commit_msg>native: cleaning up...<commit_after>#include <stdio.h>
#include <string.h>
#include <hiredis/hiredis.h>

#include "version.h" 

int print_version(){
  printf(
    VERSION_STRING, 
    VERSION_MAJOR, 
    VERSION_MINOR, 
    VERSION_MICRO
  );
  return 0;
}

int print_usage(char *bin){
  printf(USAGE_STRING, bin);
  return 1;
}

int main(int argc, char **argv){
  int similarityFunc = 0;
  redisContext *c;
  redisReply *reply;
  

  /* option parsing */
  if(argc < 2)
    return print_usage(argv[0]);

  if(!strcmp(argv[1], "--version"))
    return print_version();

  if(!strcmp(argv[1], "--jaccard")) 
    similarityFunc = 1;

  if(!strcmp(argv[1], "--cosine"))  
    similarityFunc = 2;

  if(!similarityFunc){
    printf("invalid option: %s\n", argv[1]);
    return 1;
  } else if(argc != 4){
    printf("wrong number of arguments\n");
    print_usage(argv[0]);
    return 1;
  }

  
  /* connect to redis */
  struct timeval timeout = { 1, 500000 }; 
  c = redisConnectWithTimeout("127.0.0.2", 6379, timeout); 

  if(c->err){
    printf("connection to redis failed: %s\n", c->errstr);
    return 1;
  }


  return 0;
}

{'fraction_non_alphanumeric': 0.16833484986351227, 'fraction_numerical': 0.030937215650591446, 'mean_word_length': 3.1334586466165413, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1311740', 'n_tokens_mistral': 908, 'n_tokens_neox': 823, 'n_words': 183}