text
stringlengths
0
601k
let typerep_of_tuple2 a b = Typerep . Tuple ( Typerep . Tuple . T2 ( a , b ) )
let typerep_of_tuple3 a b c = Typerep . Tuple ( Typerep . Tuple . T3 ( a , b , c ) )
let typerep_of_tuple4 a b c d = Typerep . Tuple ( Typerep . Tuple . T4 ( a , b , c , d ) )
let typerep_of_tuple5 a b c d e = Typerep . Tuple ( Typerep . Tuple . T5 ( a , b , c , d , e ) )
let typerep_of_int63 , typename_of_int63 = let typerep_and_typename_of_int63_repr : type a b . ( a , b ) Base . Int63 . Private . Repr . t -> a Typerep . t * a Typename . t = function | Base . Int63 . Private . Repr . Int -> typerep_of_int , typename_of_int | Base . Int63 . Private . Repr . Int64 -> typerep_of_int64 , ...
let wolfe_search ( ? c1 = 1e - 4 ) ( ? c2 = 0 . 9 ) ( ? init = 1 . 0 ) df f p x = let middle lo hi = 0 . 5 . * ( lo . + hi ) in let upper alpha = function | None -> 2 . 0 . * alpha | Some hi -> middle alpha hi in let q = dot p ( df x ) in let y = f x in let xap = Vec . create ( Vec . dim x ) in let rec aux lo hi alpha ...
let steepest_descent_wolfe ~ loops df f x = for i = 1 to loops do let p = Vec . neg ( df x ) in let eta = wolfe_search df f p x in axpy ~ alpha : eta p x ; printf " Loop % d : f = % g , x = [ @% a ] . " @@ i ( f x ) pp_rfvec x done
let gauss a b x = let xb = Vec . sub x b in . ~- ( exp ( dot xb ( symv a xb ) . / 2 . 0 ) )
let dgauss a b x = symv ~ alpha ( : gauss a b x ) a ( Vec . sub x b )
let ( ) = let a = [ % mat [ - 0 . 1 , 0 . 1 ; 0 . 1 , - 0 . 2 ] ] in let b = [ % vec [ 1 . 0 ; 3 . 0 ] ] in steepest_descent_wolfe ~ loops : 60 ( dgauss a b ) ( gauss a b ) [ % vec [ 0 . ; 1 . ] ]
let myinit ( ) = let yellow_diffuse = ( 0 . 7 , 0 . 7 , 0 . 0 , 1 . 0 ) and yellow_specular = ( 1 . 0 , 1 . 0 , 1 . 0 , 1 . 0 ) and blue_diffuse = ( 0 . 1 , 0 . 1 , 0 . 7 , 1 . 0 ) and blue_specular = ( 0 . 1 , 1 . 0 , 1 . 0 , 1 . 0 ) and position_one = ( 1 . 0 , 1 . 0 , 1 . 0 , 0 . 0 ) in glNewList yellow_mat GL_COMPI...
let display ( ) = glClear [ GL_COLOR_BUFFER_BIT ; GL_DEPTH_BUFFER_BIT ] ; glStencilOp GL_KEEP GL_KEEP GL_KEEP ; glStencilFunc GL_EQUAL 0x1 0x1 ; glCallList blue_mat ; glutSolidSphere 0 . 5 15 15 ; glStencilFunc GL_NOTEQUAL 0x1 0x1 ; glPushMatrix ( ) ; glRotate 45 . 0 0 . 0 0 . 0 1 . 0 ; glRotate 45 . 0 0 . 0 1 . 0 0 . ...
let reshape ~ width : w ~ height : h = glViewport 0 0 w h ; glClear [ GL_STENCIL_BUFFER_BIT ] ; glMatrixMode GL_PROJECTION ; glLoadIdentity ( ) ; glOrtho ( - 3 . 0 ) ( 3 . 0 ) ( - 3 . 0 ) ( 3 . 0 ) ( - 1 . 0 ) ( 1 . 0 ) ; glMatrixMode GL_MODELVIEW ; glLoadIdentity ( ) ; glStencilFunc GL_ALWAYS 0x1 0x1 ; glStencilOp GL_...
let keyboard ~ key ~ x ~ y = begin match key with | ' \ 027 ' -> exit 0 ; | _ -> ( ) end ; glutPostRedisplay ( ) ; ; ;
let ( ) = ignore ( glutInit Sys . argv ) ; glutInitDisplayMode [ GLUT_DOUBLE ; GLUT_RGB ; GLUT_DEPTH ; GLUT_STENCIL ] ; glutInitWindowSize 400 400 ; ignore ( glutCreateWindow Sys . argv . ( 0 ) ) ; myinit ( ) ; glutReshapeFunc ~ reshape ; glutDisplayFunc ~ display ; glutKeyboardFunc ~ keyboard ; glutMainLoop ( ) ; ; ;
let init ( ) = glShadeModel GL_FLAT ; glClearColor 0 . 0 0 . 0 0 . 0 0 . 0 ; glClearStencil 0 ; glStencilMask 1 ; glEnable GL_STENCIL_TEST ; ; ;
let reshape ~ width ~ height = glViewport 0 0 width height ; glMatrixMode GL_PROJECTION ; glLoadIdentity ( ) ; glOrtho ( - 5 . 0 ) ( 5 . 0 ) ( - 5 . 0 ) ( 5 . 0 ) ( - 5 . 0 ) ( 5 . 0 ) ; glMatrixMode GL_MODELVIEW ; ; ;
let keyboard ~ key ~ x ~ y = match key with ' \ 027 ' -> exit 0 | _ -> ( ) ; ;
let display ( ) = glClear [ GL_COLOR_BUFFER_BIT ; GL_STENCIL_BUFFER_BIT ] ; glStencilFunc GL_ALWAYS 1 1 ; glStencilOp GL_KEEP GL_KEEP GL_REPLACE ; glColor3c ' \ 200 ' ' \ 000 ' ' \ 000 ' ; glBegin GL_POLYGON ; glVertex3 ( - 4 . ) ( - 4 . ) ( 0 . ) ; glVertex3 ( 4 . ) ( - 4 . ) ( 0 . ) ; glVertex3 ( 0 . ) ( 4 . ) ( 0 . ...
let args ~ argv = let argc = Array . length argv in for i = 1 to pred argc do if argv . ( i ) = " - dr " then ( ) else invalid_arg ( Printf . sprintf " % s ( Bad option ) . " argv . ( i ) ) ; done ; ; ;
let ( ) = let argv = glutInit Sys . argv in args ~ argv ; glutInitWindowPosition 0 0 ; glutInitWindowSize 300 300 ; let type_ = [ GLUT_RGB ; GLUT_SINGLE ; GLUT_STENCIL ] in glutInitDisplayMode type_ ; ignore ( glutCreateWindow " Stencil Test " ) ; init ( ) ; glutReshapeFunc ~ reshape ; glutKeyboardFunc ~ keyboard ; glu...
module Make ( A : T0 ) T0 ( A_value : sig type t val to_field_elements : t -> Tick . Field . t array end ) end ( Max_proofs_verified : Nat . Add . Intf_transparent ) Intf_transparent = struct let double_zip = Double . map2 ~ f : Core_kernel . Tuple2 . create module E = struct type t = Tock . Field . t array Plonk_types...
let nop = POP 0
let remap_instr ptr_map instr = let map_ptr ptr = ptr_map . ( ptr ) in match instr with | PUSH_RETADDR ptr -> PUSH_RETADDR ( map_ptr ptr ) | CLOSURE ( n , ptr ) -> CLOSURE ( n , map_ptr ptr ) | CLOSUREREC ( n , ptrs ) -> CLOSUREREC ( n , Array . map map_ptr ptrs ) | BRANCH ptr -> BRANCH ( map_ptr ptr ) | BRANCHIF ptr -...
let remap_code ptr_map new_code = Array . map ( remap_instr ptr_map ) new_code ; ;
let compute_cleanables orig_code data = let nb_glob = Array . length data in let setg_counters = Array . make nb_glob 0 in let getg_counters = Array . make nb_glob 0 in let getg_fields = Array . make nb_glob [ ] in let setg_ind = Array . make nb_glob 0 in let cleanables = Array . make nb_glob None in for ind = 0 to Arr...
let compute_branch_targets code = let nb_instr = Array . length code in let btargs = Array . make nb_instr false in Array . iter ( fun instr -> let ptrs = get_ptrs instr in List . iter ( fun ptr -> btargs . ( ptr ) <- true ) ptrs ; ) code ; btargs ; ;
let prepare_code old_code cleanables ignore_fulls = let btargs = compute_branch_targets old_code in let glob_nb = Array . length cleanables in let add_nb = ref 0 in let rec f indg adds cleans = if indg < glob_nb then match cleanables . ( indg ) with | Some ( setg_ind , used_fields ) -> if setg_ind >= 2 && not btargs . ...
let clean_code new_code data cleans = let data_map = Array . make ( Array . length data ) [ ] || in let update_new_code ( setg_ind , used_fields ) = match new_code . ( setg_ind - 2 ) , new_code . ( setg_ind - 1 ) , new_code . ( setg_ind ) with | MAKEBLOCK ( mbt , mbs ) , POP pn , SETGLOBAL sgn -> let nb_used_fields = L...
let clean old_code data = let cleanables = compute_cleanables old_code data in let ( new_code , cleans ) = prepare_code old_code cleanables true in clean_code new_code data cleans ; new_code ; ;
let is_removable prim bc = match bc with | C_CALL ( _ , p ) -> Prim . no_side_effect prim . ( p ) | POP _ | APPLY _ | PUSHTRAP _ | POPTRAP | RAISE | RERAISE | RAISE_NOTRACE | OFFSETCLOSURE _ | OFFSETREF _ | CHECK_SIGNALS | SETGLOBAL _ | SETVECTITEM | SETBYTESCHAR | BRANCH _ | BRANCHIF _ | BRANCHIFNOT _ | SWITCH ( _ , _...
let compute_deps code = let nb_instr = Array . length code in let stacks = Array . make nb_instr [ ] || in let accus = Array . make nb_instr [ ] in let stack_sizes = Array . make nb_instr ( - 1 ) in let use_ind = Array . make nb_instr [ ] in let use = Array . make nb_instr [ ] in let used_by = Array . make nb_instr 0 i...
let compute_cleanables code prim in_main use used_by = let nb_instr = Array . length code in let cleanables = Array . make nb_instr false in let rec f i = if in_main . ( i ) && used_by . ( i ) = 0 && is_removable prim code . ( i ) then let ui = use . ( i ) in use . ( i ) <- [ ] ; cleanables . ( i ) <- true ; List . ite...
let compute_blocked code accus stacks in_main use_ind cleanables = let nb_instr = Array . length accus in let blocked = Array . make nb_instr false in let check l = if List . exists ( fun k -> not cleanables . ( k ) ) l then List . iter ( fun k -> blocked . ( k ) <- true ) l in for i = 0 to nb_instr - 1 do if in_main ....
let clean_code code stacks in_main cleanables blocked = let nb_instr = Array . length code in let error ( ) = failwith " Step2 . clean_code " in for i = 0 to nb_instr - 1 do let compute_new_stack_top_size n = let rec f l k i r = if k = 0 then r else let n = List . hd l . ( i ) in f l ( pred k ) ( i + 1 ) ( if cleanable...
let clean code prim = let ( accus , stacks , _ , in_main , use_ind , use , used_by ) = compute_deps code in let cleanables = compute_cleanables code prim in_main use used_by in let blocked = compute_blocked code accus stacks in_main use_ind cleanables in clean_code code stacks in_main cleanables blocked ; ; ;
let compute_used code = let nb_instr = Array . length code in let used = Array . make nb_instr false in let rec f i = if i < nb_instr && not used . ( i ) then ( used . ( i ) <- true ; match code . ( i ) with | BRANCH ptr -> f ptr | BRANCHIF ptr | BRANCHIFNOT ptr | COMPBRANCH ( _ , _ , ptr ) | PUSH_RETADDR ptr | CLOSURE...
let clean_code code used = let nb_instr = Array . length code in for i = 0 to nb_instr - 1 do if not used . ( i ) then code . ( i ) <- Step1 . nop ; done ; ;
let clean code = let used = compute_used code in clean_code code used ; ; ;
type ( ' a_var , ' a_value , ' max_proofs_verified , ' branches , ' prev_vars , ' prev_values , ' local_widths , ' local_heights ) t = | T : { proofs_verified : ' proofs_verified Nat . t * ( ' prev_vars , ' proofs_verified ) ' proofs_verified Hlist . Length . t ; index : Types . Index . t ; lte : ( ' proofs_verified , ...
let create ( type branches max_proofs_verified local_signature local_branches a_var a_value prev_vars prev_values ) ~ index ( ~ self : ( a_var , a_value , max_proofs_verified , branches ) branches Tag . t ) t ~ wrap_domains ( ~ max_proofs_verified : max_proofs_verified Nat . t ) t ( ~ proofs_verifieds : ( int , branche...
let one_hot_vector_to_num ( type n ) n ( v : n Per_proof_witness . One_hot_vector . t ) t : Field . t = let n = Vector . length ( v :> ( Boolean . var , n ) n Vector . t ) t in Pseudo . choose ( v , Vector . init n ~ f : Field . of_int ) of_int ~ f : Fn . id
let one_hot_vector_to_index v = one_hot_vector_to_num v |> Types . Index . of_field ( module Impl ) Impl
let verify_one ( { app_state ; wrap_proof ; proof_state ; prev_proof_evals ; prev_challenges ; prev_challenge_polynomial_commitments } : _ Per_proof_witness . t ) ( d : _ Types_map . For_step . t ) t ( pass_through : Digest . t ) t ( unfinalized : Unfinalized . t ) t ( should_verify : B . t ) t : _ Vector . t * B . t =...
let step_main : type proofs_verified self_branches prev_vars prev_values a_var a_value max_proofs_verified local_branches local_signature . ( module Requests . Step . S with type local_signature = local_signature and type local_branches = local_branches and type statement = a_value and type prev_values = prev_values an...
let sponge_params_constant = Sponge . Params ( . map pasta_p_kimchi ~ f : Impl . Field . Constant . of_string ) of_string
let tick_field_random_oracle ( ? length = Tick . Field . size_in_bits - 1 ) 1 s = Tick . Field . of_bits ( bits_random_oracle ~ length s ) s
let unrelated_g = let group_map = unstage ( group_map ( module Tick . Field ) Field ~ a : Tick . Inner_curve . Params . a ~ b : Tick . Inner_curve . Params . b ) and str = Fn . compose bits_to_bytes Tick . Field . to_bits in fun ( x , y ) y -> group_map ( tick_field_random_oracle ( str x ^ str y ) y ) y
module Other_field = struct type t = Tock . Field . t [ @@ deriving sexp ] sexp include ( Tock . Field : module type of Tock . Field with type t := t ) t let size = Impls . Wrap . Bigint . to_bignum_bigint size end
let sponge_params = Sponge . Params ( . map sponge_params_constant ~ f : Impl . Field . constant ) constant
module Unsafe = struct let unpack_unboolean ( ? length = Field . size_in_bits ) size_in_bits x = let res = exists ( Typ . list Boolean . typ_unchecked ~ length ) length ~ compute : As_prover ( . fun ( ) -> List . take ( Field . Constant . unpack ( read_var x ) x ) x length ) length in Field . Assert . equal x ( Field ....
module Sponge = struct module Permutation = Sponge_inputs . Make ( Impl ) Impl ( struct include Tick_field_sponge . Inputs let params = Tick_field_sponge . params end ) end module S = Sponge . Make_sponge ( Permutation ) Permutation include S let squeeze_field = squeeze let squeeze = squeeze let absorb t input = match ...
module Input_domain = struct let domain = Domain . Pow_2_roots_of_unity 6 let lagrange_commitments = lazy ( let domain_size = Domain . size domain in time " lagrange " ( fun ( ) -> Array . init domain_size ~ f ( : fun i -> let v = ( Kimchi_bindings . Protocol . SRS . Fq . lagrange_commitment ( Backend . Tock . Keypair ...
module Inner_curve = struct module C = Kimchi_pasta . Pasta . Pallas module Inputs = struct module Impl = Impl module Params = struct open Impl . Field . Constant include C . Params let one = C . to_affine_exn C . one let group_size_in_bits = Field . size_in_bits end module F = struct include struct open Impl . Field t...
module Ops = Plonk_curve_ops . Make ( Impl ) Impl ( Inner_curve ) Inner_curve let open Impl in let module T = Internal_Basic in let module G = Inner_curve in let n = Field . size_in_bits in let module F = struct type t = Field . t let typ = Field . typ module Constant = struct include Field . Constant let to_bigint = I...
module Generators = struct let h = lazy ( Kimchi_bindings . Protocol . SRS . Fq . urs_h ( Backend . Tock . Keypair . load_urs ( ) ) |> Common . finite_exn ) end
module Make ( Inputs : Intf . Step_main_inputs . S with type Impl . field = Backend . Tick . Field . t and type Impl . Bigint . t = Backend . Tick . Bigint . R . t and type Inner_curve . Constant . Scalar . t = Backend . Tock . Field . t ) t = struct open Inputs open Impl module PC = Inner_curve module Challenge = Chal...
type sticky_sampler = { mutable error_tolerance : float ; mutable support : float ; mutable s : ( string , int ) Hashtbl . t ; mutable r : int ; mutable failure_prob : float ; mutable n : int ; mutable t : float ; mutable required_samples : int ; }
let new_sampler ~ support ~ error_tolerance ~ failure_prob = let t = 2 . 0 . / error_tolerance . * log ( 1 . 0 . / ( support . * failure_prob ) ) in { error_tolerance ; support ; failure_prob ; r = 1 ; n = 0 ; t ; required_samples = int_of_float t ; s = Hashtbl . create 7 ; }
let prune t = let filter key value = let value = ref value in while Random . int 2 <> 0 && ! value > 0 do decr value done ; let value = ! value in if value <= 0 then None else Some value in let x = Hashtbl . length t . s in Hashtbl . filter_map_inplace filter t . s ; Printf . eprintf " prune ( [ % d elements ] ) = [ % ...
let items_above_threshold t tresh = let select k f acc = let f = float f in if f >= ( tresh . - t . error_tolerance ) . * float t . n then ( k , f . / float t . n . + t . support ) :: acc else acc in Hashtbl . fold select t . s
let observe t key = t . n <- t . n + 1 ; if float t . n > t . t then ( t . t <- t . t . * 2 . 0 ; t . r <- t . r * 2 ; prune t ) ; match Hashtbl . find t . s key with | exception Not_found -> Hashtbl . add t . s key 1 | n -> if Random . float ( float t . r ) <= 1 . 0 then ( Hashtbl . replace t . s key ( n + 1 ) )
let remove_user_commands_input_commands = let open Combinators in let predicate json = let open Option . Let_syntax in let open Pattern in compute_validity ( assoc_list json >>= ( key_and_value ~ key " : name " ~ value ( : String " user_commands_insert_input ) " && key_and_value ~ key " : enumValues " ~ value : Null ) ...
let change_constraint = let open Combinators in let predicate json = let open Option . Let_syntax in let open Pattern in compute_validity ( assoc_list json >>= key_and_value ~ key " : name " ~ value ( : String " constraint ) " ) in let action json = let open Change in association_list json ~ f : ( value_with_name " nam...
let read_json json_string = let json = Yojson . Basic . from_string json_string in let cleaned_user_commands = remove_user_commands_input_commands json in Core . print_string @@ Yojson . Basic . prettify @@ Yojson . Basic . to_string cleaned_user_commands
let read_from_standard_input ( ) = let json_string = Core . In_channel . input_all Core . In_channel . stdin in let json = Yojson . Basic . from_string json_string |> remove_user_commands_input_commands |> change_constraint in Core . print_string @@ Yojson . Basic . prettify @@ Yojson . Basic . to_string json ; ( )
let ( ) = read_from_standard_input ( )
module StConf = struct type cmd = | Push of char | Pop | Top | Clear | Is_empty | Length | Fold of ( string -> char -> string ) fun_ * string [ @ printer fun fmt ( f , s ) -> fprintf fmt " ( % s , " \% s " ) " \ ( Fn . print f ) ( Print . string s ) ] [ @@ deriving show { with_path = false } ] type state = char list ty...
module StT = QCSTM . Make ( StConf ) ; ; [ StT . consistency_test ~ count : 1000 ~ name " : stack - consistency " ; StT . agree_test ~ count : 10_000 ~ name " : stack - model " ]
type ' a ref " ocamljava_stm_init " " ocamljava_stm_make_transaction " " ocamljava_stm_make_ref " " ocamljava_stm_get " " ocamljava_stm_set " " ocamljava_stm_commit " " ocamljava_stm_invalidate "
let ( ) = Callback . register_exception " Concurrent . STM . Retry " Retry
let ref x = make_ref x
let rec run ( ? retries = default_retries ) default_retries f = let trans = make_transaction ( ) in let getter = get trans in let setter = set trans in try let res = f getter setter in commit trans ; res with | Retry -> if retries > 0 then run ~ retries ( : pred retries ) retries f else raise Cancelled | e -> invalidat...
let rec run_read_only ( ? retries = default_retries ) default_retries f = let trans = make_transaction ( ) in let getter = get trans in try f getter with | Retry -> if retries > 0 then run_read_only ~ retries ( : pred retries ) retries f else raise Cancelled | e -> invalidate trans ; raise e
let ( ) = init ( )
type stochastic_class = { stochastic_class : Ckappa_sig . c_site_name list Ckappa_sig . Agent_type_quick_nearly_Inf_Int_storage_Imperatif . t }
let scan_rule parameters error _handler rule _classes = let error , store_result = Ckappa_sig . Agent_type_quick_nearly_Inf_Int_storage_Imperatif . create parameters error 0 in let error , stochastic_class_rhs = List . fold_left ( fun ( error , store_result ) ( agent_id , agent_type ) -> let error , agent = Ckappa_sig ...
let get_nsites parameters error key handler = let error , get_nsites = Ckappa_sig . Agent_type_nearly_Inf_Int_storage_Imperatif . unsafe_get parameters error key handler . Cckappa_sig . sites in let error , sites_dic = match get_nsites with | None -> Exception . warn parameters error __POS__ Exit ( Ckappa_sig . Diction...
let scan_rule_set parameters error handler rules = let nagents = handler . Cckappa_sig . nagents in let error , init_stochastic_class = Ckappa_sig . Agent_type_quick_nearly_Inf_Int_storage_Imperatif . create_biggest_key parameters error nagents in let error , init = Ckappa_sig . Agent_type_quick_nearly_Inf_Int_storage_...
let sprintf_array parameters error handler agent_type array = let acc = ref " [ " | in let error = Ckappa_sig . Site_union_find . iteri parameters error ( fun parameters error i site_type -> let error , site_string = try Handler . string_of_site parameters error handler agent_type site_type with | _ -> Exception . warn...
let print_array parameters error handler agent_type array = let error , output = sprintf_array parameters error handler agent_type array in let _ = Printf . fprintf stdout " % s \ n " output in error
let print_stochastic_class parameters error handler result = Ckappa_sig . Agent_type_quick_nearly_Inf_Int_storage_Imperatif . iter parameters error ( fun parameters error agent_type array_site_type -> let error = if Remanent_parameters . get_do_stochastic_flow_of_information parameters then let parameters = Remanent_pa...
let stochastic_classes parameters error handler cc_compil = let error , result = scan_rule_set parameters error handler cc_compil . Cckappa_sig . rules in let _ = print_stochastic_class parameters error handler result in error , result
module Scale = struct type t = [ ` log | ` linear ] [ @@ deriving enumerate , equal , sexp ] let to_string t = sexp_of_t t |> Sexp . to_string end
let scale : ( Scale . t * Vdom . Node . t ) Computation . t = let % sub scale_state = Bonsai . state [ % here ] ( module Scale ) ~ default_model ` : log in return @@ let % map scale , set_scale = scale_state in let view = Vdom_input_widgets . Dropdown . of_enum ( module Scale ) ~ selected : scale ~ on_change : set_scal...
let data = let local_tz = Lazy . force Timezone . local in Dygraph . Data . create_date ~ zone : local_tz ( Array . of_list ( List . map Stock_data . data ~ f ( : fun ( date , a , b ) -> date , [ | a ; b ] ) ) ) | |> Value . return ; ;
let options ~ logscale = let series_options = Dygraph . Options . Series_options . create ( ) ~ strokePattern : Dygraph . Options . Line_pattern . dashed in Dygraph . Options . create ( ) ~ width : 800 ~ logscale ~ series ( : Dygraph . Options . Series . create [ " Nominal " , series_options ] ) ~ highlightSeriesOpts :...
let app = let x_label = " Month " in let y_labels = [ " Nominal " ; " Real " ] in let % sub scale , scale_view = scale in let options = match % map scale with | ` log -> options ~ logscale : true | ` linear -> options ~ logscale : false in let % sub graph = Dygraph . With_bonsai . create ~ key ( " : graph " |> Value . ...
let data : ( Date . t * float * float ) list = let parse_custom_bars s = match String . split s ~ on ' ; ' : with | [ _low ; middle ; _high ] -> Float . of_string middle | _ -> raise_s [ % message " bug " ] in List . map ~ f ( : fun s -> match String . split s ~ on ' , ' : with | [ date ; nominal ; real ] -> Date . of_...
let to_http service region req = let uri = Uri . add_query_params ( Uri . of_string ( Aws . Util . of_option_exn ( Endpoints . url_of service region ) ) ) ( List . append [ ( " Version " , [ " 2014 - 10 - 31 " ] ) ; ( " Action " , [ " StopActivityStream " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Query . ren...
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Util . option_bind ( Xml . member " StopActivityStreamResponse " ( snd xml ) ) ( Xml . member " StopActivityStreamResult " ) in try Util . or_error ( Util . option_bind resp StopActivityStreamResponse . parse ) ( let open Error in BadResponse { bo...
let parse_error code err = let errors = [ ] @ Errors_internal . common in match Errors_internal . of_string err with | Some var -> if ( List . mem var errors ) && ( ( match Errors_internal . to_http_code var with | Some var -> var = code | None -> true ) ) then Some var else None | None -> None
let to_http service region req = let uri = Uri . add_query_params ( Uri . of_string ( Aws . Util . of_option_exn ( Endpoints . url_of service region ) ) ) ( List . append [ ( " Version " , [ " 2014 - 10 - 31 " ] ) ; ( " Action " , [ " StopDBCluster " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Query . render (...
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Util . option_bind ( Xml . member " StopDBClusterResponse " ( snd xml ) ) ( Xml . member " StopDBClusterResult " ) in try Util . or_error ( Util . option_bind resp StopDBClusterResult . parse ) ( let open Error in BadResponse { body ; message = " ...
let parse_error code err = let errors = [ ] @ Errors_internal . common in match Errors_internal . of_string err with | Some var -> if ( List . mem var errors ) && ( ( match Errors_internal . to_http_code var with | Some var -> var = code | None -> true ) ) then Some var else None | None -> None
let to_http service region req = let uri = Uri . add_query_params ( Uri . of_string ( Aws . Util . of_option_exn ( Endpoints . url_of service region ) ) ) ( List . append [ ( " Version " , [ " 2014 - 10 - 31 " ] ) ; ( " Action " , [ " StopDBInstance " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Query . render ...
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Util . option_bind ( Xml . member " StopDBInstanceResponse " ( snd xml ) ) ( Xml . member " StopDBInstanceResult " ) in try Util . or_error ( Util . option_bind resp StopDBInstanceResult . parse ) ( let open Error in BadResponse { body ; message =...
let parse_error code err = let errors = [ ] @ Errors_internal . common in match Errors_internal . of_string err with | Some var -> if ( List . mem var errors ) && ( ( match Errors_internal . to_http_code var with | Some var -> var = code | None -> true ) ) then Some var else None | None -> None
let to_http service region req = let uri = Uri . add_query_params ( Uri . of_string ( Aws . Util . of_option_exn ( Endpoints . url_of service region ) ) ) ( List . append [ ( " Version " , [ " 2016 - 11 - 15 " ] ) ; ( " Action " , [ " StopInstances " ] ) ] ( Util . drop_empty ( Uri . query_of_encoded ( Query . render (...
let of_http body = try let xml = Ezxmlm . from_string body in let resp = Xml . member " StopInstancesResponse " ( snd xml ) in try Util . or_error ( Util . option_bind resp StopInstancesResult . parse ) ( let open Error in BadResponse { body ; message = " Could not find well formed StopInstancesResult . " } ) with | Xm...