<commit_before>(*
 * (c) 2004-2012 <NAME>
 *)

open Xml
open Xmlstream
open StanzaError
open JID

type id = string

module type IDCALLBACK =
sig
  type 'a t
  val empty : 'a t
  val add : id -> 'a -> 'a t -> 'a t
  val find : id -> 'a t -> 'a
  val remove : id -> 'a t -> 'a t
end

module type S =
sig
  exception Error of string
  exception StreamError of StreamError.t
  exception MalformedStanza
  exception BadRequest

  type 'a t
  val return : 'a -> 'a t
  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

  type iq_request =
    | IQSet of element
    | IQGet of element

  type iq_response =
    | IQResult of element option
    | IQError of StanzaError.t

  type iq =
    | IQRequest of iq_request
    | IQResponse of iq_response


  type 'a session_data

  val get_myjid : 'a session_data -> JID.t

  val make_iq_request :
    'a session_data ->
    ?jid_from:JID.t ->
    ?jid_to:JID.t ->
    ?lang:Xml.cdata ->
    iq_request ->
    (iq_response ->
     string option -> string option -> string option -> unit -> unit t) ->
    unit t

  type 'a stanza = {
    id : id option;
    jid_from : JID.t option;
    jid_to : string option;
    lang : string option;
    content : 'a;
    x : element list
  }

  type message_type =
    | Normal
    | Chat
    | Groupchat
    | Headline

  type message_content = {
    message_type : message_type option;
    body : string option;
    subject : string option;
    thread : string option
  }

  val send_message :<commit_msg>export raw send as well<commit_after>(*
 * (c) 2004-2012 <NAME>
 *)

open Xml
open Xmlstream
open StanzaError
open JID

type id = string

module type IDCALLBACK =
sig
  type 'a t
  val empty : 'a t
  val add : id -> 'a -> 'a t -> 'a t
  val find : id -> 'a t -> 'a
  val remove : id -> 'a t -> 'a t
end

module type S =
sig
  exception Error of string
  exception StreamError of StreamError.t
  exception MalformedStanza
  exception BadRequest

  type 'a t
  val return : 'a -> 'a t
  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

  type iq_request =
    | IQSet of element
    | IQGet of element

  type iq_response =
    | IQResult of element option
    | IQError of StanzaError.t

  type iq =
    | IQRequest of iq_request
    | IQResponse of iq_response


  type 'a session_data

  val get_myjid : 'a session_data -> JID.t

  val make_iq_request :
    'a session_data ->
    ?jid_from:JID.t ->
    ?jid_to:JID.t ->
    ?lang:Xml.cdata ->
    iq_request ->
    (iq_response ->
     string option -> string option -> string option -> unit -> unit t) ->
    unit t

  type 'a stanza = {
    id : id option;
    jid_from : JID.t option;
    jid_to : string option;
    lang : string option;
    content : 'a;
    x : element list
  }

  type message_type =
    | Normal
    | Chat
    | Groupchat
    | Headline

  type message_content = {
    message_type : message_type option;
    body : string option;
    subject : string option;
    thread : string option
  }

  val send : 'a session_data -> string -> unit t

  val send_message :
{'fraction_non_alphanumeric': 0.10312707917498337, 'fraction_numerical': 0.0053226879574184965, 'mean_word_length': 2.2543290043290045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, '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': '1112821', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1051, 'n_words': 361}