text stringlengths 0 601k |
|---|
let expand_route_nodes s = route_nodes_expander # structure s [ ] |> fst |
let project_ref context = List . assoc " projectid " context . Webapp_common . arguments |
let file_ref context = ( List . assoc " projectid " context . Webapp_common . arguments , List . assoc " fileid " context . Webapp_common . arguments ) |
let pos_file_ref context = ( List . assoc " projectid " context . Webapp_common . arguments , List . assoc " fileid " context . Webapp_common . arguments , int_of_string ( List . assoc " filepos " context . Webapp_common . arguments ) ) |
let field_ref context field = ( List . assoc " projectid " context . Webapp_common . arguments , List . assoc field context . Webapp_common . arguments ) let re = Re . compile ( Re . str " WebSim " ) in let sa_command = Re . replace_string re ~ by " : KaSaAgent " Sys . argv . ( 0 ) in let sa_process = Lwt_process . ope... |
let bind_projects f id projects = match Mods . StringMap . find_option id ! projects with | Some p -> f p | None -> let m = " Project ' " ^ id " ' ^ not found " in Lwt . return ( Api_common . result_error_msg ~ result_code ` : Not_found m ) |
let tmp_bind_projects f id projects = match Mods . StringMap . find_option id ! projects with | Some p -> f p | None -> let message = " Project ' " ^ id " ' ^ not found " in Lwt . return_error ( Exception_without_parameter . add_uncaught_error ( Exception_without_parameter . build_uncaught_exception ~ file_name " : rou... |
let tmp_bind_projects_raw f id projects = match Mods . StringMap . find_option id ! projects with | Some p -> f p | None -> let message = " Project ' " ^ id " ' ^ not found " in let err = Exception_without_parameter . add_uncaught_error ( Exception_without_parameter . build_uncaught_exception ~ file_name " : route_root... |
let add_projects parameter projects = let project_id = parameter . Api_types_j . project_parameter_project_id in if Mods . StringMap . mem project_id ! projects then let message = " project " ^ project_id " ^ exists " in Lwt . return ( Api_common . result_error_msg ~ result_code ` : Conflict message ) else let manager ... |
let delete_projects project_id projects : unit Api . result Lwt . t = match Mods . StringMap . pop project_id ! projects with | None , _ -> let m = " Project ' " ^ project_id " ' ^ not found " in Lwt . return ( Api_common . result_error_msg ~ result_code ` : Not_found m ) | Some m , p -> let ( ) = projects := p in let ... |
let influence_node_of_string = let rule_re = Re . compile ( Re . whole_string ( Re . seq [ Re . str " _rule_ " ; Re . group ( Re . rep1 Re . digit ) ] ) ) in let var_re = Re . compile ( Re . whole_string ( Re . seq [ Re . str " _var_ " ; Re . group ( Re . rep1 Re . digit ) ] ) ) in fun node_id -> match Re . exec_opt ru... |
let route ( ~ shutdown_key : string option ) : Webapp_common . route_handler list = let projects = ref Mods . StringMap . empty in [ { Webapp_common . path = " / v2 " ; Webapp_common . operation = let methods = [ ` OPTIONS ; ` GET ; ] in fun ~ context -> match context . Webapp_common . request . Cohttp . Request . meth... |
module Impl = Snarky . Snark . Make ( Snarky . Backends . Mnt4 . Default ) |
module type Fixed_rows = sig val no_arg : [ ` A ] val no_args : [ ` A | ` B ] val arg : [ ` A of int ] val args : [ ` A of int | ` B of bool ] val arg_noarg : [ ` A of int | ` B ] val noarg_arg : [ ` A | ` B of bool ] end |
module type Open_rows = sig val empty : [ > ] val no_arg : [ > ` A ] val no_args : [ > ` A | ` B ] val arg : [ > ` A of int ] val args : [ > ` A of int | ` B of bool ] val arg_noarg : [ > ` A of int | ` B ] val noarg_arg : [ > ` A | ` B of bool ] end |
module type Closed_rows = sig val no_arg : [ < ` A ] val no_args : [ < ` A | ` B ] val arg : [ < ` A of int ] val args : [ < ` A of int | ` B of bool ] val arg_noarg : [ < ` A of int | ` B ] val noarg_arg : [ < ` A | ` B of bool ] end |
module type Bounded_rows = sig val fixed_no_args : [ < ` A | ` B > ` A ` B ] val fixed_args : [ < ` A of int | ` B of bool > ` A ` B ] val no_args : [ < ` A | ` B > ` B ] val args : [ < ` A of int | ` B of bool > ` B ] end |
module Fixed_rows = struct let no_arg ( x : [ ` A ] ) ( y : [ ` A ] ) b = if b then x else y let no_args ( x : [ ` A | ` B ] ) ( y : [ ` A | ` B ] ) b = if b then x else y let arg ( x : [ ` A of int ] ) ( y : [ ` A of int ] ) b = if b then x else y let args ( x : [ ` A of int | ` B of bool ] ) ( y : [ ` A of int | ` B ... |
module Open_rows = struct let empty ( x : [ > ] ) ( y : [ > ] ) b = if b then x else y let no_arg ( x : [ > ` A ] ) ( y : [ > ` A ] ) b = if b then x else y let no_args ( x : [ > ` A | ` B ] ) ( y : [ > ` A | ` B ] ) b = if b then x else y let arg ( x : [ > ` A of int ] ) ( y : [ > ` A of int ] ) b = if b then x else y... |
module Closed_rows = struct let no_arg ( x : [ < ` A ] ) ( y : [ < ` A ] ) b = if b then x else y let no_args ( x : [ < ` A | ` B ] ) ( y : [ < ` A | ` B ] ) b = if b then x else y let arg ( x : [ < ` A of int ] ) ( y : [ < ` A of int ] ) b = if b then x else y let args ( x : [ < ` A of int | ` B of bool ] ) ( y : [ < ... |
module Bounded_rows = struct let fixed_no_args ( x : [ < ` A | ` B > ` A ` B ] ) ( y : [ < ` A | ` B > ` A ` B ] ) b = if b then x else y let fixed_args ( x : [ < ` A of int | ` B of bool > ` A ` B ] ) ( y : [ < ` A of int | ` B of bool > ` A ` B ] ) b = if b then x else y let no_args ( x : [ < ` A | ` B > ` B ] ) ( y ... |
module Mixed_rows = struct let fixed_open ( x : [ ` A ] ) ( y : [ > ] ) b = if b then x else y let fixed_closed ( x : [ ` A ] ) ( y : [ < ` A | ` B ] ) b = if b then x else y let fixed_bounded ( x : [ ` A ] ) ( y : [ < ` A | ` B > ` A ] ) b = if b then x else y let open_distinct ( x : [ > ` A ] ) ( y : [ > ` B ] ) b = ... |
module Copy_test = struct let f ( x1 : [ > ` A ] ) ( x2 : [ > ` B ] ) ( x3 : [ > ` C ] ) ( x4 : [ > ` D ] ) b = let y1 = if b then x1 else x2 in let y2 = if b then x3 else x4 in let y3 = if b then x2 else x4 in ( y1 , y2 , y3 ) let g ( x : [ ` A | ` B | ` C | ` D | ` E ] ) = f x x x x true let h ( x : [ ` A | ` B | ` C... |
module Expressions = struct let extend_open ( x : [ > ` A ] ) b = if b then x else ` B let match_open ( x : [ > ` A ] ) b = if b then x else ` A let match_closed ( x : [ ` A ] ) b = if b then x else ` A let expand_bounded ( x : [ < ` A | ` B > ` A ] ) b = if b then x else ` B let match_bounded ( x : [ < ` A | ` B > ` A... |
module Patterns = struct let extend_open ( x : [ > ` A ] ) = match x with ` B -> ` B | x -> x let match_open ( x : [ > ` A ] ) = match x with ` A -> ` A | x -> x let match_closed ( x : [ ` A ] ) = match x with ` A -> ` A let match_bounded ( x : [ < ` A | ` B > ` A ] ) = match x with ` B -> ` B | x -> x let extend_open_... |
type ' a table = int array * ' a array |
let encode ( displacement : int ) : int = if displacement >= 0 then displacement lsl 1 else ( - displacement ) lsl 1 + 1 |
let decode ( displacement : int ) : int = if displacement land 1 = 0 then displacement lsr 1 else ( - displacement lsr 1 ) |
type ' a row = ( int * ' a ) list |
let compress ( equal : ' a -> ' a -> bool ) ( insignificant : ' a -> bool ) ( dummy : ' a ) ( m : int ) ( n : int ) ( t : ' a array array ) : ' a table = assert ( Array . length t = m ) ; assert begin for i = 0 to m - 1 do assert ( Array . length t . ( i ) = n ) done ; true end ; let sparse ( i : int ) ( line : ' a arr... |
let get ( displacement , data ) i j = assert ( 0 <= i && i < Array . length displacement ) ; let k = decode displacement . ( i ) in assert ( 0 <= k + j && k + j < Array . length data ) ; data . ( k + j ) |
let getget get_displacement get_data ( displacement , data ) i j = let k = decode ( get_displacement displacement i ) in get_data data ( k + j ) |
let ( ) = Printexc . record_backtrace true |
let ( <= ) ( x : int ) y = x <= y [ @@ inline ] |
let min ( a : int ) b = if a <= b then a else b [ @@ inline ] |
let key : string -> key = fun key -> if String . contains key ' \ 000 ' then invalid_arg " Invalid key " ; key |
let src = Logs . Src . create " rowex " |
module Log = ( val Logs . src_log src : Logs . LOG ) |
module String = struct include Stdlib . String external unsafe_get_uint32 : string -> int -> int32 = " % caml_string_get32 " end |
let const x _ = x |
let size_of_word = Sys . word_size / 8 " bytecode_compilation_not_supported " " caml_uint64_of_uint " [ @@ noalloc ] " bytecode_compilation_not_supported " " caml_uint32_of_uint " [ @@ noalloc ] |
let leintnat_to_string v = if Sys . word_size = 64 && Sys . big_endian then let v = bswap64 ( uint64_of_uint v ) in let res = Bytes . create 8 in bytes_set64 res 0 v ; Bytes . unsafe_to_string res else if Sys . word_size = 64 then let v = uint64_of_uint v in let res = Bytes . create 8 in bytes_set64 res 0 v ; Bytes . u... |
let leint31_to_string v = if Sys . big_endian then let res = Bytes . create 4 in bytes_set32 res 0 ( bswap32 ( Int32 . of_int v ) ) ; Bytes . unsafe_to_string res else let res = Bytes . create 4 in bytes_set32 res 0 ( Int32 . of_int v ) ; Bytes . unsafe_to_string res [ @@ inline ] |
type ' a rd = < rd : unit ; . . > as ' a |
type ' a wr = < wr : unit ; . . > as ' a |
type ro = < rd : unit ; > |
type wo = < wr : unit ; > |
type rdwr = < rd : unit ; wr : unit ; > |
module rec Leaf : sig type t [ @@ immediate ] val prj : t -> ' a Addr . t val inj : ' a Addr . t -> t type t = int let prj x = x lsr 1 [ @@ inline always ] let inj x = ( x lsl 1 ) lor 1 [ @@ inline always ] end type ' a t = private int val length : int val null : ro t val is_null : ' a t -> bool external of_int_to_rdon... |
let string_of_null_addr = leintnat_to_string ( Addr . null :> int ) |
type ( ' c , ' a ) value = | Int8 : ( atomic , int ) value | LEInt : ( atomic , int ) value | LEInt16 : ( atomic , int ) value | LEInt31 : ( atomic , int ) value | LEInt64 : ( atomic , int64 ) value | LEInt128 : ( atomic , string ) value | Addr_rd : ( atomic , ro Addr . t ) value | C_string : ( non_atomic , string ) va... |
module type S = sig type ' a t val bind : ' a t -> ( ' a -> ' b t ) -> ' b t val return : ' a -> ' a t val atomic_get : ' a rd Addr . t -> ( atomic , ' v ) value -> ' v t val atomic_set : ' a wr Addr . t -> ( atomic , ' v ) value -> ' v -> unit t val persist : ' a wr Addr . t -> len : int -> unit t val fetch_add : rdwr... |
type ' a fmt = Format . formatter -> ' a -> unit |
let pf ppf fmt = Format . fprintf ppf fmt |
let pp_value : type c a . ( c , a ) value fmt = fun ppf -> function | LEInt -> pf ppf " leintnat " | LEInt31 -> pf ppf " leint31 " | LEInt16 -> pf ppf " leint16 " | LEInt64 -> pf ppf " leint64 " | LEInt128 -> pf ppf " leint128 " | Int8 -> pf ppf " int8 " | Addr_rd -> pf ppf " addr " | C_string -> pf ppf " c_string " |
let fmt fmt = fun ppf -> pf ppf fmt |
let pp_of_value : type c a . ( c , a ) value -> a fmt = function | LEInt -> fun ppf v -> if v < 0 then pf ppf " % 16x " v else pf ppf " % 10d " v | LEInt31 -> fmt " % 10d " | LEInt16 -> fmt " % 5d " | LEInt64 -> fmt " % 19Ld " | LEInt128 -> fmt " % S " | Int8 -> fmt " % 3d " | Addr_rd -> fun ppf addr -> pf ppf " % 016x... |
module Value = struct let int8 = Int8 let leint16 = LEInt16 let leint31 = LEInt31 let leintnat = LEInt let leint64 = LEInt64 let leint128 = LEInt128 let addr_rd = Addr_rd let c_string = C_string end |
let ( . <> ) f g = fun x -> f ( g x ) |
let _header_prefix_count = _header_prefix + _prefix |
let _header_kind = _header_prefix_count + 4 |
let _header_owner = if Sys . word_size = 64 then _header_kind + 8 else _header_kind + 4 |
let _header_depth = if Sys . word_size = 64 then _header_owner + 8 else _header_owner + 4 |
let _header_count = _header_depth + 4 |
let _header_compact_count = _header_count + 2 |
let _header_length = _header_compact_count + 2 |
let ( ) = match Sys . word_size = 64 with | true -> assert ( _header_length = 32 ) | false -> assert ( _header_length = 24 ) |
let _bits_kind = Sys . word_size - 3 |
module Make ( S : S ) = struct let ( let * ) = S . bind let ( >>| ) x f = S . bind x ( S . return . <> f ) open S let get_version addr = atomic_get Addr . ( addr + _header_kind ) Value . leintnat [ @@ inline ] let get_type addr = let * value = atomic_get Addr . ( addr + _header_kind ) Value . leintnat in return ( value... |
let get_connections ? endpoint ? hooks ? peer_id client = match peer_id with | None -> let path = [ " network " ; " connections " ] in Client . rpc ? endpoint ? hooks GET path client | Some peer_id -> let path = [ " network " ; " connections " ; peer_id ] in Client . rpc ? endpoint ? hooks GET path client |
let get_greylist_ips ? hooks client = let path = [ " network " ; " greylist " ; " ips " ] in Client . rpc ? hooks GET path client |
let get_chain_id ? endpoint ? hooks ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " chain_id " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_block ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ] in Client . rpc ? endpoint ? hooks GET path client |
let get_block_hash ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " hash " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_block_metadata ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " metadata " ] in Client . rpc ? endpoint ? hooks GET path client |
let force_bootstrapped ? endpoint ? hooks ( ? chain = " main " ) ( ? bootstrapped = true ) client = let path = [ " chains " ; chain ] in let data = ` O [ ( " bootstrapped " , ` Bool bootstrapped ) ] in Client . rpc ? endpoint ? hooks ~ data PATCH path client |
let is_bootstrapped ? endpoint ? hooks ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " is_bootstrapped " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_checkpoint ? endpoint ? hooks ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " levels " ; " checkpoint " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_savepoint ? endpoint ? hooks ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " levels " ; " savepoint " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_caboose ? endpoint ? hooks ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " levels " ; " caboose " ] in Client . rpc ? endpoint ? hooks GET path client |
let raw_protocol_data ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " header " ; " protocol_data " ; " raw " ] in Lwt . ( Client . rpc ? endpoint ? hooks GET path client >|= JSON . as_string ) |
let get_protocol_data ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) ( ? offset = 0 ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " header " ; " protocol_data " ] in let query_string = [ ( " offset " , string_of_int offset ) ] in Client . rpc ? endpoint ? hooks GET path ~ query_str... |
let get_branch ( ? offset = 2 ) ? endpoint ? hooks ( ? chain = " main " ) client = let block = sf " head ~% d " offset in let path = [ " chains " ; chain ; " blocks " ; block ; " hash " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_operations ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " operations " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_mempool_pending_operations ? endpoint ? hooks ( ? chain = " main " ) ? version ? applied ? branch_delayed ? branch_refused ? refused ? outdated client = let path = [ " chains " ; chain ; " mempool " ; " pending_operations " ] in let query_parameter param param_s = match param with | None -> [ ] | Some true -> [... |
let mempool_request_operations ? endpoint ( ? chain = " main " ) ? peer client = let path = [ " chains " ; chain ; " mempool " ; " request_operations " ] in Client . rpc ? endpoint POST path ~ query_string ( : match peer with None -> [ ] | Some p -> [ ( " peer_id " , p ) ] ) client |
let mempool_ban_operation ? endpoint ( ? chain = " main " ) ~ data client = let path = [ " chains " ; chain ; " mempool " ; " ban_operation " ] in Client . rpc ? endpoint ~ data POST path client |
let mempool_unban_operation ? endpoint ( ? chain = " main " ) ~ data client = let path = [ " chains " ; chain ; " mempool " ; " unban_operation " ] in Client . rpc ? endpoint ~ data POST path client |
let mempool_unban_all_operations ? endpoint ( ? chain = " main " ) client = let path = [ " chains " ; chain ; " mempool " ; " unban_all_operations " ] in Client . rpc ? endpoint POST path client |
let get_mempool_filter ? endpoint ? hooks ( ? chain = " main " ) ? include_default client = let path = [ " chains " ; chain ; " mempool " ; " filter " ] in let query_string = Option . map ( fun b -> [ ( " include_default " , string_of_bool b ) ] ) include_default in Client . rpc ? endpoint ? hooks ? query_string GET pa... |
let post_mempool_filter ? endpoint ? hooks ( ? chain = " main " ) ~ data client = let path = [ " chains " ; chain ; " mempool " ; " filter " ] in Client . rpc ? endpoint ? hooks ~ data POST path client |
let preapply_block ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) ~ data client = let path = [ " chains " ; chain ; " blocks " ; block ; " helpers " ; " preapply " ; " block " ] in Client . rpc ? endpoint ? hooks ~ data POST path client |
let inject_block ? endpoint ? hooks ~ data client = let path = [ " injection " ; " block " ] in Client . rpc ? endpoint ? hooks ~ data POST path client |
let inject_operation ? endpoint ? hooks ( ? async = false ) ~ data client = let path = [ " injection " ; " operation " ] in let query_string = if async then [ ( " async " , " " ) ] else [ ] in Client . rpc ? endpoint ? hooks ~ query_string ~ data POST path client |
let spawn_inject_operation ? endpoint ? hooks ( ? async = false ) ~ data client = let path = [ " injection " ; " operation " ] in let query_string = if async then [ ( " async " , " " ) ] else [ ] in Client . spawn_rpc ? endpoint ? hooks ~ query_string ~ data POST path client |
let private_inject_operation ? endpoint ? hooks ( ? async = false ) ~ data client = let path = [ " private " ; " injection " ; " operation " ] in let query_string = if async then [ ( " async " , " " ) ] else [ ] in Client . rpc ? endpoint ? hooks ~ query_string ~ data POST path client |
let spawn_private_inject_operation ? endpoint ? hooks ( ? async = false ) ~ data client = let path = [ " private " ; " injection " ; " operation " ] in let query_string = if async then [ ( " async " , " " ) ] else [ ] in Client . spawn_rpc ? endpoint ? hooks ~ query_string ~ data POST path client |
let get_constants ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " context " ; " constants " ] in Client . rpc ? endpoint ? hooks GET path client |
let get_constants_errors ? endpoint ? hooks ( ? chain = " main " ) ( ? block = " head " ) client = let path = [ " chains " ; chain ; " blocks " ; block ; " context " ; " constants " ; " errors " ] in Client . rpc ? endpoint ? hooks GET path client |
type ctxt_type = Bytes | Json |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.