<commit_before>module IO = struct
  type 'a t = 'a Lwt.t

  type fd = Lwt_unix.file_descr
  type in_channel = Lwt_chan.in_channel
  type out_channel = Lwt_chan.out_channel

  type 'a stream = 'a Lwt_stream.t
  type stream_count = unit

  let (>>=) = Lwt.(>>=)
  let catch = Lwt.catch
  let try_bind = Lwt.try_bind
  let ignore_result = Lwt.ignore_result
  let return = Lwt.return
  let fail = Lwt.fail
  let run = Lwt_main.run

  let connect host port =
    let fd = Lwt_unix.socket (Unix.PF_INET) Unix.SOCK_STREAM 0 in
    let port = string_of_int port in
    Lwt_unix.getaddrinfo host port [] >>= (function
        | [] -> failwith "Could not resolve redis host!"
        | addrinfo::_ -> return addrinfo.Lwt_unix.ai_addr) >>= (fun sock_addr ->
        ignore (Lwt_unix.connect fd sock_addr);
        return fd)

  let close = Lwt_unix.close
  let sleep = Lwt_unix.sleep

  let in_channel_of_descr = Lwt_chan.in_channel_of_descr
  let out_channel_of_descr = Lwt_chan.out_channel_of_descr
  let input_char = Lwt_chan.input_char
  let really_input = Lwt_chan.really_input
  let output_string = Lwt_chan.output_string
  let flush = Lwt_chan.flush

  let iter = Lwt_list.iter_p
  let iter_serial = Lwt_list.iter_s
  let map = Lwt_list.map_p
  let map_serial = Lwt_list.map_s<commit_msg>Change the way lwt client is connecting to redis<commit_after>module IO = struct
  type 'a t = 'a Lwt.t

  type fd = Lwt_unix.file_descr
  type in_channel = Lwt_chan.in_channel
  type out_channel = Lwt_chan.out_channel

  type 'a stream = 'a Lwt_stream.t
  type stream_count = unit

  let (>>=) = Lwt.(>>=)
  let catch = Lwt.catch
  let try_bind = Lwt.try_bind
  let ignore_result = Lwt.ignore_result
  let return = Lwt.return
  let fail = Lwt.fail
  let run = Lwt_main.run

  let connect host port =
    let fd = Lwt_unix.socket (Unix.PF_INET) Unix.SOCK_STREAM 0 in
    let port = string_of_int port in
    Lwt_unix.getaddrinfo host port [] >>= function
    | [] -> failwith "Could not resolve redis host!"
    | addrinfo::_ -> return addrinfo.Lwt_unix.ai_addr >>= fun sock_addr ->
    Lwt_unix.connect fd sock_addr >>= fun () ->
    return fd

  let close = Lwt_unix.close
  let sleep = Lwt_unix.sleep

  let in_channel_of_descr = Lwt_chan.in_channel_of_descr
  let out_channel_of_descr = Lwt_chan.out_channel_of_descr
  let input_char = Lwt_chan.input_char
  let really_input = Lwt_chan.really_input
  let output_string = Lwt_chan.output_string
  let flush = Lwt_chan.flush

  let iter = Lwt_list.iter_p
  let iter_serial = Lwt_list.iter_s
  let map = Lwt_list.map_p
  let map_serial = Lwt_list.map_s
{'fraction_non_alphanumeric': 0.08426749130266718, 'fraction_numerical': 0.0007730962504831851, 'mean_word_length': 3.4391080617495713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '6092364', 'n_tokens_mistral': 1005, 'n_tokens_neox': 984, 'n_words': 243}