text:
# Autogenerated wrapper script for AMCL_jll for armv7l-linux-gnueabihf
export libamcl_pairing_BLS383, libamcl_curve_GOLDILOCKS, libamcl_mpin_BLS24, libamcl_curve_NUMS256E, libamcl_bls_BN254, libamcl_curve_ED25519, libamcl_bls_BLS461, libamcl_curve_NUMS384E, libamcl_curve_NUMS512E, libamcl_mpin_BLS383, libamcl_wcc_BLS48, libamcl_mpin_BLS461, libamcl_curve_BLS48, libamcl_curve_SECP256K1, libamcl_pairing_BLS24, libamcl_curve_BN254CX, libamcl_curve_C41417, libamcl_mpin_BLS48, libamcl_mpin_BN254, libamcl_curve_NIST521, libamcl_curve_NUMS512W, libamcl_pairing_BN254, libamcl_curve_NUMS256W, libamcl_bls_BLS381, libamcl_mpin_FP256BN, libamcl_curve_BLS24, libamcl_x509, libamcl_curve_NIST384, libamcl_pairing_BLS48, libamcl_bls_BLS24, libamcl_bls_FP512BN, libamcl_rsa_3072, libamcl_bls_FP256BN, libamcl_wcc_BLS383, libamcl_wcc_BN254CX, libamcl_mpin_BN254CX, libamcl_rsa_4096, libamcl_pairing_BLS461, libamcl_mpin_FP512BN, libamcl_curve_NIST256, libamcl_pairing_FP256BN, libamcl_wcc_FP512BN, libamcl_bls_BLS383, libamcl_curve_BN254, libamcl_wcc_BLS461, libamcl_curve_C25519, libamcl_curve_HIFIVE, libamcl_mpin_BLS381, libamcl_curve_BLS383, libamcl_curve_BRAINPOOL, libamcl_pairing_BN254CX, libamcl_wcc_BN254, libamcl_curve_FP256BN, libamcl_curve_BLS381, libamcl_core, libamcl_curve_ANSSI, libamcl_curve_BLS461, libamcl_wcc_FP256BN, libamcl_bls_BLS48, libamcl_curve_NUMS384W, libamcl_wcc_BLS24, libamcl_curve_FP512BN, libamcl_wcc_BLS381, libamcl_pairing_FP512BN, libamcl_bls_BN254CX, libamcl_rsa_2048, libamcl_pairing_BLS381

## Global variables
PATH = ""
LIBPATH = ""
LIBPATH_env = "LD_LIBRARY_PATH"

