<commit_before>(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(* This file gathers environment variables needed by Coq to run (such
   as coqlib) *)

let coqbin () =
  if !Flags.boot || Coq_config.local
  then Filename.concat Coq_config.coqsrc "bin"
  else System.canonical_path_name (Filename.dirname Sys.executable_name)

(* On win32, we add coqbin to the PATH at launch-time (this used to be
   done in a .bat script). *)

let _ =
  if Coq_config.arch = "win32" then
    Unix.putenv "PATH" (coqbin() ^ ";" ^ System.getenv_else "PATH" "")

let reldir instdir testfile oth =
  let prefix = Filename.dirname (coqbin ()) in
  let rpath = if Coq_config.local then [] else instdir in
  let out = List.fold_left Filename.concat prefix rpath in
  if Sys.file_exists (Filename.concat out testfile) then out else oth

let guess_coqlib () =
  let file = "states/initial.coq" in
    if Sys.file_exists (Filename.concat Coq_config.coqlib file)
    then Coq_config.coqlib
    else reldir (if Coq_config.arch = "win32" then ["lib"] else ["lib";"coq"]) file
      (Util.error "cannot guess a path for Coq libraries; please use -coqlib option")

let coqlib () =
  if !Flags.coqlib_spec then !Flags.coqlib else
    (if !Flags.boot then Coq_config.coqsrc else guess_coqlib ())

let docdir () =
  reldir (if Coq_config.arch = "win32" then ["doc"] else ["share";"doc";"coq"]) "html" Coq_config.docdir<commit_msg>Choose relative directory over configured directory for coqlib.<commit_after>(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(* This file gathers environment variables needed by Coq to run (such
   as coqlib) *)

let coqbin () =
  if !Flags.boot || Coq_config.local
  then Filename.concat Coq_config.coqsrc "bin"
  else System.canonical_path_name (Filename.dirname Sys.executable_name)

(* On win32, we add coqbin to the PATH at launch-time (this used to be
   done in a .bat script). *)

let _ =
  if Coq_config.arch = "win32" then
    Unix.putenv "PATH" (coqbin() ^ ";" ^ System.getenv_else "PATH" "")

let reldir instdir testfile oth =
  let prefix = Filename.dirname (coqbin ()) in
  let rpath = if Coq_config.local then [] else instdir in
  let out = List.fold_left Filename.concat prefix rpath in
  if Sys.file_exists (Filename.concat out testfile) then out else oth ()

let guess_coqlib () =
  let file = "states/initial.coq" in
    reldir (if Coq_config.arch = "win32" then ["lib"] else ["lib";"coq"]) file
      (fun () -> if Sys.file_exists (Filename.concat Coq_config.coqlib file)
                 then Coq_config.coqlib
                 else Util.error "cannot guess a path for Coq libraries; please use -coqlib option")

let coqlib () =
  if !Flags.coqlib_spec then !Flags.coqlib else
    (if !Flags.boot then Coq_config.coqsrc else guess_coqlib ())

let docdir () =
  reldir (if Coq_config.arch = "win32" then ["doc"] else ["share";"doc";"coq"]) "html" (fun () -> Coq_config.docdir)
{'fraction_non_alphanumeric': 0.21237327787886665, 'fraction_numerical': 0.009357941252924357, 'mean_word_length': 3.5270588235294116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6762164', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1184, 'n_words': 378}