# Relative path to `libamcl_pairing_BLS383`
const libamcl_pairing_BLS383_splitpath = ["lib", "libamcl_pairing_BLS383.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BLS383_path = ""

# libamcl_pairing_BLS383-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BLS383_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BLS383 = "libamcl_pairing_BLS383.so.2"

# Relative path to `libamcl_curve_GOLDILOCKS`
const libamcl_curve_GOLDILOCKS_splitpath = ["lib", "libamcl_curve_GOLDILOCKS.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_GOLDILOCKS_path = ""

# libamcl_curve_GOLDILOCKS-specific global declaration
# This will be filled out by __init__()
libamcl_curve_GOLDILOCKS_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_GOLDILOCKS = "libamcl_curve_GOLDILOCKS.so.2"

# Relative path to `libamcl_mpin_BLS24`
const libamcl_mpin_BLS24_splitpath = ["lib", "libamcl_mpin_BLS24.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BLS24_path = ""

# libamcl_mpin_BLS24-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BLS24_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BLS24 = "libamcl_mpin_BLS24.so.2"

# Relative path to `libamcl_curve_NUMS256E`
const libamcl_curve_NUMS256E_splitpath = ["lib", "libamcl_curve_NUMS256E.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS256E_path = ""

# libamcl_curve_NUMS256E-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS256E_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS256E = "libamcl_curve_NUMS256E.so.2"

# Relative path to `libamcl_bls_BN254`
const libamcl_bls_BN254_splitpath = ["lib", "libamcl_bls_BN254.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BN254_path = ""

# libamcl_bls_BN254-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BN254_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BN254 = "libamcl_bls_BN254.so.2"

# Relative path to `libamcl_curve_ED25519`
const libamcl_curve_ED25519_splitpath = ["lib", "libamcl_curve_ED25519.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_ED25519_path = ""

# libamcl_curve_ED25519-specific global declaration
# This will be filled out by __init__()
libamcl_curve_ED25519_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_ED25519 = "libamcl_curve_ED25519.so.2"

# Relative path to `libamcl_bls_BLS461`
const libamcl_bls_BLS461_splitpath = ["lib", "libamcl_bls_BLS461.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BLS461_path = ""

# libamcl_bls_BLS461-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BLS461_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BLS461 = "libamcl_bls_BLS461.so.2"

# Relative path to `libamcl_curve_NUMS384E`
const libamcl_curve_NUMS384E_splitpath = ["lib", "libamcl_curve_NUMS384E.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS384E_path = ""

# libamcl_curve_NUMS384E-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS384E_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS384E = "libamcl_curve_NUMS384E.so.2"

# Relative path to `libamcl_curve_NUMS512E`
const libamcl_curve_NUMS512E_splitpath = ["lib", "libamcl_curve_NUMS512E.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS512E_path = ""

# libamcl_curve_NUMS512E-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS512E_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS512E = "libamcl_curve_NUMS512E.so.2"

# Relative path to `libamcl_mpin_BLS383`
const libamcl_mpin_BLS383_splitpath = ["lib", "libamcl_mpin_BLS383.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BLS383_path = ""

# libamcl_mpin_BLS383-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BLS383_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BLS383 = "libamcl_mpin_BLS383.so.2"

# Relative path to `libamcl_wcc_BLS48`
const libamcl_wcc_BLS48_splitpath = ["lib", "libamcl_wcc_BLS48.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BLS48_path = ""

# libamcl_wcc_BLS48-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BLS48_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BLS48 = "libamcl_wcc_BLS48.so.2"

# Relative path to `libamcl_mpin_BLS461`
const libamcl_mpin_BLS461_splitpath = ["lib", "libamcl_mpin_BLS461.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BLS461_path = ""

# libamcl_mpin_BLS461-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BLS461_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BLS461 = "libamcl_mpin_BLS461.so.2"

# Relative path to `libamcl_curve_BLS48`
const libamcl_curve_BLS48_splitpath = ["lib", "libamcl_curve_BLS48.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BLS48_path = ""

# libamcl_curve_BLS48-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BLS48_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BLS48 = "libamcl_curve_BLS48.so.2"

# Relative path to `libamcl_curve_SECP256K1`
const libamcl_curve_SECP256K1_splitpath = ["lib", "libamcl_curve_SECP256K1.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_SECP256K1_path = ""

# libamcl_curve_SECP256K1-specific global declaration
# This will be filled out by __init__()
libamcl_curve_SECP256K1_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_SECP256K1 = "libamcl_curve_SECP256K1.so.2"

# Relative path to `libamcl_pairing_BLS24`
const libamcl_pairing_BLS24_splitpath = ["lib", "libamcl_pairing_BLS24.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BLS24_path = ""

# libamcl_pairing_BLS24-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BLS24_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BLS24 = "libamcl_pairing_BLS24.so.2"

# Relative path to `libamcl_curve_BN254CX`
const libamcl_curve_BN254CX_splitpath = ["lib", "libamcl_curve_BN254CX.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BN254CX_path = ""

# libamcl_curve_BN254CX-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BN254CX_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BN254CX = "libamcl_curve_BN254CX.so.2"

# Relative path to `libamcl_curve_C41417`
const libamcl_curve_C41417_splitpath = ["lib", "libamcl_curve_C41417.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_C41417_path = ""

# libamcl_curve_C41417-specific global declaration
# This will be filled out by __init__()
libamcl_curve_C41417_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_C41417 = "libamcl_curve_C41417.so.2"

# Relative path to `libamcl_mpin_BLS48`
const libamcl_mpin_BLS48_splitpath = ["lib", "libamcl_mpin_BLS48.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BLS48_path = ""

# libamcl_mpin_BLS48-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BLS48_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BLS48 = "libamcl_mpin_BLS48.so.2"

# Relative path to `libamcl_mpin_BN254`
const libamcl_mpin_BN254_splitpath = ["lib", "libamcl_mpin_BN254.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BN254_path = ""

# libamcl_mpin_BN254-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BN254_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BN254 = "libamcl_mpin_BN254.so.2"

# Relative path to `libamcl_curve_NIST521`
const libamcl_curve_NIST521_splitpath = ["lib", "libamcl_curve_NIST521.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NIST521_path = ""

# libamcl_curve_NIST521-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NIST521_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NIST521 = "libamcl_curve_NIST521.so.2"

# Relative path to `libamcl_curve_NUMS512W`
const libamcl_curve_NUMS512W_splitpath = ["lib", "libamcl_curve_NUMS512W.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS512W_path = ""

# libamcl_curve_NUMS512W-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS512W_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS512W = "libamcl_curve_NUMS512W.so.2"

# Relative path to `libamcl_pairing_BN254`
const libamcl_pairing_BN254_splitpath = ["lib", "libamcl_pairing_BN254.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BN254_path = ""

# libamcl_pairing_BN254-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BN254_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BN254 = "libamcl_pairing_BN254.so.2"

# Relative path to `libamcl_curve_NUMS256W`
const libamcl_curve_NUMS256W_splitpath = ["lib", "libamcl_curve_NUMS256W.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS256W_path = ""

# libamcl_curve_NUMS256W-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS256W_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS256W = "libamcl_curve_NUMS256W.so.2"

# Relative path to `libamcl_bls_BLS381`
const libamcl_bls_BLS381_splitpath = ["lib", "libamcl_bls_BLS381.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BLS381_path = ""

# libamcl_bls_BLS381-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BLS381_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BLS381 = "libamcl_bls_BLS381.so.2"

# Relative path to `libamcl_mpin_FP256BN`
const libamcl_mpin_FP256BN_splitpath = ["lib", "libamcl_mpin_FP256BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_FP256BN_path = ""

# libamcl_mpin_FP256BN-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_FP256BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_FP256BN = "libamcl_mpin_FP256BN.so.2"

# Relative path to `libamcl_curve_BLS24`
const libamcl_curve_BLS24_splitpath = ["lib", "libamcl_curve_BLS24.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BLS24_path = ""

# libamcl_curve_BLS24-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BLS24_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BLS24 = "libamcl_curve_BLS24.so.2"

# Relative path to `libamcl_x509`
const libamcl_x509_splitpath = ["lib", "libamcl_x509.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_x509_path = ""

# libamcl_x509-specific global declaration
# This will be filled out by __init__()
libamcl_x509_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_x509 = "libamcl_x509.so.2"

# Relative path to `libamcl_curve_NIST384`
const libamcl_curve_NIST384_splitpath = ["lib", "libamcl_curve_NIST384.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NIST384_path = ""

# libamcl_curve_NIST384-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NIST384_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NIST384 = "libamcl_curve_NIST384.so.2"

# Relative path to `libamcl_pairing_BLS48`
const libamcl_pairing_BLS48_splitpath = ["lib", "libamcl_pairing_BLS48.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BLS48_path = ""

# libamcl_pairing_BLS48-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BLS48_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BLS48 = "libamcl_pairing_BLS48.so.2"

# Relative path to `libamcl_bls_BLS24`
const libamcl_bls_BLS24_splitpath = ["lib", "libamcl_bls_BLS24.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BLS24_path = ""

# libamcl_bls_BLS24-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BLS24_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BLS24 = "libamcl_bls_BLS24.so.2"

# Relative path to `libamcl_bls_FP512BN`
const libamcl_bls_FP512BN_splitpath = ["lib", "libamcl_bls_FP512BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_FP512BN_path = ""

# libamcl_bls_FP512BN-specific global declaration
# This will be filled out by __init__()
libamcl_bls_FP512BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_FP512BN = "libamcl_bls_FP512BN.so.2"

# Relative path to `libamcl_rsa_3072`
const libamcl_rsa_3072_splitpath = ["lib", "libamcl_rsa_3072.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_rsa_3072_path = ""

# libamcl_rsa_3072-specific global declaration
# This will be filled out by __init__()
libamcl_rsa_3072_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_rsa_3072 = "libamcl_rsa_3072.so.2"

# Relative path to `libamcl_bls_FP256BN`
const libamcl_bls_FP256BN_splitpath = ["lib", "libamcl_bls_FP256BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_FP256BN_path = ""

# libamcl_bls_FP256BN-specific global declaration
# This will be filled out by __init__()
libamcl_bls_FP256BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_FP256BN = "libamcl_bls_FP256BN.so.2"

# Relative path to `libamcl_wcc_BLS383`
const libamcl_wcc_BLS383_splitpath = ["lib", "libamcl_wcc_BLS383.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BLS383_path = ""

# libamcl_wcc_BLS383-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BLS383_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BLS383 = "libamcl_wcc_BLS383.so.2"

# Relative path to `libamcl_wcc_BN254CX`
const libamcl_wcc_BN254CX_splitpath = ["lib", "libamcl_wcc_BN254CX.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BN254CX_path = ""

# libamcl_wcc_BN254CX-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BN254CX_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BN254CX = "libamcl_wcc_BN254CX.so.2"

# Relative path to `libamcl_mpin_BN254CX`
const libamcl_mpin_BN254CX_splitpath = ["lib", "libamcl_mpin_BN254CX.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BN254CX_path = ""

# libamcl_mpin_BN254CX-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BN254CX_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BN254CX = "libamcl_mpin_BN254CX.so.2"

# Relative path to `libamcl_rsa_4096`
const libamcl_rsa_4096_splitpath = ["lib", "libamcl_rsa_4096.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_rsa_4096_path = ""

# libamcl_rsa_4096-specific global declaration
# This will be filled out by __init__()
libamcl_rsa_4096_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_rsa_4096 = "libamcl_rsa_4096.so.2"

# Relative path to `libamcl_pairing_BLS461`
const libamcl_pairing_BLS461_splitpath = ["lib", "libamcl_pairing_BLS461.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BLS461_path = ""

# libamcl_pairing_BLS461-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BLS461_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BLS461 = "libamcl_pairing_BLS461.so.2"

# Relative path to `libamcl_mpin_FP512BN`
const libamcl_mpin_FP512BN_splitpath = ["lib", "libamcl_mpin_FP512BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_FP512BN_path = ""

# libamcl_mpin_FP512BN-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_FP512BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_FP512BN = "libamcl_mpin_FP512BN.so.2"

# Relative path to `libamcl_curve_NIST256`
const libamcl_curve_NIST256_splitpath = ["lib", "libamcl_curve_NIST256.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NIST256_path = ""

# libamcl_curve_NIST256-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NIST256_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NIST256 = "libamcl_curve_NIST256.so.2"

# Relative path to `libamcl_pairing_FP256BN`
const libamcl_pairing_FP256BN_splitpath = ["lib", "libamcl_pairing_FP256BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_FP256BN_path = ""

# libamcl_pairing_FP256BN-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_FP256BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_FP256BN = "libamcl_pairing_FP256BN.so.2"

# Relative path to `libamcl_wcc_FP512BN`
const libamcl_wcc_FP512BN_splitpath = ["lib", "libamcl_wcc_FP512BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_FP512BN_path = ""

# libamcl_wcc_FP512BN-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_FP512BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_FP512BN = "libamcl_wcc_FP512BN.so.2"

# Relative path to `libamcl_bls_BLS383`
const libamcl_bls_BLS383_splitpath = ["lib", "libamcl_bls_BLS383.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BLS383_path = ""

# libamcl_bls_BLS383-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BLS383_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BLS383 = "libamcl_bls_BLS383.so.2"

# Relative path to `libamcl_curve_BN254`
const libamcl_curve_BN254_splitpath = ["lib", "libamcl_curve_BN254.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BN254_path = ""

# libamcl_curve_BN254-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BN254_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BN254 = "libamcl_curve_BN254.so.2"

# Relative path to `libamcl_wcc_BLS461`
const libamcl_wcc_BLS461_splitpath = ["lib", "libamcl_wcc_BLS461.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BLS461_path = ""

# libamcl_wcc_BLS461-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BLS461_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BLS461 = "libamcl_wcc_BLS461.so.2"

# Relative path to `libamcl_curve_C25519`
const libamcl_curve_C25519_splitpath = ["lib", "libamcl_curve_C25519.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_C25519_path = ""

# libamcl_curve_C25519-specific global declaration
# This will be filled out by __init__()
libamcl_curve_C25519_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_C25519 = "libamcl_curve_C25519.so.2"

# Relative path to `libamcl_curve_HIFIVE`
const libamcl_curve_HIFIVE_splitpath = ["lib", "libamcl_curve_HIFIVE.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_HIFIVE_path = ""

# libamcl_curve_HIFIVE-specific global declaration
# This will be filled out by __init__()
libamcl_curve_HIFIVE_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_HIFIVE = "libamcl_curve_HIFIVE.so.2"

# Relative path to `libamcl_mpin_BLS381`
const libamcl_mpin_BLS381_splitpath = ["lib", "libamcl_mpin_BLS381.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_mpin_BLS381_path = ""

# libamcl_mpin_BLS381-specific global declaration
# This will be filled out by __init__()
libamcl_mpin_BLS381_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_mpin_BLS381 = "libamcl_mpin_BLS381.so.2"

# Relative path to `libamcl_curve_BLS383`
const libamcl_curve_BLS383_splitpath = ["lib", "libamcl_curve_BLS383.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BLS383_path = ""

# libamcl_curve_BLS383-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BLS383_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BLS383 = "libamcl_curve_BLS383.so.2"

# Relative path to `libamcl_curve_BRAINPOOL`
const libamcl_curve_BRAINPOOL_splitpath = ["lib", "libamcl_curve_BRAINPOOL.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BRAINPOOL_path = ""

# libamcl_curve_BRAINPOOL-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BRAINPOOL_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BRAINPOOL = "libamcl_curve_BRAINPOOL.so.2"

# Relative path to `libamcl_pairing_BN254CX`
const libamcl_pairing_BN254CX_splitpath = ["lib", "libamcl_pairing_BN254CX.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BN254CX_path = ""

# libamcl_pairing_BN254CX-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BN254CX_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BN254CX = "libamcl_pairing_BN254CX.so.2"

# Relative path to `libamcl_wcc_BN254`
const libamcl_wcc_BN254_splitpath = ["lib", "libamcl_wcc_BN254.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BN254_path = ""

# libamcl_wcc_BN254-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BN254_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BN254 = "libamcl_wcc_BN254.so.2"

# Relative path to `libamcl_curve_FP256BN`
const libamcl_curve_FP256BN_splitpath = ["lib", "libamcl_curve_FP256BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_FP256BN_path = ""

# libamcl_curve_FP256BN-specific global declaration
# This will be filled out by __init__()
libamcl_curve_FP256BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_FP256BN = "libamcl_curve_FP256BN.so.2"

# Relative path to `libamcl_curve_BLS381`
const libamcl_curve_BLS381_splitpath = ["lib", "libamcl_curve_BLS381.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BLS381_path = ""

# libamcl_curve_BLS381-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BLS381_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BLS381 = "libamcl_curve_BLS381.so.2"

# Relative path to `libamcl_core`
const libamcl_core_splitpath = ["lib", "libamcl_core.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_core_path = ""

# libamcl_core-specific global declaration
# This will be filled out by __init__()
libamcl_core_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_core = "libamcl_core.so.2"

# Relative path to `libamcl_curve_ANSSI`
const libamcl_curve_ANSSI_splitpath = ["lib", "libamcl_curve_ANSSI.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_ANSSI_path = ""

# libamcl_curve_ANSSI-specific global declaration
# This will be filled out by __init__()
libamcl_curve_ANSSI_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_ANSSI = "libamcl_curve_ANSSI.so.2"

# Relative path to `libamcl_curve_BLS461`
const libamcl_curve_BLS461_splitpath = ["lib", "libamcl_curve_BLS461.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_BLS461_path = ""

# libamcl_curve_BLS461-specific global declaration
# This will be filled out by __init__()
libamcl_curve_BLS461_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_BLS461 = "libamcl_curve_BLS461.so.2"

# Relative path to `libamcl_wcc_FP256BN`
const libamcl_wcc_FP256BN_splitpath = ["lib", "libamcl_wcc_FP256BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_FP256BN_path = ""

# libamcl_wcc_FP256BN-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_FP256BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_FP256BN = "libamcl_wcc_FP256BN.so.2"

# Relative path to `libamcl_bls_BLS48`
const libamcl_bls_BLS48_splitpath = ["lib", "libamcl_bls_BLS48.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BLS48_path = ""

# libamcl_bls_BLS48-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BLS48_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BLS48 = "libamcl_bls_BLS48.so.2"

# Relative path to `libamcl_curve_NUMS384W`
const libamcl_curve_NUMS384W_splitpath = ["lib", "libamcl_curve_NUMS384W.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_NUMS384W_path = ""

# libamcl_curve_NUMS384W-specific global declaration
# This will be filled out by __init__()
libamcl_curve_NUMS384W_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_NUMS384W = "libamcl_curve_NUMS384W.so.2"

# Relative path to `libamcl_wcc_BLS24`
const libamcl_wcc_BLS24_splitpath = ["lib", "libamcl_wcc_BLS24.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BLS24_path = ""

# libamcl_wcc_BLS24-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BLS24_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BLS24 = "libamcl_wcc_BLS24.so.2"

# Relative path to `libamcl_curve_FP512BN`
const libamcl_curve_FP512BN_splitpath = ["lib", "libamcl_curve_FP512BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_curve_FP512BN_path = ""

# libamcl_curve_FP512BN-specific global declaration
# This will be filled out by __init__()
libamcl_curve_FP512BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_curve_FP512BN = "libamcl_curve_FP512BN.so.2"

# Relative path to `libamcl_wcc_BLS381`
const libamcl_wcc_BLS381_splitpath = ["lib", "libamcl_wcc_BLS381.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_wcc_BLS381_path = ""

# libamcl_wcc_BLS381-specific global declaration
# This will be filled out by __init__()
libamcl_wcc_BLS381_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_wcc_BLS381 = "libamcl_wcc_BLS381.so.2"

# Relative path to `libamcl_pairing_FP512BN`
const libamcl_pairing_FP512BN_splitpath = ["lib", "libamcl_pairing_FP512BN.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_FP512BN_path = ""

# libamcl_pairing_FP512BN-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_FP512BN_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_FP512BN = "libamcl_pairing_FP512BN.so.2"

# Relative path to `libamcl_bls_BN254CX`
const libamcl_bls_BN254CX_splitpath = ["lib", "libamcl_bls_BN254CX.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_bls_BN254CX_path = ""

# libamcl_bls_BN254CX-specific global declaration
# This will be filled out by __init__()
libamcl_bls_BN254CX_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_bls_BN254CX = "libamcl_bls_BN254CX.so.2"

# Relative path to `libamcl_rsa_2048`
const libamcl_rsa_2048_splitpath = ["lib", "libamcl_rsa_2048.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_rsa_2048_path = ""

# libamcl_rsa_2048-specific global declaration
# This will be filled out by __init__()
libamcl_rsa_2048_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_rsa_2048 = "libamcl_rsa_2048.so.2"

# Relative path to `libamcl_pairing_BLS381`
const libamcl_pairing_BLS381_splitpath = ["lib", "libamcl_pairing_BLS381.so"]

# This will be filled out by __init__() for all products, as it must be done at runtime
libamcl_pairing_BLS381_path = ""

# libamcl_pairing_BLS381-specific global declaration
# This will be filled out by __init__()
libamcl_pairing_BLS381_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const libamcl_pairing_BLS381 = "libamcl_pairing_BLS381.so.2"

"""
Open all libraries
"""
function __init__()
    global artifact_dir = abspath(artifact"AMCL")

    # Initialize PATH and LIBPATH environment variable listings
    global PATH_list, LIBPATH_list
    # We first need to add to LIBPATH_list the libraries provided by Julia
    append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)])
    global libamcl_pairing_BLS383_path = normpath(joinpath(artifact_dir, libamcl_pairing_BLS383_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BLS383_handle = dlopen(libamcl_pairing_BLS383_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BLS383_path))

    global libamcl_curve_GOLDILOCKS_path = normpath(joinpath(artifact_dir, libamcl_curve_GOLDILOCKS_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_GOLDILOCKS_handle = dlopen(libamcl_curve_GOLDILOCKS_path)
    push!(LIBPATH_list, dirname(libamcl_curve_GOLDILOCKS_path))

    global libamcl_mpin_BLS24_path = normpath(joinpath(artifact_dir, libamcl_mpin_BLS24_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BLS24_handle = dlopen(libamcl_mpin_BLS24_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BLS24_path))

    global libamcl_curve_NUMS256E_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS256E_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS256E_handle = dlopen(libamcl_curve_NUMS256E_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS256E_path))

    global libamcl_bls_BN254_path = normpath(joinpath(artifact_dir, libamcl_bls_BN254_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BN254_handle = dlopen(libamcl_bls_BN254_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BN254_path))

    global libamcl_curve_ED25519_path = normpath(joinpath(artifact_dir, libamcl_curve_ED25519_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_ED25519_handle = dlopen(libamcl_curve_ED25519_path)
    push!(LIBPATH_list, dirname(libamcl_curve_ED25519_path))

    global libamcl_bls_BLS461_path = normpath(joinpath(artifact_dir, libamcl_bls_BLS461_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BLS461_handle = dlopen(libamcl_bls_BLS461_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BLS461_path))

    global libamcl_curve_NUMS384E_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS384E_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS384E_handle = dlopen(libamcl_curve_NUMS384E_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS384E_path))

    global libamcl_curve_NUMS512E_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS512E_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS512E_handle = dlopen(libamcl_curve_NUMS512E_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS512E_path))

    global libamcl_mpin_BLS383_path = normpath(joinpath(artifact_dir, libamcl_mpin_BLS383_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BLS383_handle = dlopen(libamcl_mpin_BLS383_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BLS383_path))

    global libamcl_wcc_BLS48_path = normpath(joinpath(artifact_dir, libamcl_wcc_BLS48_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BLS48_handle = dlopen(libamcl_wcc_BLS48_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BLS48_path))

    global libamcl_mpin_BLS461_path = normpath(joinpath(artifact_dir, libamcl_mpin_BLS461_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BLS461_handle = dlopen(libamcl_mpin_BLS461_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BLS461_path))

    global libamcl_curve_BLS48_path = normpath(joinpath(artifact_dir, libamcl_curve_BLS48_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BLS48_handle = dlopen(libamcl_curve_BLS48_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BLS48_path))

    global libamcl_curve_SECP256K1_path = normpath(joinpath(artifact_dir, libamcl_curve_SECP256K1_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_SECP256K1_handle = dlopen(libamcl_curve_SECP256K1_path)
    push!(LIBPATH_list, dirname(libamcl_curve_SECP256K1_path))

    global libamcl_pairing_BLS24_path = normpath(joinpath(artifact_dir, libamcl_pairing_BLS24_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BLS24_handle = dlopen(libamcl_pairing_BLS24_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BLS24_path))

    global libamcl_curve_BN254CX_path = normpath(joinpath(artifact_dir, libamcl_curve_BN254CX_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BN254CX_handle = dlopen(libamcl_curve_BN254CX_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BN254CX_path))

    global libamcl_curve_C41417_path = normpath(joinpath(artifact_dir, libamcl_curve_C41417_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_C41417_handle = dlopen(libamcl_curve_C41417_path)
    push!(LIBPATH_list, dirname(libamcl_curve_C41417_path))

    global libamcl_mpin_BLS48_path = normpath(joinpath(artifact_dir, libamcl_mpin_BLS48_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BLS48_handle = dlopen(libamcl_mpin_BLS48_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BLS48_path))

    global libamcl_mpin_BN254_path = normpath(joinpath(artifact_dir, libamcl_mpin_BN254_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BN254_handle = dlopen(libamcl_mpin_BN254_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BN254_path))

    global libamcl_curve_NIST521_path = normpath(joinpath(artifact_dir, libamcl_curve_NIST521_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NIST521_handle = dlopen(libamcl_curve_NIST521_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NIST521_path))

    global libamcl_curve_NUMS512W_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS512W_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS512W_handle = dlopen(libamcl_curve_NUMS512W_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS512W_path))

    global libamcl_pairing_BN254_path = normpath(joinpath(artifact_dir, libamcl_pairing_BN254_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BN254_handle = dlopen(libamcl_pairing_BN254_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BN254_path))

    global libamcl_curve_NUMS256W_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS256W_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS256W_handle = dlopen(libamcl_curve_NUMS256W_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS256W_path))

    global libamcl_bls_BLS381_path = normpath(joinpath(artifact_dir, libamcl_bls_BLS381_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BLS381_handle = dlopen(libamcl_bls_BLS381_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BLS381_path))

    global libamcl_mpin_FP256BN_path = normpath(joinpath(artifact_dir, libamcl_mpin_FP256BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_FP256BN_handle = dlopen(libamcl_mpin_FP256BN_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_FP256BN_path))

    global libamcl_curve_BLS24_path = normpath(joinpath(artifact_dir, libamcl_curve_BLS24_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BLS24_handle = dlopen(libamcl_curve_BLS24_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BLS24_path))

    global libamcl_x509_path = normpath(joinpath(artifact_dir, libamcl_x509_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_x509_handle = dlopen(libamcl_x509_path)
    push!(LIBPATH_list, dirname(libamcl_x509_path))

    global libamcl_curve_NIST384_path = normpath(joinpath(artifact_dir, libamcl_curve_NIST384_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NIST384_handle = dlopen(libamcl_curve_NIST384_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NIST384_path))

    global libamcl_pairing_BLS48_path = normpath(joinpath(artifact_dir, libamcl_pairing_BLS48_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BLS48_handle = dlopen(libamcl_pairing_BLS48_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BLS48_path))

    global libamcl_bls_BLS24_path = normpath(joinpath(artifact_dir, libamcl_bls_BLS24_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BLS24_handle = dlopen(libamcl_bls_BLS24_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BLS24_path))

    global libamcl_bls_FP512BN_path = normpath(joinpath(artifact_dir, libamcl_bls_FP512BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_FP512BN_handle = dlopen(libamcl_bls_FP512BN_path)
    push!(LIBPATH_list, dirname(libamcl_bls_FP512BN_path))

    global libamcl_rsa_3072_path = normpath(joinpath(artifact_dir, libamcl_rsa_3072_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_rsa_3072_handle = dlopen(libamcl_rsa_3072_path)
    push!(LIBPATH_list, dirname(libamcl_rsa_3072_path))

    global libamcl_bls_FP256BN_path = normpath(joinpath(artifact_dir, libamcl_bls_FP256BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_FP256BN_handle = dlopen(libamcl_bls_FP256BN_path)
    push!(LIBPATH_list, dirname(libamcl_bls_FP256BN_path))

    global libamcl_wcc_BLS383_path = normpath(joinpath(artifact_dir, libamcl_wcc_BLS383_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BLS383_handle = dlopen(libamcl_wcc_BLS383_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BLS383_path))

    global libamcl_wcc_BN254CX_path = normpath(joinpath(artifact_dir, libamcl_wcc_BN254CX_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BN254CX_handle = dlopen(libamcl_wcc_BN254CX_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BN254CX_path))

    global libamcl_mpin_BN254CX_path = normpath(joinpath(artifact_dir, libamcl_mpin_BN254CX_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BN254CX_handle = dlopen(libamcl_mpin_BN254CX_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BN254CX_path))

    global libamcl_rsa_4096_path = normpath(joinpath(artifact_dir, libamcl_rsa_4096_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_rsa_4096_handle = dlopen(libamcl_rsa_4096_path)
    push!(LIBPATH_list, dirname(libamcl_rsa_4096_path))

    global libamcl_pairing_BLS461_path = normpath(joinpath(artifact_dir, libamcl_pairing_BLS461_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BLS461_handle = dlopen(libamcl_pairing_BLS461_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BLS461_path))

    global libamcl_mpin_FP512BN_path = normpath(joinpath(artifact_dir, libamcl_mpin_FP512BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_FP512BN_handle = dlopen(libamcl_mpin_FP512BN_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_FP512BN_path))

    global libamcl_curve_NIST256_path = normpath(joinpath(artifact_dir, libamcl_curve_NIST256_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NIST256_handle = dlopen(libamcl_curve_NIST256_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NIST256_path))

    global libamcl_pairing_FP256BN_path = normpath(joinpath(artifact_dir, libamcl_pairing_FP256BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_FP256BN_handle = dlopen(libamcl_pairing_FP256BN_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_FP256BN_path))

    global libamcl_wcc_FP512BN_path = normpath(joinpath(artifact_dir, libamcl_wcc_FP512BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_FP512BN_handle = dlopen(libamcl_wcc_FP512BN_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_FP512BN_path))

    global libamcl_bls_BLS383_path = normpath(joinpath(artifact_dir, libamcl_bls_BLS383_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BLS383_handle = dlopen(libamcl_bls_BLS383_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BLS383_path))

    global libamcl_curve_BN254_path = normpath(joinpath(artifact_dir, libamcl_curve_BN254_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BN254_handle = dlopen(libamcl_curve_BN254_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BN254_path))

    global libamcl_wcc_BLS461_path = normpath(joinpath(artifact_dir, libamcl_wcc_BLS461_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BLS461_handle = dlopen(libamcl_wcc_BLS461_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BLS461_path))

    global libamcl_curve_C25519_path = normpath(joinpath(artifact_dir, libamcl_curve_C25519_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_C25519_handle = dlopen(libamcl_curve_C25519_path)
    push!(LIBPATH_list, dirname(libamcl_curve_C25519_path))

    global libamcl_curve_HIFIVE_path = normpath(joinpath(artifact_dir, libamcl_curve_HIFIVE_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_HIFIVE_handle = dlopen(libamcl_curve_HIFIVE_path)
    push!(LIBPATH_list, dirname(libamcl_curve_HIFIVE_path))

    global libamcl_mpin_BLS381_path = normpath(joinpath(artifact_dir, libamcl_mpin_BLS381_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_mpin_BLS381_handle = dlopen(libamcl_mpin_BLS381_path)
    push!(LIBPATH_list, dirname(libamcl_mpin_BLS381_path))

    global libamcl_curve_BLS383_path = normpath(joinpath(artifact_dir, libamcl_curve_BLS383_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BLS383_handle = dlopen(libamcl_curve_BLS383_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BLS383_path))

    global libamcl_curve_BRAINPOOL_path = normpath(joinpath(artifact_dir, libamcl_curve_BRAINPOOL_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BRAINPOOL_handle = dlopen(libamcl_curve_BRAINPOOL_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BRAINPOOL_path))

    global libamcl_pairing_BN254CX_path = normpath(joinpath(artifact_dir, libamcl_pairing_BN254CX_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BN254CX_handle = dlopen(libamcl_pairing_BN254CX_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BN254CX_path))

    global libamcl_wcc_BN254_path = normpath(joinpath(artifact_dir, libamcl_wcc_BN254_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BN254_handle = dlopen(libamcl_wcc_BN254_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BN254_path))

    global libamcl_curve_FP256BN_path = normpath(joinpath(artifact_dir, libamcl_curve_FP256BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_FP256BN_handle = dlopen(libamcl_curve_FP256BN_path)
    push!(LIBPATH_list, dirname(libamcl_curve_FP256BN_path))

    global libamcl_curve_BLS381_path = normpath(joinpath(artifact_dir, libamcl_curve_BLS381_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BLS381_handle = dlopen(libamcl_curve_BLS381_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BLS381_path))

    global libamcl_core_path = normpath(joinpath(artifact_dir, libamcl_core_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_core_handle = dlopen(libamcl_core_path)
    push!(LIBPATH_list, dirname(libamcl_core_path))

    global libamcl_curve_ANSSI_path = normpath(joinpath(artifact_dir, libamcl_curve_ANSSI_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_ANSSI_handle = dlopen(libamcl_curve_ANSSI_path)
    push!(LIBPATH_list, dirname(libamcl_curve_ANSSI_path))

    global libamcl_curve_BLS461_path = normpath(joinpath(artifact_dir, libamcl_curve_BLS461_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_BLS461_handle = dlopen(libamcl_curve_BLS461_path)
    push!(LIBPATH_list, dirname(libamcl_curve_BLS461_path))

    global libamcl_wcc_FP256BN_path = normpath(joinpath(artifact_dir, libamcl_wcc_FP256BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_FP256BN_handle = dlopen(libamcl_wcc_FP256BN_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_FP256BN_path))

    global libamcl_bls_BLS48_path = normpath(joinpath(artifact_dir, libamcl_bls_BLS48_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BLS48_handle = dlopen(libamcl_bls_BLS48_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BLS48_path))

    global libamcl_curve_NUMS384W_path = normpath(joinpath(artifact_dir, libamcl_curve_NUMS384W_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_NUMS384W_handle = dlopen(libamcl_curve_NUMS384W_path)
    push!(LIBPATH_list, dirname(libamcl_curve_NUMS384W_path))

    global libamcl_wcc_BLS24_path = normpath(joinpath(artifact_dir, libamcl_wcc_BLS24_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BLS24_handle = dlopen(libamcl_wcc_BLS24_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BLS24_path))

    global libamcl_curve_FP512BN_path = normpath(joinpath(artifact_dir, libamcl_curve_FP512BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_curve_FP512BN_handle = dlopen(libamcl_curve_FP512BN_path)
    push!(LIBPATH_list, dirname(libamcl_curve_FP512BN_path))

    global libamcl_wcc_BLS381_path = normpath(joinpath(artifact_dir, libamcl_wcc_BLS381_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_wcc_BLS381_handle = dlopen(libamcl_wcc_BLS381_path)
    push!(LIBPATH_list, dirname(libamcl_wcc_BLS381_path))

    global libamcl_pairing_FP512BN_path = normpath(joinpath(artifact_dir, libamcl_pairing_FP512BN_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_FP512BN_handle = dlopen(libamcl_pairing_FP512BN_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_FP512BN_path))

    global libamcl_bls_BN254CX_path = normpath(joinpath(artifact_dir, libamcl_bls_BN254CX_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_bls_BN254CX_handle = dlopen(libamcl_bls_BN254CX_path)
    push!(LIBPATH_list, dirname(libamcl_bls_BN254CX_path))

    global libamcl_rsa_2048_path = normpath(joinpath(artifact_dir, libamcl_rsa_2048_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_rsa_2048_handle = dlopen(libamcl_rsa_2048_path)
    push!(LIBPATH_list, dirname(libamcl_rsa_2048_path))

    global libamcl_pairing_BLS381_path = normpath(joinpath(artifact_dir, libamcl_pairing_BLS381_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global libamcl_pairing_BLS381_handle = dlopen(libamcl_pairing_BLS381_path)
    push!(LIBPATH_list, dirname(libamcl_pairing_BLS381_path))

    # Filter out duplicate and empty entries in our PATH and LIBPATH entries
    filter!(!isempty, unique!(PATH_list))
    filter!(!isempty, unique!(LIBPATH_list))
    global PATH = join(PATH_list, ':')
    global LIBPATH = join(LIBPATH_list, ':')

    # Add each element of LIBPATH to our DL_LOAD_PATH (necessary on platforms
    # that don't honor our "already opened" trick)
    #for lp in LIBPATH_list
    #    push!(DL_LOAD_PATH, lp)
    #end
end  # __init__()


text:
info("Testing syllable finding...")

const sizea = 5
@test is_adjacent(sizea, 2, 2)
@test is_adjacent(sizea, 1, 2)
@test is_adjacent(sizea, 3, 2)
@test is_adjacent(sizea, 2, 6)
@test is_adjacent(sizea, 2, 7)
@test is_adjacent(sizea, 8, 2)
@test !is_adjacent(sizea, 2, 9)

a = [[1, 2, 3, 3, 2, 1] [1, 2, 4, 2, 2, 1] [1, 1, 1, 1, 1, 1] [1, 2, 3, 3, 2, 1] [1, 2, 3, 2, 2, 1] [1, 1, 1, 1, 1, 1] [1, 2, 3, 5, 1, 1] [1, 2, 2, 1, 1, 1] [1, 1, 1, 1, 1, 1] [1, 1, 3, 1, 1, 1] [1, 2, 3, 1, 2, 3] [3, 3, 3, 3, 3, 3] [1, 1, 1, 1, 1, 1] [1, 2, 4, 2, 3, 1] [1, 1, 1, 1, 1, 1]]
syllables = find_uncombined_syllables(a, 1.5, 3.5)
syllables_combined = combine_syllables(syllables, 4, 1)
syllables_boxed = syllable_boxes(syllables)

@test syllables == [Syllable([2, 3, 4, 5, 2, 3, 4, 5], [1, 1, 1, 1, 2, 2, 2, 2]), Syllable([2, 3, 4, 2, 3], [7, 7, 7, 8, 8]), Syllable([2, 3, 4, 5], [14, 14, 14, 14])]
@test syllables == combine_syllables(syllables, 3, 1)
@test syllables_combined == [Syllable([2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 2, 3], [1, 1, 1, 1, 2, 2, 2, 2, 7, 7, 7, 8, 8]), Syllable([2, 3, 4, 5], [14, 14, 14, 14])]
@test syllables_boxed == [SyllableBox(2, 1, 5, 2), SyllableBox(2, 7, 4, 8), SyllableBox(2, 14, 5, 14)]

ext: jl


text:
function calculation()
    result = 0
    n = 1000_000
    for i in 1:n
        result += sin(rand())
    end
    return result
end

show(calculation())

# julia> @time include("1_5_func.jl")
# 460301.1496469646  0.063448 seconds (2.00 M allocations: 30.646 MB, 2.94% gc time)

max_stars_repo_path: Section 1/1_5_func.jl

max_stars_repo_name: lytemar/Julia-for-Data-Science-Video

max_issues_repo_path: Section 1/1_5_func.jl

max_issues_repo_name: lytemar/Julia-for-Data-Science-Video

max_forks_repo_path: Section 1/1_5_func.jl

max_forks_repo_name: lytemar/Julia-for-Data-Science-Video


text:
# Recreates the analysis from the original data files

datapath = "dataset"
projectname = "MEG3"
experimentdirnames = ["p53-Mdm2", "p53-MEG3"]

samplenames = ["A", "B", "C", "D"]

nreplicates = 3
nsamples = 4
ncells = 10

mc_iterations = 10000

outputdir = "output"
mkpath(outputdir)
outputdatapath = joinpath(outputdir, "results.jld2")

using Distributed
currentworkers = addprocs(exeflags = "--project")
@everywhere using SMLMAssociationAnalysis_NCB
using Printf
using LocalizationMicroscopy
using Statistics
using FileIO

experimentresults = Vector{Vector{Vector{Result}}}[]
for experimentdirname ∈ experimentdirnames
    println("Starting experiment $experimentdirname.")
    experimentpath = joinpath(datapath, experimentdirname)
    replicateresults = Vector{Vector{Result}}[]
    for i ∈ 1:nreplicates
        sampleresults = Vector{Result}[]
        println("    Starting replicate $i.")
        replicatepath = joinpath(experimentpath, "Replicate $i")
        for samplename ∈ samplenames
            results = Result[]
            println("        Starting sample $samplename.")
            for j ∈ 1:ncells
                println("            Starting cell $j.")
                cellpath = joinpath(replicatepath, "$samplename $(Printf.@sprintf("%03i", j)).bin.txt")
                localizations = loadlocalizations(cellpath, LocalizationMicroscopy.nikonelementstext)
                # account for variances in data collection
                if experimentdirname == experimentdirnames[2] && samplename ∈ samplenames[3:4]
                    ch1_name = "561"
                else
                    ch1_name = "647"
                end
                ch2_name = "488"
                if experimentdirname == experimentdirnames[2] &&
                   ((i == 3 && samplename ∈ samplenames[1:3]) || (i == 2 && samplename == samplenames[2]))
                    ch1_startframe = 1
                    ch2_startframe = 15001
                else
                    ch1_startframe = 1
                    ch2_startframe = 11001
                end

                ch1_task = remotecall(getmolecules, currentworkers[1], localizations,
                    ch1_name,
                    ch1_startframe,
                    11000,
                    100,
                    10,
                    34.2,
                    500,
                    200,
                )
                ch2_task = remotecall(getmolecules, currentworkers[2], localizations,
                    ch2_name,
                    ch2_startframe,
                    11000,
                    100,
                    10,
                    34.2,
                    500,
                    200,
                )

                ch1_molecules, ch1_localizations = fetch(ch1_task)
                ch2_molecules, ch2_localizations = fetch(ch2_task)

                ch1_neighbors, ch2_neighbors, distances = exclusivenearestneighbors(ch1_molecules, ch2_molecules)

                percentileranks = montecarloaffinity(
                    ch1_molecules,
                    ch2_molecules,
                    ch1_neighbors,
                    ch2_neighbors,
                    distances,
                    800,
                    mc_iterations
                )

                positivecontrol_percentileranks, positivecontrol_distances = simulate100(ch1_molecules, ch2_molecules, ch1_neighbors, ch2_neighbors, 80, 800, mc_iterations)
                # I found that the variance in running the negative control drops smoothly as a function of neighbor counts.
                # This heuristic cuts down on computational time without sacrificing quality of the correction.
                negative_iterations = length(distances) < 250 ? 30 :
                                      length(distances) < 500 ? 20 :
                                      length(distances) < 1000 ? 10 :
                                      length(distances) < 2000 ? 5 :
                                      1
                negativecontrol = [simulate0(ch1_molecules, ch2_molecules, 800, 10000) for i in 1:negative_iterations]
                negativecontrol_percentileranks = [first(i) for i in negativecontrol]
                negativecontrol_distances = [last(i) for i in negativecontrol]

                mediandistance = length(distances) == 0 ? NaN : median(distances)

                println("                Done: $(length(distances)) neighbors from $(length(ch1_molecules)) and $(length(ch2_molecules)) molecules, $(length(ch1_localizations)) and $(length(ch2_localizations)) localizations; median distance $mediandistance")
                ch1_data = ChannelData(ch1_name, ch1_molecules, ch1_neighbors)
                ch2_data = ChannelData(ch2_name, ch2_molecules, ch2_neighbors)
                result = Result(projectname, experimentdirname, 1, cellpath, i,
                                [ch1_data, ch2_data], distances, mediandistance, percentileranks,
                                positivecontrol_distances, negativecontrol_distances,
                                positivecontrol_percentileranks, negativecontrol_percentileranks)

                push!(results, result)
            end
            push!(sampleresults, results)
        end
        push!(replicateresults, sampleresults)
    end
    push!(experimentresults, replicateresults)
end

save(outputdatapath, "experimentresults", experimentresults)

rmprocs(currentworkers)


text:
#Script para completar la tabla acumulativa a partir del csv de casos positivos diarios.

#Paqueterías para leer CSVs y usar dataframes.
using CSV
using DataFrames

nombres_estados = ["AGUASCALIENTES", "BAJA CALIFORNIA", "BAJA CALIFORNIA SUR", "CAMPECHE", "CHIAPAS", "CHIHUAHUA", "CIUDAD DE MÉXICO", "COAHUILA", "COLIMA", "DURANGO", "GUANAJUATO", "GUERRERO", "HIDALGO", "JALISCO", "MICHOACÁN", "MORELOS", "MÉXICO", "NAYARIT", "NUEVO LEÓN", "OAXACA", "PUEBLA", "QUERÉTARO", "QUINTANA ROO", "SAN LUIS POTOSÍ", "SINALOA", "SONORA", "TABASCO", "TAMAULIPAS", "TLAXCALA", "VERACRUZ", "YUCATÁN", "ZACATECAS"]

#Cálculo de los números de tipos de casos (sospechosos, importados, locales, positivos y fallecidos) por estado:
function tipo_casos(sospechosos_diarios, confirmados_diarios, fallecidos_diarios, estado)

    #Obtiene los datos de casos sospechosos del estado:
    casos_sospechosos_nomissing = filter(row -> ismissing(row[:Estado]) == false, sospechosos_diarios)
    casos_sospechosos_entidad = filter(row -> row[:Estado] == estado, casos_sospechosos_nomissing)
    #Obtiene los datos del estado:
    casos_entidad = filter(row -> row[:Estado] == estado, confirmados_diarios)

    #El número total de casos sospechosos en el estado:
    sospechosos = length(casos_sospechosos_entidad.Situación)
    #El número total de casos confirmados en el estado:
    positivos = length(casos_entidad.Situación)

    #El número total de fallecidos en el estado se extrae del otro documento:
    fallecidos = filter(row -> row[:Estado] == estado, fallecidos_diarios).Fallecidos[1]

    #El número de recuperados ya no se publica en los documentos oficiales. Se reporta como missing.
    #Ya no se distinguen casos importados de locales. Se reportan por retrocompatibilidad como missing.
    return [sospechosos, missing, missing, positivos, missing, fallecidos]
end

#Actualiza la tabla cumulativa del día a partir de la fecha y los datos del CTD.
#La fecha se debe de poner como string e.g. "20200320"
function fila_actualización(fecha, positivos_reportados, sospechosos_reportados, negativos_reportados)

    #Carga los datos del día:
    sospechosos_diarios = CSV.read("CTD/Scraped_data/$(fecha[1:6])/sospechosos_$(fecha).csv", header = 1, copycols = true)
    confirmados_diarios = CSV.read("CTD/Scraped_data/$(fecha[1:6])/positivos_$(fecha).csv", header = 1, copycols = true)
    fallecidos_diarios = CSV.read("CTD/Scraped_data/$(fecha[1:6])/fallecidos_$(fecha).csv", header = 1)

    #Calcula los casos de cada estado
    casos_estados = map(estado -> tipo_casos(sospechosos_diarios, confirmados_diarios, fallecidos_diarios, estado), nombres_estados)

    #Calcula los casos en el país
    acumulado_país = sum(casos_estados)

    #Calcula el número total de muestras analizadas.
    total_tests = acumulado_país[4] + negativos_reportados
    #Genera un vector con el número de casos positivos importados, locales, total de casos; positivos reportados, sospechosos reportados, negativos reportados, número total de pruebas, número de casos recuperados y número de casos fallecidos (para mantener el orden de la tabla original):
    reporte_país = [acumulado_país[1:4]..., positivos_reportados, sospechosos_reportados, negativos_reportados, missing, total_tests, acumulado_país[5:6]...]

    #Genera la fila de datos del día correspondiente:
    fila = string.(vcat(casos_estados..., reporte_país))

    #Agrega la fecha a la primer columna:
    pushfirst!(fila, fecha[1:4]*"-"*fecha[5:6]*"-"*fecha[7:8])

    #Agrega comas para el csv y lo junta todo en un string
    fila_csv = prod(fila[1:(end - 1)].*",")*fila[end]

    #Elimina los missing (para que quede el espacio vacío)
    fila_csv = replace(fila_csv, r"missing" => "")

    #Agrega el resultado al csv acumulativo:
    open("Mexico_COVID19_CTD.csv", "a") do io

        write(io, fila_csv*"\n")
    end

    return "Done"
end


text:
module KernelFactors

using StaticArrays, OffsetArrays
using ..ImageFiltering: centered, dummyind
import ..ImageFiltering: _reshape, _vec, nextendeddims
using Base: tail, Indices, @pure, checkbounds_indices, throw_boundserror

abstract IIRFilter{T}

"""

`KernelFactors` is a module implementing separable filtering kernels,
each stored in terms of their factors. The following kernels are
supported:

  - `sobel`
  - `prewitt`
  - `ando3`, `ando4`, and `ando5` (the latter in 2d only)
  - `gaussian`
  - `IIRGaussian` (approximate gaussian filtering, fast even for large σ)

See also: Kernel.
"""
KernelFactors

Base.eltype{T}(kernel::IIRFilter{T}) = T

"""
    ReshapedOneD{N,Npre}(data)

Return an object of dimensionality `N`, where `data` must have
dimensionality 1. The indices are `0:0` for the first `Npre`
dimensions, have the indices of `data` for dimension `Npre+1`, and are
`0:0` for the remaining dimensions.

`data` must support `eltype` and `ndims`, but does not have to be an
AbstractArray.

ReshapedOneDs allow one to specify a "filtering dimension" for a
1-dimensional filter.
"""
immutable ReshapedOneD{T,N,Npre,V}  # not <: AbstractArray{T,N} (more general, incl. IIR)
    data::V

    function ReshapedOneD(data::V)
        ndims(V) == 1 || throw(DimensionMismatch("must be one dimensional, got $(ndims(V))"))
        new(data)
    end
end

(::Type{ReshapedOneD{N,Npre}}){N,Npre,V}(data::V) = ReshapedOneD{eltype(data),N,Npre,V}(data)
# Convenient loop constructor that uses dummy NTuple{N,Bool} to keep
# track of dimensions for type-stability
@inline function ReshapedOneD{Npre,Npost}(pre::NTuple{Npre,Bool}, data, post::NTuple{Npost,Bool})
    total = (pre..., true, post...)
    _reshapedvector(total, pre, data)
end
_reshapedvector{N,Npre}(::NTuple{N,Bool}, ::NTuple{Npre,Bool}, data) = ReshapedOneD{eltype(data),N,Npre,typeof(data)}(data)

# Give ReshapedOneD many of the characteristics of AbstractArray
Base.eltype{T}(A::ReshapedOneD{T}) = T
Base.ndims{_,N}(A::ReshapedOneD{_,N}) = N
Base.isempty(A::ReshapedOneD) = isempty(A.data)

@inline Base.indices{_,N,Npre}(A::ReshapedOneD{_,N,Npre}) = Base.fill_to_length((Base.ntuple(d->0:0, Val{Npre})..., UnitRange(Base.indices1(A.data))), 0:0, Val{N})

Base.start(A::ReshapedOneD) = start(A.data)
Base.next(A::ReshapedOneD, state) = next(A.data, state)
Base.done(A::ReshapedOneD, state) = done(A.data, state)

@inline function Base.getindex(A::ReshapedOneD, i::Int)
    @boundscheck checkbounds(A.data, i)
    @inbounds ret = A.data[i]
    ret
end
@inline function Base.getindex{T,N,Npre}(A::ReshapedOneD{T,N,Npre}, I::Vararg{Int,N})
    @boundscheck checkbounds_indices(Bool, indices(A), I) || throw_boundserror(A, I)
    @inbounds ret = A.data[I[Npre+1]]
    ret
end
@inline function Base.getindex(A::ReshapedOneD, I::Union{CartesianIndex,Int}...)
    A[Base.IteratorsMD.flatten(I)...]
end

Base.convert{AA<:AbstractArray}(::Type{AA}, A::ReshapedOneD) = convert(AA, reshape(A.data, indices(A)))

import Base: ==
==(A::ReshapedOneD, B::ReshapedOneD) = convert(AbstractArray, A) == convert(AbstractArray, B)
==(A::ReshapedOneD, B::AbstractArray) = convert(AbstractArray, A) == B
==(A::AbstractArray, B::ReshapedOneD) = A == convert(AbstractArray, B)

import Base: .+, .-, .*, ./
for op in (:+, :-, :*, :/)
    opdot = Symbol(:., op)
    @eval begin
        ($opdot)(A::ReshapedOneD, B::ReshapedOneD) = broadcast($op, A, B)
        @inline ($opdot)(As::ReshapedOneD...) = broadcast($op, As...)
    end
end
# for broadcasting
@pure Base.promote_eltype_op{S,T}(op, ::ReshapedOneD{S}, ::ReshapedOneD{T}) = Base.promote_op(op, S, T)
@pure Base.promote_eltype_op{S,T}(op, ::Type{S}, ::ReshapedOneD{T}) = Base.promote_op(op, S, T)

_reshape{T,N}(A::ReshapedOneD{T,N}, ::Type{Val{N}}) = A
_vec(A::ReshapedOneD) = A.data
Base.vec(A::ReshapedOneD) = A.data  # is this OK? (note indices won't nec. start with 1)
nextendeddims(a::ReshapedOneD) = 1

"""
    iterdims(inds, v::ReshapedOneD{T,N,Npre}) -> Rpre, ind, Rpost

Return a pair `Rpre`, `Rpost` of CartesianRanges that correspond to
pre- and post- dimensions for iterating over an array with indices
`inds`. `Rpre` corresponds to the `Npre` "pre" dimensions, and `Rpost`
to the trailing dimensions (not including the vector object wrapped in
`v`).  Concretely,

    Rpre  = CartesianRange(inds[1:Npre])
    ind   = inds[Npre+1]
    Rpost = CartesianRange(inds[Npre+2:end])

although the implementation differs for reason of type-stability.
"""
function iterdims{_,N,Npre}(inds::Indices{N}, v::ReshapedOneD{_,N,Npre})
    indspre, ind, indspost = _iterdims((), (), inds, v)
    CartesianRange(indspre), ind, CartesianRange(indspost)
end
@inline function _iterdims(indspre, ::Tuple{}, inds, v)
    _iterdims((indspre..., inds[1]), (), tail(inds), v)  # consume inds and push to indspre
end
@inline function _iterdims{_,N,Npre}(indspre::NTuple{Npre}, ::Tuple{}, inds, v::ReshapedOneD{_,N,Npre})
    indspre, inds[1], tail(inds)   # return the "central" and trailing dimensions
end

#### FIR filters

## gradients

"""
    kern1, kern2 = sobel()

Factored Sobel filters for dimensions 1 and 2 of a two-dimensional
image. Each is a 2-tuple of one-dimensional filters.
"""
function sobel()
    f1 = centered(SVector( 1.0, 2.0, 1.0)/4)
    f2 = centered(SVector(-1.0, 0.0, 1.0)/2)
    return kernelfactors((f2, f1)), kernelfactors((f1, f2))
end

"""
    kern = sobel(extended::NTuple{N,Bool}, d)

Return a factored Sobel filter for computing the gradient in `N` dimensions along axis `d`.
If `extended[dim]` is false, `kern` will have size 1 along that dimension.
"""
function sobel{N}(extended::NTuple{N,Bool}, d)
    gradfactors(extended, d, [-1, 0, 1]/2, [1, 2, 1]/4)
end

"`kern1, kern2 = prewitt()` returns factored Prewitt filters for dimensions 1 and 2 of your image"
function prewitt()
    f1 = centered(SVector( 1.0, 1.0, 1.0)/3)
    f2 = centered(SVector(-1.0, 0.0, 1.0)/2)
    return kernelfactors((f2, f1)), kernelfactors((f1, f2))
end

"""
    kern = prewitt(extended::NTuple{N,Bool}, d)

Return a factored Prewitt filter for computing the gradient in `N` dimensions along axis `d`.
If `extended[dim]` is false, `kern` will have size 1 along that dimension.
"""
function prewitt{N}(extended::NTuple{N,Bool}, d)
    gradfactors(extended, d, [-1, 0, 1]/2, [1, 1, 1]/3)
end

# Consistent Gradient Operators
# Ando Shigeru
# IEEE Trans. Pat. Anal. Mach. Int., vol. 22 no 3, March 2000
#
# TODO: These coefficients were taken from the paper. It would be nice
#       to resolve the optimization problem and use higher precision
#       versions, which might allow better separable approximations of
#       ando4 and ando5.

"""
`kern1, kern2 = ando3()` returns optimal 3x3 gradient filters for dimensions 1 and 2 of your image, as defined in
Ando Shigeru, IEEE Trans. Pat. Anal. Mach. Int., vol. 22 no 3, March 2000.

See also: `ando4`, `ando5`.
"""
function ando3()
    f1 = centered(2*SVector(0.112737, 0.274526, 0.112737))
    f2 = centered(SVector(-1.0, 0.0, 1.0)/2)
    return kernelfactors((f2, f1)), kernelfactors((f1, f2))
end

"""
    kern = ando3(extended::NTuple{N,Bool}, d)

Return a factored Ando filter (size 3) for computing the gradient in
`N` dimensions along axis `d`.  If `extended[dim]` is false, `kern`
will have size 1 along that dimension.
"""
function ando3{N}(extended::NTuple{N,Bool}, d)
    gradfactors(extended, d, [-1.0, 0.0, 1.0]/2, 2*[0.112737, 0.274526, 0.112737])
end

"""
`kern1, kern2 = ando4()` returns separable approximations of the
optimal 4x4 filters for dimensions 1 and 2 of your image, as defined
in Ando Shigeru, IEEE Trans. Pat. Anal. Mach. Int., vol. 22 no 3,
March 2000.

See also: `Kernel.ando4`.
"""
function ando4()
    f1 = centered(SVector( 0.0919833,  0.408017, 0.408017, 0.0919833))
    f2 = centered(1.46205884*SVector(-0.0919833, -0.408017, 0.408017, 0.0919833))
    return kernelfactors((f2, f1)), kernelfactors((f1, f2))
end

"""
    kern = ando4(extended::NTuple{N,Bool}, d)

Return a factored Ando filter (size 4) for computing the gradient in
`N` dimensions along axis `d`.  If `extended[dim]` is false, `kern`
will have size 1 along that dimension.
"""
function ando4{N}(extended::NTuple{N,Bool}, d)
    if N == 2 && all(extended)
        return ando4()[d]
    else
        error("dimensions other than 2 are not yet supported")
    end
end

"""
`kern1, kern2 = ando5_sep()` returns separable approximations of the
optimal 5x5 gradient filters for dimensions 1 and 2 of your image, as defined
in Ando Shigeru, IEEE Trans. Pat. Anal. Mach. Int., vol. 22 no 3,
March 2000.

See also: `Kernel.ando5`.
"""
function ando5()
    f1 = centered(SVector( 0.0357338, 0.248861, 0.43081, 0.248861, 0.0357338))
    f2 = centered(0.784406*SVector(-0.137424, -0.362576, 0.0,     0.362576, 0.137424))
    return kernelfactors((f2, f1)), kernelfactors((f1, f2))
end

"""
    kern = ando5(extended::NTuple{N,Bool}, d)

Return a factored Ando filter (size 5) for computing the gradient in
`N` dimensions along axis `d`.  If `extended[dim]` is false, `kern`
will have size 1 along that dimension.
"""
function ando5{N}(extended::NTuple{N,Bool}, d)
    if N == 2 && all(extended)
        return ando5()[d]
    else
        error("dimensions other than 2 are not yet supported")
    end
end

## Gaussian

"""
    gaussian(σ::Real, [l]) -> g

Construct a 1d gaussian kernel `g` with standard deviation `σ`, optionally
providing the kernel length `l`. The default is to extend by two `σ`
in each direction from the center. `l` must be odd.
"""
function gaussian(σ::Real, l = 4*ceil(Int,σ)+1)
    isodd(l) || throw(ArgumentError("length must be odd"))
    w = l>>1
    g = [exp(-x^2/(2*σ^2)) for x=-w:w]
    centered(g/sum(g))
end

"""
    gaussian((σ1, σ2, ...), [l]) -> (g1, g2, ...)

Construct a multidimensional gaussian filter as a product of single-dimension
factors, with standard deviation `σd` along dimension `d`. Optionally
provide the kernel length `l`, which must be a tuple of the same
length.
"""
gaussian{N}(σs::NTuple{N,Real}, ls::NTuple{N,Integer}) =
    kernelfactors( map((σ,l)->gaussian(σ,l), σs, ls) )
gaussian{N}(σs::NTuple{N,Real}) = kernelfactors(map(σ->gaussian(σ), σs))

gaussian(σs::AbstractVector, ls::AbstractVector) = gaussian((σs...,), (ls...,))
gaussian(σs::AbstractVector) = gaussian((σs...,))

#### IIR

immutable TriggsSdika{T,k,l,L} <: IIRFilter{T}
    a::SVector{k,T}
    b::SVector{l,T}
    scale::T
    M::SMatrix{l,k,T,L}
    asum::T
    bsum::T

    TriggsSdika(a, b, scale, M) = new(a, b, scale, M, sum(a), sum(b))
end
"""
    TriggsSdika(a, b, scale, M)

Defines a kernel for one-dimensional infinite impulse response (IIR)
filtering. `a` is a "forward" filter, `b` a "backward" filter, `M` is
a matrix for matching boundary conditions at the right edge, and
`scale` is a constant scaling applied to each element at the
conclusion of filtering.

# Citation

B. Triggs and M. Sdika, "Boundary conditions for Young-van Vliet
recursive filtering". IEEE Trans. on Sig. Proc. 54: 2365-2367
(2006).
"""
TriggsSdika{T,k,l,L}(a::SVector{k,T}, b::SVector{l,T}, scale, M::SMatrix{l,k,T,L}) = TriggsSdika{T,k,l,L}(a, b, scale, M)

"""
    TriggsSdika(ab, scale)

Create a symmetric Triggs-Sdika filter (with `a = b = ab`). `M` is
calculated for you. Only length 3 filters are currently supported.
"""
function TriggsSdika{T}(a::SVector{3,T}, scale)
    a1, a2, a3 = a[1], a[2], a[3]
    Mdenom = (1+a1-a2+a3)*(1-a1-a2-a3)*(1+a2+(a1-a3)*a3)
    M = @SMatrix([-a3*a1+1-a3^2-a2     (a3+a1)*(a2+a3*a1)  a3*(a1+a3*a2);
                  a1+a3*a2            -(a2-1)*(a2+a3*a1)  -(a3*a1+a3^2+a2-1)*a3;
                  a3*a1+a2+a1^2-a2^2   a1*a2+a3*a2^2-a1*a3^2-a3^3-a3*a2+a3  a3*(a1+a3*a2)]);
    TriggsSdika(a, a, scale, M/Mdenom)
end
Base.vec(kernel::TriggsSdika) = kernel
Base.ndims(kernel::TriggsSdika) = 1
Base.ndims{T<:TriggsSdika}(::Type{T}) = 1
Base.indices1(kernel::TriggsSdika) = 0:0
Base.indices(kernel::TriggsSdika) = (Base.indices1(kernel),)
Base.isempty(kernel::TriggsSdika) = false

iterdims(inds::Indices{1}, kern::TriggsSdika) = (), inds[1], ()
_reshape(kern::TriggsSdika, ::Type{Val{1}}) = kern

# Note that there's a sign reversal between Young & Triggs.
"""
    IIRGaussian([T], σ; emit_warning::Bool=true)

Construct an infinite impulse response (IIR) approximation to a
Gaussian of standard deviation `σ`. `σ` may either be a single real
number or a tuple of numbers; in the latter case, a tuple of such filters
will be created, each for filtering a different dimension of an array.

Optionally specify the type `T` for the filter coefficients; if not
supplied, it will match `σ` (unless `σ` is not floating-point, in
which case `Float64` will be chosen).

# Citation

I. T. Young, L. J. van Vliet, and M. van Ginkel, "Recursive Gabor
Filtering". IEEE Trans. Sig. Proc., 50: 2798-2805 (2002).
"""
function IIRGaussian{T}(::Type{T}, σ::Real; emit_warning::Bool = true)
    if emit_warning && σ < 1 && σ != 0
        warn("σ is too small for accuracy")
    end
    m0 = convert(T,1.16680)
    m1 = convert(T,1.10783)
    m2 = convert(T,1.40586)
    q = convert(T,1.31564*(sqrt(1+0.490811*σ*σ) - 1))
    ascale = (m0+q)*(m1*m1 + m2*m2  + 2m1*q + q*q)
    B = (m0*(m1*m1 + m2*m2)/ascale)^2
    # This is what Young et al call -b, but in filt() notation would be called a
    a1 = q*(2*m0*m1 + m1*m1 + m2*m2 + (2*m0+4*m1)*q + 3*q*q)/ascale
    a2 = -q*q*(m0 + 2m1 + 3q)/ascale
    a3 = q*q*q/ascale
    a = SVector(a1,a2,a3)
    TriggsSdika(a, B)
end
IIRGaussian(σ::Real; emit_warning::Bool = true) = IIRGaussian(iirgt(σ), σ; emit_warning=emit_warning)

function IIRGaussian{T,N}(::Type{T}, σs::NTuple{N,Real}; emit_warning::Bool = true)
    iirg(T, (), σs, tail(ntuple(d->true, Val{N})), emit_warning)
end
IIRGaussian(σs::Tuple; emit_warning::Bool = true) = IIRGaussian(iirgt(σs), σs; emit_warning=emit_warning)

IIRGaussian(σs::AbstractVector; kwargs...) = IIRGaussian((σs...,); kwargs...)
IIRGaussian{T}(::Type{T}, σs::AbstractVector; kwargs...) = IIRGaussian(T, (σs...,); kwargs...)

iirgt(σ::AbstractFloat) = typeof(σ)
iirgt(σ::Real) = Float64
iirgt(σs::Tuple) = promote_type(map(iirgt, σs)...)

@inline function iirg{T}(::Type{T}, pre, σs, post, emit_warning)
    kern = ReshapedOneD(pre, IIRGaussian(T, σs[1]; emit_warning=emit_warning), post)
    (kern, iirg(T, (pre..., post[1]), tail(σs), tail(post), emit_warning)...)
end
iirg{T}(::Type{T}, pre, σs::Tuple{Real}, ::Tuple{}, emit_warning) =
    (ReshapedOneD(pre, IIRGaussian(T, σs[1]; emit_warning=emit_warning), ()),)

###### Utilities

"""
    kernelfactors(factors::Tuple)

Prepare a factored kernel for filtering. If passed a 2-tuple of
vectors of lengths `m` and `n`, this will return a 2-tuple of
`ReshapedVector`s that are effectively of sizes `m×1` and `1×n`. In
general, each successive `factor` will be reshaped to extend along the
corresponding dimension.

If passed a tuple of general arrays, it is assumed that each is shaped
appropriately along its "leading" dimensions; the dimensionality of each is
"extended" to `N = length(factors)`, appending 1s to the size as needed.
"""
kernelfactors{N}(factors::NTuple{N,AbstractVector}) = _kernelfactors((), ntuple(d->true,Val{N}), (), factors)

_kernelfactors(pre, post, out::NTuple, ::Tuple{}) = out
@inline function _kernelfactors(pre, post, out, factors)
    # L+M=N
    f = factors[1]
    newpost = tail(post)
    rv = ReshapedOneD(pre, f, newpost)
    _kernelfactors((pre..., true), newpost, (out..., rv), tail(factors))
end

# A variant in which we just need to fill out to N dimensions
kernelfactors{N}(factors::NTuple{N,AbstractArray}) = map(f->_reshape(f, Val{N}), factors)

function gradfactors{N}(extended::NTuple{N,Bool}, d::Int, k1, k2)
    kernelfactors(ntuple(i -> kdim(extended[i], i==d ? k1 : k2), Val{N}))
end

kdim(keep::Bool, k) = keep ? centered(k) : OffsetArray([one(eltype(k))], 0:0)

end


text:
@symbol_func function G_CS(cur_reactor::AbstractReactor)
  cur_G = h_CS(cur_reactor)

  cur_G *= G_LO(cur_reactor)

  cur_G *= safe_symbol(cur_reactor, :R_0) ^ 3

  cur_G *= cur_reactor.T_bar

  cur_G ^= (1/2)

  cur_G
end


text:
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------

"""
    RotationConvention

Convention used to specify rotations in 2D and 3D spaces.
"""
abstract type RotationConvention end

"""
    axesseq(convention) -> Symbol

Sequence of three axes by which the rotations are made, e.g. `:ZXZ`.
"""
function axesseq(::Type{<:RotationConvention}) end

"""
    orientation(convention) -> Tuple{Symbol,Symbol,Symbol}

Informs for each of the three rotation if it is clockwise (`:CW`) or
counter-clockwise (`:CCW`). Adopts right-hand rule: orientation defined
looking towards the negative direction of the axis.
"""
function orientation(::Type{<:RotationConvention}) end

"""
    angleunits(convention) -> Symbol

Informs the angle units of the rotations in radians (`:RAD`) or in degrees (`:DEG`).
"""
function angleunits(::Type{<:RotationConvention}) end

"""
    mainaxis(convention) -> Symbol

Informs if the main axis of the rotation is `:X` or `:Y`.
"""
function mainaxis(::Type{<:RotationConvention}) end

"""
    isextrinsic(convention) -> Bool

Informs if the rotation is extrinsic or intrinsic.
"""
function isextrinsic(::Type{<:RotationConvention}) end

"""
    rotmat(angles, convention)

Return the direction cosine matrix of rotation for the given `angles`
according to the rotation `convention`.
"""
function rotmat(angles, convention::Type{<:RotationConvention})
  nangles = length(angles)
  @assert nangles ∈ [1,3] "invalid number of angles"

  Dim = nangles == 1 ? 2 : 3

  # convert to radian if necessary
  θs = angleunits(convention) == :DEG ? deg2rad.(angles) : angles

  # invert sign if necessary
  _0 = zero(eltype(θs))
  Dim == 2 && (θs = [θs[1], _0, _0])
  intr = (orientation(convention) .== :CW) .& !isextrinsic(convention)
  extr = (orientation(convention) .== :CCW) .& isextrinsic(convention)
  inds = collect(intr .| extr)
  θs[inds] *= -1

  # rotation matrix
  R = angle_to_dcm(θs..., axesseq(convention))[SOneTo(Dim),SOneTo(Dim)]

  isextrinsic(convention) ? R' : R
end

# ----------------
# IMPLEMENTATIONS
# ----------------

include("conventions/TaitBryanExtr.jl")
include("conventions/TaitBryanIntr.jl")
include("conventions/EulerExtr.jl")
include("conventions/EulerIntr.jl")
include("conventions/GSLIB.jl")
include("conventions/Leapfrog.jl")
include("conventions/Datamine.jl")


text:
module Catlab

end


text:
using JLSponge, DataStructures

function move_segments(x::TCPConnection, y::TCPConnection, segments::Vector{TCPSegment},
                       reorder::Bool)
    while x.segments_out |> !isempty
        push!(segments, dequeue!(x.segments_out))
    end
    if reorder
        for seg in Iterators.reverse(segments)
            segment_received!(y, seg)
        end
    else
        for seg in segments
            segment_received!(y, seg)
        end
    end
    empty!(segments)
end

function main(reorder::Bool)
    ## When len = 100 * 1024 * 4, the program will give infinite loop
    ## and stuck in `while !eof(inbound_stream(y))`

    len = 100 * 1024 * 3
    x, y = TCPConnection(;cap=65000), TCPConnection(;cap=65000)
    string_to_send = rand(UInt8(1):UInt8(127), len) |> pointer |> unsafe_string
    bytes_to_send = @view(string_to_send[1:end])
    connect!(x)
    end_input_stream!(y)
    x_closed = false
    string_reveived = IOBuffer()

    first_time = time_ns()
    while !eof(inbound_stream(y))
        while length(bytes_to_send) != 0 && remaining_outbound_capacity(x) != 0
            want = min(remaining_outbound_capacity(x), length(bytes_to_send))
            written = write!(x, @view(bytes_to_send[1:want]))
            (written == want) || error("want = $want, written = $written")
            bytes_to_send = @view(bytes_to_send[want+1:end])
        end

        if length(bytes_to_send) == 0 && !x_closed
            end_input_stream!(x)
            x_closed = true
        end

        segments = TCPSegment[]
        move_segments(x, y, segments, reorder)
        move_segments(y, x, segments, false)
        available_output = inbound_stream(y) |> buffer_size
        if available_output > 0
            write(string_reveived, read!(inbound_stream(y), available_output))
        end
        tick!(x, 1000)
        tick!(y, 1000)
    end

    (string_reveived |> take! != string_to_send) || error("strings sent vs. received don't match")
    final_time = time_ns()
    duration = final_time - first_time
    gigabits_per_second = len * 8.0 / duration

    println("CPU-limited throughput",
        (reorder ? " with reordering: " : "                : "),
        gigabits_per_second, " Gbit/s")

    while isactive(x) || isactive(y)
        while length(bytes_to_send) != 0 && remaining_outbound_capacity(x) != 0
            want = min(remaining_outbound_capacity(x), length(bytes_to_send))
            written = write!(x, @view(bytes_to_send[1:want]))
            (written == want) || error("want = $want, written = $written")
            bytes_to_send = @view(bytes_to_send[want+1:end])
        end

        if length(bytes_to_send) == 0 && !x_closed
            end_input_stream!(x)
            x_closed = true
        end

        segments = TCPSegment[]
        move_segments(x, y, segments, reorder)
        move_segments(y, x, segments, false)
        available_output = inbound_stream(y) |> buffer_size
        if available_output > 0
            write(string_reveived, read!(inbound_stream(y), available_output))
        end
        tick!(x, 1000)
        tick!(y, 1000)
    end
end

# main(false)
# main(true)

"""

void move_segments(TCPConnection &x, TCPConnection &y, vector<TCPSegment> &segments, const bool reorder) {
    while (not x.segments_out().empty()) {
        segments.emplace_back(move(x.segments_out().front()));
        x.segments_out().pop();
    }
    if (reorder) {
        for (auto it = segments.rbegin(); it != segments.rend(); ++it) {
            y.segment_received(move(*it));
        }
    } else {
        for (auto it = segments.begin(); it != segments.end(); ++it) {
            y.segment_received(move(*it));
        }
    }
    segments.clear();
}

void main_loop(const bool reorder) {
    TCPConfig config;
    TCPConnection x{config}, y{config};

    string string_to_send(len, 'x');
    for (auto &ch : string_to_send) {
        ch = rand();
    }

    Buffer bytes_to_send{string(string_to_send)};
    x.connect();
    y.end_input_stream();

    bool x_closed = false;

    string string_received;
    string_received.reserve(len);

    const auto first_time = high_resolution_clock::now();

    auto loop = [&] {
        // write input into x
        while (bytes_to_send.size() and x.remaining_outbound_capacity()) {
            const auto want = min(x.remaining_outbound_capacity(), bytes_to_send.size());
            const auto written = x.write(string(bytes_to_send.str().substr(0, want)));
            if (want != written) {
                throw runtime_error("want = " + to_string(want) + ", written = " + to_string(written));
            }
            bytes_to_send.remove_prefix(written);
        }

        if (bytes_to_send.size() == 0 and not x_closed) {
            x.end_input_stream();
            x_closed = true;
        }

        // exchange segments between x and y but in reverse order
        vector<TCPSegment> segments;
        move_segments(x, y, segments, reorder);
        move_segments(y, x, segments, false);

        // read output from y
        const auto available_output = y.inbound_stream().buffer_size();
        if (available_output > 0) {
            string_received.append(y.inbound_stream().read(available_output));
        }

        // time passes
        x.tick(1000);
        y.tick(1000);
    };

    while (not y.inbound_stream().eof()) {
        loop();
    }

    if (string_received != string_to_send) {
        throw runtime_error("strings sent vs. received don't match");
    }

    const auto final_time = high_resolution_clock::now();

    const auto duration = duration_cast<nanoseconds>(final_time - first_time).count();

    const auto gigabits_per_second = len * 8.0 / double(duration);

    cout << fixed << setprecision(2);
    cout << "CPU-limited throughput" << (reorder ? " with reordering: " : "                : ") << gigabits_per_second
         << " Gbit/s\n";

    while (x.active() or y.active()) {
        loop();
    }
}

int main() {
    try {
        main_loop(false);
        main_loop(true);
    } catch (const exception &e) {
        cerr << e.what() << "\n";
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}
"""

max_stars_repo_name: AquaIndigo/JLSponge

max_issues_repo_name: AquaIndigo/JLSponge

max_forks_repo_name: AquaIndigo/JLSponge