text:
##################################################################################
# This file is part of ModelBaseEcon.jl
# BSD 3-Clause License
# Copyright (c) 2020, Bank of Canada
# All rights reserved.
##################################################################################

###########################################################
# Part 1: Error handling

"""
    ModelErrorBase

Abstract error type, base for specific error types used in ModelBaseEcon.

# Implementation (note for developers)

When implementing a derived error type, override two functions:
  * `msg(e::SomeModelError)` returning a string with the error message;
  * `hint(e::SomeModelError)` returning a string containing a suggestion of how
    to fix the problem. Optional, if not implemented for a type, the fallback
    implementation returns an empty string.

"""
abstract type ModelErrorBase <: Exception end
export ModelErrorBase
"""
    msg(::ModelErrorBase)

Return the error message - a description of what went wrong.
"""
msg(::ModelErrorBase) = "Unknown error"

"""
    hint(::ModelErrorBase)

Return the hint message - a suggestion of how the problem might be fixed.
"""
hint(::ModelErrorBase) = ""

function Base.showerror(io::IO, me::ME) where ME <: ModelErrorBase
    # MEstr = split("$(ME)", ".")[end]
    # println(io, MEstr, ": ", msg(me))
    println(io, ME, ": ", msg(me))
    h = hint(me)
    if !isempty(h)
        println(io, "    ", h)
    end
end

"""
    struct ModelError <: ModelErrorBase

Concrete error type used when no specific error description is available.
"""
struct ModelError <: ModelErrorBase end
export ModelError

@inline modelerror(ME::Type{<:ModelErrorBase}=ModelError, args...; kwargs...) = throw(ME(args...; kwargs...))

"""
    struct ModelNotInitError <: ModelErrorBase

Specific error type used when there's an attempt to use a Model object that
has not been initialized.
"""
struct ModelNotInitError <: ModelErrorBase end
msg(::ModelNotInitError) = "Model not ready to use."
hint(::ModelNotInitError) = "Call `@initialize model` first."
export ModelNotInitError

"""
    struct NotImplementedError <: ModelErrorBase

Specific error type used when a feature is planned but not yet implemented.
"""
struct NotImplementedError <: ModelErrorBase
    descr
end
msg(fe::NotImplementedError) = "Feature not implemented: $(fe.descr)."
export NotImplementedError


text:
struct KFParms{Zt, Ht, Tt, Rt, Qt}
    Z::Zt
    H::Ht
    T::Tt
    R::Rt
    Q::Qt
end

mutable struct KFFiltered{AT, PT, PI, PIX}
    a::AT
    P::PT
    Pstar::PI
    Pinf::PIX
    d::Array{Int,1}
    flagF::Array{Int, 1}
    hasdiffended::BitArray{1}
end

mutable struct KFSmoothed{AT, PT}
    a::AT
    V::PT
    r::AT
    N::PT
end

struct KFInitVal{AT, PT}
    a1::AT
    P1::PT
end

struct KFCache{FF, FI, DD, T}
    F⁻¹::FF ##  (p x p)
    F::FI   ##  (p x p)
    Y::DD   ##  (p)
    v::Array{T, 1}
    vp::Array{T, 1}
    C::Array{T, 2}
    M::Array{T, 2}
    ZM::Array{T, 2}
    TM::Array{T, 2}
    K::Array{T, 2}
    KZ::Array{T, 2}
    KZp::Array{T, 2}
    L::Array{T, 2}
    TPL::Array{T, 2}
    ap::Array{T, 1}
    Pp::Array{T, 2}
end

struct LinearStateSpace{P<:KFParms, F<:KFFiltered, S<:KFSmoothed,  I<:KFInitVal, C<:KFCache, L<:Array, N<:Base.RefValue{Int64}}
    p::P
    f::F
    s::S
    i::I
    c::C
    loglik::L
    t::N
end

struct SSMOptimPar{T, V, F1, F2, M}
    Z::T
    H::T
    T::T
    R::T
    Q::T
    a1::V
    P1::T
    a1!::F1
    P1!::F2
    P1inf::M
    Pstar::M
end

struct SSMOptimParDual{T, S, M, J, H}
    Z::Array{T,2}
    H::Array{T,2}
    T::Array{T,2}
    R::Array{T,2}
    Q::Array{T,2}
    a1::Array{S,1}
    P1::Array{T,2}
    P1inf::M
    Pstar::M
    jcfg::J
    hcfg::H
end

struct SSMOptimCache{T}
    v::Array{T, 1}
    vp::Array{T, 1}
    C::Array{T, 2}
    M::Array{T, 1}
    ZM::Array{T, 1}
    TM::Array{T, 1}
    K::Array{T, 1}
    KZ::Array{T, 1}
    KZp::Array{T, 1}
    L::Array{T, 1}
end

struct SSMOptimCacheDual{T}
    v::Array{T, 1}
    vp::Array{T, 1}
    C::Array{T, 2}
    M::Array{T, 1}
    ZM::Array{T, 1}
    TM::Array{T, 1}
    K::Array{T, 1}
    KZ::Array{T, 1}
    KZp::Array{T, 1}
    L::Array{T, 1}
end

struct SSMOptim{M, P, D, F} <:MathProgBase.AbstractNLPEvaluator
    m::M
    p::P
    d::D
    Y::Matrix{F}
end

struct OptimSSMScalar{T<:AbstractFloat}
    par::Array{T, 1}
    idx::BitArray{1}
    a1::T
    P1::T
    P1inf::T
    Pstar::T
    y::Array{T, 1}
end

struct Masked{FREEIDX, FIXEDIDX, FREEITR, FIXEDITR, P}
    freeindexes::FREEIDX
    fixedindexes::FIXEDIDX
    freeitr::FREEITR
    fixeditr::FIXEDITR
    parent::P
    count::Array{Int64, 1}
end

ext: jl


text:
# This file holds all the functions related to plotting simulation results.

export showPlotsFromFile,
       showFluxPlotsFromFile,
       plotSimulationResults,
       plotFluxResults,
       plotTransitionMap

"""
```
showPlotsFromFile( mpSim::ManpowerSimulation,
                   fName::String )
```
This function generates all the plots for manpower simulation `mpSim` that are
requested in the Excel file with name `fName`. If the simulation hasn't started
yet, the function will generate a warning to that effect, and will not create
the plots.

This function returns `nothing`.
"""
function showPlotsFromFile( mpSim::ManpowerSimulation, fName::String )::Void

    if now( mpSim ) == 0
        warn( "Simulation hasn't started yet. Can't create plots." )
        return
    end  # if now( mpSim ) == 0

    tmpFilename = fName * ( endswith( fName, ".xlsx" ) ? "" : ".xlsx" )

    XLSX.openxlsx( tmpFilename ) do xf
        if !XLSX.hassheet( xf, "Output plots (pop)" )
            warn( "Excel file doesn't have sheet 'Output plots'. Can't create plots." )
            return
        end  # if !hassheet( xf, "Outpot plots (pop)" )

        # Get the general info.
        plotSheet = xf[ "Output plots (pop)" ]
        showPlots = plotSheet[ "B3" ] == "YES"
        reportFileName = plotSheet[ "B4" ] == "YES" ? plotSheet[ "B5" ] : ""
        reportFileName = isa( reportFileName, Missings.Missing ) ? "" :
            reportFileName
        reportFileName = reportFileName == "" ? "" :
            joinpath( mpSim.parFileName[ 1:(end-5) ], reportFileName )

        if !showPlots && ( reportFileName == "" )
            return
        end  # if !showPlots && ...

        nPlots = plotSheet[ "B8" ]
        plotList = Dict{Tuple{Float64, Bool},
            Vector{Tuple{String, Vector{Bool}}}}()

        # Get all requested transitions and time resolutions.
        for ii in 1:nPlots
            plotFlags = Vector{Bool}( 7 )
            jj = ii + 11
            stateName = plotSheet[ "A$jj" ]
            stateName = isa( stateName, Missings.Missing ) ? "active" :
                stateName
            timeKey = ( plotSheet[ "B$jj" ], plotSheet[ "H$jj" ] == "YES" )

            if !haskey( plotList, timeKey )
                plotList[ timeKey ] = Vector{String}()
            end  # if !haskey( plotList, timeKey )

            plotFlags[ 1:4 ] = plotSheet[ "C$jj:F$jj" ] .== "YES"
            plotFlags[ 5:7 ] = plotSheet[ "I$jj:K$jj" ] .== "YES"

            push!( plotList[ timeKey ], ( stateName, plotFlags ) )
        end  # for ii in 1:nPlots

        overWrite = true
        toShow = [ "personnel", "flux in", "flux out", "net flux" ]

        if showPlots
            for timeKey in keys( plotList ), plotInfo in plotList[ timeKey ]
                stateName, plotFlags = plotInfo
                plotSimulationResults( mpSim, timeKey[ 1 ],
                    toShow[ plotFlags[ 1:4 ] ]..., state = stateName,
                    timeFactor = 12, showBreakdowns = ( plotFlags[ 5 ],
                        plotFlags[ 6 ], plotFlags[ 7 ] ) )
            end  # for timeKey in keys( plotList )
        end  # if showPlots

        if reportFileName != ""
            for timeKey in keys( plotList )
                stateList = map( plotInfo -> plotInfo[ 1 ],
                    plotList[ timeKey ] )
                generateExcelReport( mpSim, timeKey[ 1 ], stateList...,
                    fileName = reportFileName, overWrite = overWrite,
                    timeFactor = 12 )
                overWrite = false
            end  # for timeKey in keys( plotList )
        end  # if reportFileName != ""
    end  # XLSX.openxlsx( tmpFilename ) do xf

    return

end  # showPlotsFromFile( mpSim, fName )

"""
```
showFluxPlotsFromFile( mpSim::ManpowerSimulation,
                       fName::String )
```
This function generates all the flux plots for manpower simulation `mpSim` that
are requested in the tab `Output plots (trans)` of the Excel file with name
`fName`. If the simulation hasn't started yet, the function will generate a
warning to that effect, and will not create the plots.

This function returns `nothing`.
"""
function showFluxPlotsFromFile( mpSim::ManpowerSimulation,
    fileName::String )::Void

    if now( mpSim ) == 0
        warn( "Simulation hasn't started yet. Can't create plots." )
        return
    end  # if now( mpSim ) == 0

    tmpFileName = endswith( fileName, ".xlsx" ) ? fileName : fileName * ".xlsx"

    if !ispath( tmpFileName )
        warn( "'$tmpFileName' is not a valid file. Can't create flux plots." )
        return
    end  # if !ispath( tmpFilename )

    XLSX.openxlsx( tmpFileName ) do xf
        if !XLSX.hassheet( xf, "Output plots (trans)" )
            warn( "Excel file has no sheet 'Output plots (trans)'. Can't create flux plots." )
            return
        end  # if !XLSX.hassheet( xf, "Output plots (trans)" )

        # Get the general info.
        plotSheet = xf[ "Output plots (trans)" ]
        showPlots = plotSheet[ "B3" ] == "YES"
        reportFileName = plotSheet[ "B4" ] == "YES" ? plotSheet[ "B5" ] : ""
        reportFileName = isa( reportFileName, Missings.Missing ) ? "" :
            reportFileName
        reportFileName = reportFileName == "" ? "" :
            joinpath( mpSim.parFileName[ 1:(end-5) ], reportFileName )

        if !showPlots && ( reportFileName == "" )
            return
        end  # if !showPlots && ...

        nPlots = plotSheet[ "B8" ]
        plotList = Dict{Float64, Vector{Union{String, Tuple{String, String},
            Tuple{String, String, String}}}}()

        # Get all requested transitions and time resolutions.
        for ii in 1:nPlots
            jj = ii + 10
            isST = plotSheet[ "A$jj" ] == "YES"
            timeRes = Float64( plotSheet[ "E$jj" ] )

            # Add time resolution to list.
            if !haskey( plotList, timeRes )
                plotList[ timeRes ] = Vector{Union{String,
                    Tuple{String, String}, Tuple{String, String, String}}}()
            end  # if !haskey( plotList, timeRes )

            # Get source/target states.
            sourceName = plotSheet[ "C$jj" ]
            targetName = plotSheet[ "D$jj" ]
            sourceName = isa( sourceName, Missings.Missing ) ? "" :
                string( sourceName )
            targetName = isa( targetName, Missings.Missing ) ? "" :
                string( targetName )

            if isST
                push!( plotList[ timeRes ], ( sourceName, targetName ) )
            else
                transName = plotSheet[ "B$jj" ]

                if isa( transName, String )
                    if ( sourceName == "" ) && ( targetName == "" )
                        push!( plotList[ timeRes ], transName )
                    else
                        push!( plotList[ timeRes ],
                            ( transName, sourceName, targetName ) )
                    end  # if ( sourceName == "" ) &&
                end  # if isa( transName, String )
            end  # if isST
        end  # for ii in 1:nPlots

        overWrite = true

        # Make the plots.
        if showPlots
            for timeRes in keys( plotList )
                plotFluxResults( mpSim, timeRes, plotList[ timeRes ]...,
                    fileName = reportFileName, overWrite = overWrite )
                overWrite = false
            end  # for timeRes in keys( plotList )
        elseif reportFileName != ""
            for timeRes in keys( plotList )
                generateExcelFluxReport( mpSim, timeRes, plotList[ timeRes ]...,
                    fileName = reportFileName, overWrite = overWrite )
                overWrite = false
            end  # for timeRes in keys( plotList )
        end  # if showPlots
    end  # XLSX.openxlsx( tmpFileName ) do xf

    return

end  # showFluxPlotsFromFile( mpSim, fileName )

"""
```
plot( mpSim::ManpowerSimulation,
      timeRes::T1,
      toShow::String...;
      ageRes::T2 = 1,
      timeFactor::T3 = 1 )
    where T1 <: Real
    where T2 <: Real
    where T3 <: Real
```
This function plots various information of the manpower simulation `mpSim` on a
time grid with resolution `timeRes`. The series that are plotted are defined in
`toShow`. If a plot of the age distribution is requested, the used age grid has
a resolution of `ageRes`. The simulation time and ages are reduced by a factor
`timeFactor`. This is typically done if the simulation time unit is months, and
the user wishes time to be expressed in years.

This function returns `nothing`. If any plots are impossible to produce, the
function will show a warning to that effect.
"""
function Plots.plot( mpSim::ManpowerSimulation, timeRes::T1, toShow::String...;
    ageRes::T2 = 1, timeFactor::T3 = 1 ) where T1 <: Real where T2 <: Real where T3 <: Real

    # Don't generate any plots report if there's no flux out breakdown report
    #   available. This means that either the time resolution ⩽ 0 or that the
    #   simulation hasn't started yet.
    nFluxOutBreakdown = getFluxOutBreakdown( mpSim, timeRes )

    if nFluxOutBreakdown === nothing
        warn( "Since no reports can be created, no plots can be made." )
        return
    end  # if nRec === nothing

    # Don't generate plots if the time factor is ⩽ 0.
    if timeFactor <= 0
        warn( "Can't generate plots, simtime factor must be > 0." )
        return
    end  # if timeFactor <= 0

    # List which plots to generate.
    validPlots = [ "personnel", "flux in", "flux out", "net flux", "age dist",
        "age stats" ]
    tmpShow = unique( toShow )

    # Add the flux out reasons to the valid plot types if needed.
    if any( plotVar -> plotVar ∉ validPlots, tmpShow )
        validPlots = vcat( validPlots,
            collect( keys( nFluxOutBreakdown[ 2 ] ) ) )
    end  # if any( plotVar -> plotVar ∉ validPlots, tmpShow )

    filter!( plotVar -> plotVar ∈ validPlots, tmpShow )

    # If requested, make the age distribution plot first.
    if "age dist" ∈ tmpShow
        plotAgeDist( mpSim, timeRes, ageRes, timeFactor )
    end  # if "age dist" ∈ tmpShow

    # Then make the age statistics plot if requested.
    if "age stats" ∈ tmpShow
        plotAgeStats( mpSim, timeRes, timeFactor )
    end  # if "age stats" ∈ tmpShow

    # Plot the rest
    filter!( plotVar -> plotVar ∉ [ "age dist", "age stats" ], tmpShow )

    if !isempty( tmpShow )
        plotSimResults( mpSim, timeRes, timeFactor, tmpShow )
    end  # if !isempty( tmpShow )

end  # plot( mpSim, timeRes, toShow; ageRes, timeFactor )

"""
```
plotSimulationResults( mpSim::ManpowerSimulation,
                       timeRes::T1,
                       toShow::String...;
                       state::String = "active",
                       showBreakdowns::Tuple{Bool, Bool, Bool} = ( false, false, false ),
                       timeFactor::T2 = 12 )::Void
    where T1 <: Real where T2 <: Real
```
This function generates a (number of) plot(s) for the manpower simulation
`mpSim`. The time grid of the plots has resolution `timeRes`, and the plots show
the information in `toShow`. Only the values `"personnel"`, `"flux in"`,
`"flux out"`, and `"net flux"` are processed, any other values are ignored.
* The parameter `state` plots only the personnel members in the given state,
  where state `"active"`, or empty, means the entire population.
* The parameter `countBreakdownBy` indicates the attribute by which the
  (sub)population counts are broken down. If this is empty, or a non-existent
  attribute, no breakdown occurs.
* The flags in the parameter `showBreakdowns` indicate which types of breakdown
  plots are shown. The first flag is for regular line plots, the second for
  stacked area plots, the third for stacked percentage area plots.
* The parameter `timeFactor` indicates the factor by which the time axis is
  compressed. This is useful if for example the simulation time unit is months,
  but the visualization should be with the time axis in years (use default
  factor 12 in this case).

This function returns `nothing`. The function will generate the general line
plot of the requested information, and then all requested breakdown plots.
Remark that the percentage plots show a total of 0 at the times the investigated
(sub)population is empty [similar to Excel].
"""
function plotSimulationResults( mpSim::ManpowerSimulation, timeRes::T1,
    toShow::String...; state::String = "active",
    showBreakdowns::Tuple{Bool, Bool, Bool} = ( false, false, false ),
    timeFactor::T2 = 12 )::Void where T1 <: Real where T2 <: Real

    # Make a list of all the requested plots.
    validPlots = [ "personnel", "flux in", "flux out", "net flux" ]
    tmpShow = unique( toShow )
    filter!( plotVar -> plotVar ∈ validPlots, tmpShow )

    if isempty( tmpShow )
        return
    end  # if isempty( tmpShow )

    # Generate the reports for the requested state.
    fluxInCounts = generateFluxReport( mpSim, timeRes, true, state )
    fluxOutCounts = generateFluxReport( mpSim, timeRes, false, state )
    personnelCounts = generateCountReport( mpSim, state, fluxInCounts,
        fluxOutCounts )
    timeGrid = personnelCounts[ 1 ] ./ timeFactor

    # Make a plot of the totals.
    plotSimResults( state, timeGrid, Vector{Int}( personnelCounts[ 2 ] ),
        Vector{Int}( fluxInCounts[ end ] ), Vector{Int}( fluxOutCounts[ end ] ),
        tmpShow )

    if !any( showBreakdowns )
        return
    end  # if !any( showBreakdowns )

    # Plot the flux breakdown plots.
    plotTypes = [ :normal, :stacked, :percentage ]
    isUsed = map(  ii -> showBreakdowns[ ii ], 1:3 )

    # Make a plot of the breakdown of the fluxes.
    for plotStyle in plotTypes[ isUsed ]
        # if ( "personnel" ∈ tmpShow ) && ( length( personnelCounts ) == 4 )
        #     plotBreakdown( state, timeGrid, personnelCounts[ 2 ],
        #         personnelCounts[ 4 ], personnelCounts[ 3 ], :pers, plotStyle )
        # end  # if ( "personnel" ∈ tmpShow ) && ...

        if "flux in" ∈ tmpShow
            plotBreakdown( state, fluxInCounts, :in, plotStyle,
                Float64( timeFactor ) )
        end  # if "flux in" ∈ tmpShow

        if "flux out" ∈ tmpShow
            plotBreakdown( state, fluxOutCounts, :out, plotStyle,
                Float64( timeFactor ) )
        end  # if "flux out" ∈ tmpShow
    end  # for plotStyle in plotTypes[ isUsed ]

    return

end  # plotSimulationResults( mpSim, timeRes, toShow...; state,
     #   countBreakdownBy, isBreakdown, breakdownPlotStyle,
     #   timeFactor )

"""
```
plotFluxResults( mpSim::ManpowerSimulation,
                 timeRes::T1,
                 transList::Union{String, Tuple{String, String}, Tuple{String, String, String}}...;
                 fileName::String = "",
                 overWrite = true,
                 timeFactor::T2 = 12.0 )
    where T1 <: Real where T2 <: Real
```
This function creates a report on fluxes in the manpower simulation `mpSim` on a
grid with time resolution `timeRes`, showing all the transitions
(transition types) listed in `transList`. These transitions can be entered by
transition name (as `String`), as source/target state pairs (as
`Union{String, Tuple{String, String}}`), or as transition/source/target tuples.
Non existing transitions are ignored, names of recruitment schemes are accepted,
the outflows `retirement`, `attrition`, and `fired` are accepted, and the empty
state or state `external` is accepted to describe in and out transitions. The
results are then plotted in separate plots. If the parameter `fileName` is not
blank, the results are then saved in the Excel file with that name, with the
extension `".xlsx"` added if necessary. If the flag `overWrite` is `true`, a new
Excel file is created. Otherwise, the report is added to the Excel file. Times
are compressed by a factor `timeFactor`.

This function returns `nothing`.
"""
function plotFluxResults( mpSim::ManpowerSimulation, timeRes::T1,
    transList::Union{String, Tuple{String, String},
        Tuple{String, String, String}}...;
    fileName::String = "", overWrite = true, timeFactor::T2 = 12.0 ) where T1 <: Real where T2 <: Real

    # Issue warning if time resolution is negative.
    if timeRes <= 0
        warn( "Negative time resolution for grid. Resolution must be > 0.0" )
        return
    end

    # Issue warning when trying to generate report of a simultation that hasn't
    #   started.
    if now( mpSim ) == 0
        warn( "Simulation hasn't started yet. Cannot generate report." )
        return
    end  # if now( mpSim ) == 0

    # Issue warninig when trying to apply a negative time compression factor.
    if timeFactor <= 0.0
        warn( "Time compression factor must be greater than 0. Cannot generate report." )
        return
    end  # if timeFactor <= 0.0

    tStart = now()

    # Generate the data.
    fluxData = generateFluxReport( mpSim, timeRes, transList... )
    fluxData[ 1 ] /= timeFactor
    fluxData[ 2 ] /= timeFactor
    tNames = string.( names( fluxData )[ 3:end ] )
    tNodes = fluxData[ 2 ]

    for ii in eachindex( tNames )
        yMax = max( maximum( fluxData[ ii + 2 ] ), 1 )
        plotTitle = "Flux plot of transition '$(tNames[ ii ])' per interval of " *
            string( timeRes / timeFactor )
        gui( Plots.plot( tNodes, fluxData[ ii + 2 ], size = ( 960, 540 ),
            lw = 2, ylim = [ 0, yMax ], title = plotTitle, legend = false ) )
    end  # for ii in eachindex( tNames )

    tElapsed = ( now() - tStart ).value / 1000.0

    println( "Plots for time resolution $(timeRes / timeFactor) generated. ",
        "Elapsed time: $tElapsed seconds." )

    # Write Excel report if desired.
    if fileName != ""
        tmpFileName = endswith( fileName, ".xlsx" ) ? fileName :
            fileName * ".xlsx"
        tmpFileName = joinpath( mpSim.parFileName[ 1:(end-5) ], tmpFileName )
        dumpFluxData( mpSim, fluxData, timeRes, tmpFileName, overWrite,
            timeFactor, tElapsed )
    end  # if fileName != ""

    return

end  # plotFluxResults( mpSim, timeRes, transList, fileName, overWrite,
     #   timeFactor )

"""
```
plotTransitionMap( mpSim::ManpowerSimulation,
                   states::String...;
                   fileName::String = "" )
```
This function returns `nothing`.
"""
function plotTransitionMap( mpSim::ManpowerSimulation, states::String...;
    fileName::String = "" )::Void

    graph, inNodeIndex, outNodeIndex = buildTransitionNetwork( mpSim,
        states... )
    display( gplot( graph,
        nodelabel = map( node -> get_prop( graph, node, :state ),
        vertices( graph ) ),
        edgelabel = map( edge -> get_prop( graph, edge, :trans ),
        edges( graph ) ) ) )

    # XXX Add code to save to GraphML.
    if fileName == ""
        return
    end  # if fileName == ""

    # Save the structure of the network.
    tmpFileName = joinpath( mpSim.parFileName[ 1:(end-5) ], fileName )
    savegraph( tmpFileName, graph, GraphMLFormat(); compress = false )

    # Grab it for editing.
    xmlGraph = readxml( tmpFileName )
    graphRoot = root( xmlGraph )  # on Julia 0.6

    # Set link to yEd elements.
    graphRoot[ "xmlns:y" ] = "http://www.yworks.com/xml/graphml"
    # graphRoot = xmlGraph.root  # on Julia 0.7+

    # Add required keys for processing.
    key = ElementNode( "key" )
    key[ "for" ] = "node"
    key[ "id" ] = "d6"
    key[ "yfiles.type" ] = "nodegraphics"
    link!( graphRoot, key )
    key = ElementNode( "key" )
    key[ "for" ] = "edge"
    key[ "id" ] = "d10"
    key[ "yfiles.type" ] = "edgegraphics"
    link!( graphRoot, key )

    # Grab the contents of the graph.
    graphDef = elements( graphRoot )[ 1 ]
    graphElements = elements( graphDef )
    nElements = length( graphElements )
    nNodes = 0
    nEdges = 0
    nodeList = collect( vertices( graph ) )
    edgeList = collect( edges( graph ) )

    for ii in 1:nElements
        elementData = ElementNode( "data" )
        isNode = nodename( graphElements[ ii ] ) == "node"
        nNodes += isNode ? 1 : 0
        nEdges += isNode ? 0 : 1
        elementData[ "key" ] = isNode ? "d6" : "d10"
        elementForm = ElementNode( "y:" *
            ( isNode ? "ShapeNode" : "PolyEdgeLine" ) )
        elementLabelText = isNode ?
            get_prop( graph, nodeList[ nNodes ], :state ) :
            get_prop( graph, edgeList[ nEdges ], :trans )
        elementLabel = ElementNode( "y:" * ( isNode ? "Node" : "Edge" ) *
            "Label" )
        setnodecontent!( elementLabel, elementLabelText )
        elementShape = ElementNode( "y:" * ( isNode ? "Shape" : "Arrows" ) )

        if isNode
            elementShape[ "type" ] = elementLabelText ∈ states ? "ellipse" :
                "roundrectangle"
            elementGeometry = ElementNode( "y:Geometry" )
            elementGeometry[ "height" ] = nodeList[ nNodes ] ∈ [ inNodeIndex,
                outNodeIndex ] ? 80.0 : 40.0
            elementGeometry[ "width" ] = elementGeometry[ "height" ]
            link!( elementForm, elementGeometry )
        else
            elementShape[ "source" ] = "none"
            elementShape[ "target" ] = "standard"
        end  # if isNode

        link!( elementForm, elementLabel )
        link!( elementForm, elementShape )
        link!( elementData, elementForm )
        link!( graphElements[ ii ], elementData )
    end  # for ii in 1:nElements

    write( tmpFileName, xmlGraph )

    return

end  # plotTransitionMap( mpSim, states, fileName )

"""
```
plotTransitionMap( mpSim::ManpowerSimulation,
                   fileName::String )
```
This function plots a transition map of the manpower simulation `mpSim` with the
nodes requested in the Excel sheet `State Map` of the file with name `fileName`.
If the file name doesn't end in `.xlsx`, it will be added automatically.

This function returns `nothing`.
"""
function plotTransitionMap( mpSim::ManpowerSimulation, fileName::String )::Void

    tmpFileName = endswith( fileName, ".xlsx" ) ? fileName : fileName * ".xlsx"

    if !ispath( tmpFileName )
        warn( "'$tmpFileName' is not a valid file. Can't create network plot." )
        return
    end  # if !ispath( tmpFileName )

    XLSX.openxlsx( tmpFileName ) do xf
        # Check if file has the proper sheet.
        if !XLSX.hassheet( xf, "State Map" )
            warn( "File does not have a sheet 'State Map'. Can't create network plot." )
            return
        end  # if XLSX.hassheet( xf, "State Map" )

        plotTransitionMap( mpSim, xf[ "State Map"] )
    end  # XLSX.openxlsx( tmpFileName ) do xf

    return

end  # plotTransitionMap( mpSim::ManpowerSimulation, fileName::String )

"""
```
plotTransitionMap( mpSim::ManpowerSimulation,
                   sheet::XLSX.Worksheet )
```
This function plots a transition map of the manpower simulation `mpSim` with the
nodes requested in the Excel sheet `sheet`.

This function returns `nothing`.
"""
function plotTransitionMap( mpSim::ManpowerSimulation,
    sheet::XLSX.Worksheet )::Void

    fileName = sheet[ "B4" ]
    fileName = isa( fileName, Void ) ? "" : fileName * ".graphml"
    numNodes = Int( sheet[ "B7" ] )
    nodeList = Vector{String}()

    for ii in 1:numNodes
        push!( nodeList, sheet[ "B$(8 + ii)" ] )
    end  # for ii in 1:numNodes

    if !isempty( nodeList )
        plotTransitionMap( mpSim, nodeList...; fileName = fileName )
    end  # if !isempty( nodeList )

    return

end  # plotTransitionMap( mpSim, sheet )

# ==============================================================================
# Non-exported methods.
# ==============================================================================

function readPlotInfoFromFile( mpSim::ManpowerSimulation, sheet::XLSX.Worksheet,
    colNum::Int, state::String )::Void

    toShow = [ "personnel", "flux in", "flux out", "net flux" ]
    plotRes = sheet[ XLSX.CellRef( 6, colNum ) ]
    tmpToShow = [ sheet[ XLSX.CellRef( 7, colNum ) ] == "YES",
        sheet[ XLSX.CellRef( 8, colNum ) ] == "YES",
        sheet[ XLSX.CellRef( 9, colNum ) ] == "YES",
        sheet[ XLSX.CellRef( 10, colNum ) ] == "YES" ]
    plotSimulationResults( mpSim, plotRes, toShow[ tmpToShow ]...;
        state = state, timeFactor = 12,
        showBreakdowns = ( sheet[ XLSX.CellRef( 13, colNum ) ] == "YES",
            sheet[ XLSX.CellRef( 14, colNum ) ] == "YES",
            sheet[ XLSX.CellRef( 15, colNum ) ] == "YES" ) )
    return

end  # readPlotInfoFromFile( mpSim, sheet, colNum, state )

"""
```
plotAgeDist( mpSim::ManpowerSimulation,
             timeRes::T1,
             ageRes::T2,
             timeFactor::T3 )
    where T1 <: Real
    where T2 <: Real
    where T3 <: Real
```
This function plots the age distribution of the active personnel in the manpower
simulation `mpSim` on a time grid with resolution `timeRes` and an age grid with
resolution `ageRes`. The simulation time and ages are reduced by a factor
`timeFactor`. This is typically done if the simulation time unit is months, and
the user wishes time to be expressed in years.

This function returns `nothing`. If the age distribution report can't be
retrieved for whatever reason, the function issues warnings to that effect.
"""
function plotAgeDist( mpSim::ManpowerSimulation, timeRes::T1, ageRes::T2,
    timeFactor::T3 ) where T1 <: Real where T2 <: Real where T3 <: Real

    ageDist = getAgeDistributionReport( mpSim, timeRes, ageRes )

    # Don't do anything if there's no age distribution report.
    if ageDist === nothing
        warn( "Since no age distribution report can be created, no plot can be made." )
        return
    end  # if ageDist === nothing

    gui( surface( ageDist[ 2 ] / timeFactor, ageDist[ 1 ] / timeFactor,
        ageDist[ 3 ], size = ( 960, 540 ), xlabel = "Age",
        ylabel = "Simulation time", zlabel = "Personnel" ) )

end  # plotAgeDist( mpSim, timeRes, ageRes, timeComp )

"""
```
plotAgeStats( mpSim::ManpowerSimulation,
              timeRes::T1,
              timeFactor::T2 )
    where T1 <: Real
    where T2 <: Real
```
This function plots basic statistics of the age distribution of active personnel
members in the manpower simulation `mpSim` on a time grid with resolution
`timeRes`. The simulation time and ages are reduced by a factor `timeFactor`.
This is typically done if the simulation time unit is months, and the user
wishes time to be expressed in years. The following statistics are plotted: mean
age (blue), median age (red), minimum/maximum ages (black).

This function returns `nothing`.
"""
function plotAgeStats( mpSim::ManpowerSimulation, timeRes::T1, timeFactor::T2 ) where T1 <: Real where T2 <: Real

    ageStats = getAgeStatsReport( mpSim, timeRes )
    timeSteps = ageStats[ 1 ] / timeFactor
    ageStats = ageStats[ 2 ] / timeFactor
    minAge = minimum( ageStats[ :, 4 ] )
    maxAge = maximum( ageStats[ :, 5 ] )

    plt = Plots.plot( timeSteps, ageStats[ :, 1 ], size = ( 960, 540 ),
        xlabel = "Simulation time", ylabel = "Age", label = "Mean age", lw = 2,
        color = :blue,
        ylim = [ minAge, maxAge ] + 0.01 * ( maxAge - minAge ) * [ -1, 1 ] )
    plt = plot!( timeSteps, ageStats[ :, 3 ], label = "Median age", lw = 2,
        color = :red )
    plt = plot!( timeSteps, ageStats[ :, 4 ], label = "", color = :black )
    plt = plot!( timeSteps, ageStats[ :, 5 ], label = "", color = :black )
    gui( plt )

end  # plotAgeStats( mpSim, timeRes, timeComp )

"""
```
plotSimResults( mpSim::ManpowerSimulation,
                timeRes::T1,
                timeFactor::T2,
                toShow::Vector{String} )
    where T1 <: Real
    where T2 <: Real
```
This function generates a plot of the results of the manpower simulation `mpSim`
on a time grid with resolution `timeRes`. The simulation time is reduced by a
factor `timeFactor`. This is typically done if the simulation time unit is
months, and the user wishes time to be expressed in years. The function plots
the series in `toShow`.

The function returns `nothing`.
"""
function plotSimResults( mpSim::ManpowerSimulation, timeRes::T1, timeFactor::T2,
    toShow::Vector{String} ) where T1 <: Real where T2 <: Real

    yMin = 0
    yMax = mpSim.personnelTarget

    # Retrieve all the information.
    nPers = getCountReport( mpSim, timeRes )
    timeSteps = nPers[ 1 ] / timeFactor
    nPers = nPers[ 2 ]
    nFluxIn = getFluxInReport( mpSim, timeRes )[ 2 ]
    nFluxOut = getFluxOutReport( mpSim, timeRes )[ 2 ]
    netFlux = nFluxIn - nFluxOut
    nFluxOutBreakdown = getFluxOutBreakdown( mpSim, timeRes )[ 2 ]

    # Adjust the minimum if a graph of the net flux is requested.
    if "net flux" ∈ toShow
        yMin = min( 0, minimum( netFlux ) )
    end  # if "net flux" ∈ toShow

    # Adjust the maximum if a graph of the personnel count is not requested.
    if "personnel" ∉ toShow
        yMax = max( maximum( nFluxIn ), maximum( nFluxOut ) )
    else
        yMax = maximum( nPers )
    end  # if "personnel" ∉ toShow

    # These need to be initialised, otherwise there will be issues with knowing
    #   the values of these variables.
    yCoords = nothing
    plt = nothing

    for ii in eachindex( toShow )
        # Retrieve the X-coorrdinates of the graph points.
        tmpTimes = timeSteps

        if toShow[ ii ] != "personnel"
            tmpTimes = timeSteps[ 2:end ]
        end  # if toShow[ ii ] != "personnel"

        # Retrieve the Y-coordinates of the graph points.
        if toShow[ ii ] == "personnel"
            yCoords = nPers
        elseif toShow[ ii ] == "flux in"
            yCoords = nFluxIn
        elseif toShow[ ii ] == "flux out"
            yCoords = nFluxOut
        elseif toShow[ ii ] == "net flux"
            yCoords = netFlux
        else
            yCoords = nFluxOutBreakdown[ toShow[ ii ] ]
        end  # if toShow[ ii ] == "personnel"

        # Plot the requested series.
        if ii == 1
            plt = Plots.plot( tmpTimes, yCoords, label = toShow[ ii ], lw = 2,
                size = ( 960, 540 ), xlim = [ 0, timeSteps[ end ] ],
                ylim = [ yMin, yMax ] + 0.01 * ( yMax - yMin ) * [ -1, 1 ],
                title = "Evolution of whole population with resolution $(timeRes / timeFactor)" )
        else
            plt = plot!( tmpTimes, yCoords, label = toShow[ ii ], lw = 2 )
        end  # if ii == 1
    end  # for ii in eachindex( toShow )

    gui( plt )

end  # plotSimResults( mpSim, timeRes, timeComp, toShow... )

function plotSimResults( state::String, timeGrid::Vector{Float64},
    personnelCounts::Vector{Int}, fluxInCounts::Vector{Int},
    fluxOutCounts::Vector{Int}, toShow::Vector{String} )::Void

    yMin = 0.0
    counts = hcat( personnelCounts, fluxInCounts, fluxOutCounts )
    counts = hcat( counts, counts[ :, 2 ] - counts[ :, 3 ] )

    if "net flux" ∈ toShow
        yMin = minimum( counts[ 2:end, 4 ] )
    end  # if "net flux" ∈ validPlots

    yMax = maximum( counts[ :, 1 ] )

    if "personnel" ∉ toShow
        yMax = maximum( counts[ 2:end, 2:4 ] )
    end  # if "personnel" ∉ toShow

    plt = Plots.plot( xlim = [ 0, maximum( timeGrid ) * 1.01 ],
        ylim = [ yMin, yMax ] + 0.025 * ( yMax - yMin ) * [ -1, 1 ],
        xlabel = "Sim time in y", size = ( 960, 540 ),
        title = "Evolution of personnel" *
            ( state == "active" ? "" : " in state '$state'" ) *
            " with resolution $(timeGrid[ 2 ] - timeGrid[ 1 ])" )
    validPlots = [ "personnel", "flux in", "flux out", "net flux" ]

    for ii in eachindex( validPlots )
        if validPlots[ ii ] ∈ toShow
            plt = plot!( timeGrid, counts[ :, ii ], lw = 2,
                label = ii == 1 ? state : validPlots[ ii ] )
        end  # if validPlots[ ii ] ∈ toShow
    end  # for ii in eachindex( validPlots )

    gui( plt )
    return

end  # plotSimResults( state, timeGrid, personnelCounts, fluxInCounts,
     #   fluxOutCounts, toShow )

function plotBreakdown( state::String, counts::DataFrames.DataFrame,
    countType::Symbol, plotStyle::Symbol, timeFactor::Float64 )::Void

    if plotStyle === :normal
        plotBreakdownNormal( state, counts, countType, timeFactor )
    else
        plotBreakdownStacked( state, counts, countType,
            plotStyle === :percentage, timeFactor )
    end  # if plotStyle === :normal

end  # plotBreakdown( state, counts, countType, plotStyle, timeFactor )

function plotBreakdownNormal( state::String, counts::DataFrames.DataFrame,
    countType::Symbol, timeFactor::Float64 )::Void

    yMax = maximum( counts[ end ] )
    isFlux = countType !== :pers
    timeGrid = ( isFlux ? counts[ 2 ] : counts[ 1 ] ) ./ timeFactor

    # Create graph title.
    title = "Breakdown of "
    title *= countType === :pers ? "personnel counts" :
        ( countType === :in ? "in" : "out" ) * " flux"
    title *= " of "
    title *= state == "active" ? "total population" : "state '$state'"
    title *= " with resolution $(timeGrid[ 2 ] - timeGrid[ 1 ])"

    # Create graph labels.
    labels = string.( names( counts )[ ( isFlux ? 3 : 2 ):(end - 1) ] )

    if isFlux
        map!( label -> split( label, countType === :in ? " to " :
            " from ")[ 1 ], labels, labels )
    end  # if isFlux

    plt = Plots.plot( timeGrid, counts[ end ], lw = 3, label = "Total " *
        ( countType === :pers ? "count" :
        ( countType === :in ? "in" : "out" ) * " flux" ),
        xlim = [ 0, maximum( timeGrid ) * 1.01 ],
        ylim = [ 0, yMax ] + 0.025 * yMax * [ -1, 1 ],
        xlabel = "Sim time in y", size = ( 960, 540 ), title = title  )

    for ii in eachindex( labels )
        jj = ii + ( isFlux ? 2 : 1 )
        plt = plot!( timeGrid, counts[ jj ], lw = 2, label = labels[ ii ] )
    end  # for ii in eachindex( fluxLabels )

    gui( plt )
    return

end  # plotBreakdownNormal( state, counts, countType, timeFactor )

function plotBreakdownStacked( state::String, counts::DataFrames.DataFrame,
    countType::Symbol, isPercent::Bool, timeFactor::Float64 )::Void

    yMax = maximum( counts[ end ] )
    isFlux = countType !== :pers
    timeGrid = ( isFlux ? counts[ 2 ] : counts[ 1 ] ) ./ timeFactor

    # Retrieve cumulative sums to build plots.
    tmpCounts = cumsum( Array( counts[ ( isFlux ? 3 : 2 ):(end-1) ] ), 2 )

    if isPercent
        foreach( ii -> tmpCounts[ ii, : ] /= counts[ ii, end ] / 100.0,
            eachindex( timeGrid ) )
        yMax = 100.0
    end  # if isPercent

    plt = Plots.plot( xlim = [ 0, maximum( timeGrid ) * 1.01 ],
        ylim = [ 0.0, yMax ] + 0.025 * yMax * [ -1, 1 ],
        xlabel = "Sim time in y", size = ( 960, 540 ),
        title = ( countType === :pers ? "Personnel " :
            ( countType === :in ? "In" : "Out" ) * " flux " ) *
            ( isPercent ? "percentage " : "" ) * "breakdown of " *
            ( state == "active" ? "total population" : "state '$state'" ) *
            " with resolution $(timeGrid[ 2 ] - timeGrid[ 1 ])" )

    # For the percentage counts, set all undefined entries to 0 (Excel-like
    #   behaviour for stacked percentage plots if the total is 0).
    tmpCounts[ isnan.( tmpCounts ) ] = 0

    # Create graph labels.
    labels = string.( names( counts )[ ( isFlux ? 3 : 2 ):(end-1) ] )

    if isFlux
        map!( label -> split( label, countType === :in ? " to " :
            " from ")[ 1 ], labels, labels )
    end  # if isFlux

    for ii in length( labels ):-1:1
        plt = plot!( timeGrid, tmpCounts[ :, ii ], lw = 2, fillalpha = 0.5,
            linealpha = 1.0, label = labels[ ii ],
            fillrange = ii == 1 ? 0 : tmpCounts[ :, ii - 1 ] )
    end  # for ii in length( labels ):-1:1

    gui( plt )
    return

end  # plotBreakdownStacked( state, counts, countType, isPercent, timeFactor )


text:
precompile(Tuple{typeof(Base.atreplinit), Function})
precompile(Tuple{typeof(REPL.Terminals.hascolor), REPL.Terminals.TTYTerminal})
precompile(Tuple{getfield(Main, Symbol("#3#4")), REPL.LineEditREPL})
precompile(Tuple{typeof(MacroTools.__init__)})
precompile(Tuple{typeof(Base.nextpow), Int64, Int64})
precompile(Tuple{typeof(Random.shuffle!), Random.MersenneTwister, Array{Symbol, 1}})
precompile(Tuple{typeof(Parsers.__init__)})
precompile(Tuple{typeof(Base.GMP.MPZ.set), Base.GMP.BigInt})
precompile(Tuple{typeof(Base.deepcopy), Base.GMP.BigInt})
precompile(Tuple{typeof(Base.Threads.resize_nthreads!), Array{Base.GMP.BigInt, 1}, Base.GMP.BigInt})
precompile(Tuple{typeof(Base.foreach), getfield(Parsers, Symbol("#25#30")), Array{Base.GMP.BigInt, 1}})
precompile(Tuple{typeof(Base.foreach), getfield(Parsers, Symbol("#26#31")), Array{Base.GMP.BigInt, 1}})
precompile(Tuple{typeof(Base.foreach), getfield(Parsers, Symbol("#27#32")), Array{Base.GMP.BigInt, 1}})
precompile(Tuple{typeof(Base.foreach), getfield(Parsers, Symbol("#28#33")), Array{Base.GMP.BigInt, 1}})
precompile(Tuple{typeof(Base.foreach), getfield(Parsers, Symbol("#29#34")), Array{Base.GMP.BigInt, 1}})
precompile(Tuple{typeof(PyCall.pythonenv), Base.Cmd})
precompile(Tuple{typeof(PyCall.find_libpython), String})
precompile(Tuple{typeof(PyCall._preserveas!), Array{UInt8, 1}, Type{Base.Cstring}, String})
precompile(Tuple{getfield(Base, Symbol("#thrownonint#205")){Int32, UInt8}, Type{Int32}, Type{UInt8}, Int64})
precompile(Tuple{typeof(Base.unalias), Array{UInt8, 1}, Base.ReinterpretArray{UInt8, 1, Int32, Array{Int32, 1}}})
precompile(Tuple{typeof(Base.throw_boundserror), Base.ReinterpretArray{UInt8, 1, Int32, Array{Int32, 1}}, Tuple{Int64}})
precompile(Tuple{typeof(Base.copyto!), Array{UInt8, 1}, Base.ReinterpretArray{UInt8, 1, Int32, Array{Int32, 1}}})
precompile(Tuple{typeof(PyCall._preserveas!), Array{UInt8, 1}, Type{Base.Cwstring}, String})
precompile(Tuple{typeof(PyCall.Py_SetProgramName), Nothing, Base.VersionNumber, String})
precompile(Tuple{typeof(PyCall._pyimport), String})
precompile(Tuple{Type{PyCall.PyError}, String})
precompile(Tuple{typeof(PyCall.pyimport), String})
precompile(Tuple{typeof(PyCall.pydecref_), PyCall.PyObject})
precompile(Tuple{typeof(Base.getproperty), PyCall.PyObject, String})
precompile(Tuple{typeof(PyCall.pyexc_initialize)})
precompile(Tuple{typeof(PyCall._handle_error), String})
precompile(Tuple{typeof(PyCall.pyjlwrap_dealloc), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.pyjlwrap_repr), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(Base.hash), PyCall.PyObject})
precompile(Tuple{typeof(PyCall.pyjlwrap_hash), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.pyjlwrap_hash32), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(Base.convert), Type{String}, PyCall.PyObject})
precompile(Tuple{Type{PyCall.PyObject}, Nothing})
precompile(Tuple{typeof(PyCall.pyjlwrap_getattr), Ptr{PyCall.PyObject_struct}, Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.pyjlwrap_getiter), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.PyTypeObject!), getfield(PyCall, Symbol("#129#130")){Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}, Ptr{Nothing}}, PyCall.PyTypeObject, String, Int64})
precompile(Tuple{typeof(PyCall.pyjlwrap_init)})
precompile(Tuple{typeof(PyCall.pyhasproperty), PyCall.PyObject, String})
precompile(Tuple{typeof(PyCall._setproperty!), PyCall.PyObject, String, String})
precompile(Tuple{typeof(PyCall._set_finalized)})
precompile(Tuple{typeof(PyCall.Py_SetProgramName), Ptr{Nothing}, Base.VersionNumber, String})
precompile(Tuple{typeof(PyCall.__init__)})
precompile(Tuple{typeof(Base.empty!), Base.Dict{Module, PyCall.PyDict{String, PyCall.PyObject, true}}})
precompile(Tuple{typeof(Base.empty!), Base.Dict{Symbol, Base.Timer}})
precompile(Tuple{typeof(Base.empty!), Base.Dict{Symbol, Ptr{Nothing}}})
precompile(Tuple{typeof(Base.empty!), Base.Dict{Ptr{PyCall.PyObject_struct}, Any}})
precompile(Tuple{typeof(Base.empty!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}})
precompile(Tuple{typeof(PyCall.Py_SetPythonHome), Ptr{Nothing}, Base.VersionNumber, String})
precompile(Tuple{typeof(Base.filter!), getfield(Base, Symbol("#66#67")){typeof(Base.isempty)}, Array{Base.SubString{String}, 1}})
precompile(Tuple{typeof(Base.setindex!), Array{Base.SubString{String}, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{Base.SubString{String}, 1}, Int64, Base.Generator{Array{Base.SubString{String}, 1}, typeof(VersionParsing.digits2num)}, Int64})
precompile(Tuple{typeof(Base.copyto!), Array{Any, 1}, Int64, Array{Int64, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.collect_to!), Array{Int64, 1}, Base.Generator{Array{Base.SubString{String}, 1}, typeof(VersionParsing.digits2num)}, Int64, Int64})
precompile(Tuple{typeof(Base.copyto!), Array{Any, 1}, Int64, Array{Base.SubString{String}, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.copyto!), Array{Base.SubString{String}, 1}, Int64, Array{Base.SubString{String}, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.collect_to!), Array{Base.SubString{String}, 1}, Base.Generator{Array{Base.SubString{String}, 1}, typeof(VersionParsing.digits2num)}, Int64, Int64})
precompile(Tuple{typeof(Base.setindex!), Array{Int64, 1}, Base.SubString{String}, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{Int64, 1}, Base.SubString{String}, Base.Generator{Array{Base.SubString{String}, 1}, typeof(VersionParsing.digits2num)}, Int64})
precompile(Tuple{typeof(Base._collect), Array{Base.SubString{String}, 1}, Base.Generator{Array{Base.SubString{String}, 1}, typeof(VersionParsing.digits2num)}, Base.EltypeUnknown, Base.HasShape{1}})
precompile(Tuple{typeof(VersionParsing.vparse), String})
precompile(Tuple{typeof(Base.getindex), Base.RefValue{Bool}})
precompile(Tuple{typeof(PyCall.typetuple), Base.Generator{Base.UnitRange{Int64}, getfield(PyCall, Symbol("#36#37")){PyCall.PyObject}}})
precompile(Tuple{typeof(PyCall.array_format), PyCall.PyBuffer})
precompile(Tuple{typeof(PyCall.pysequence_query), PyCall.PyObject})
precompile(Tuple{typeof(PyCall.pytype_query), PyCall.PyObject, Type{PyCall.PyObject}})
precompile(Tuple{typeof(Base.convert), Type{PyCall.PyAny}, PyCall.PyObject})
precompile(Tuple{typeof(PyCall.pyptr_query), PyCall.PyObject})
precompile(Tuple{typeof(Base.getindex), Base.RefValue{Ptr{PyCall.PyObject_struct}}})
precompile(Tuple{typeof(PyCall.pyisinstance), PyCall.PyObject, Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.pynothing_query), PyCall.PyObject})
precompile(Tuple{typeof(Base.convert), Type{PyCall.PyObject}, PyCall.PyObject})
precompile(Tuple{typeof(Base.rehash!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Int64})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{Exception}})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Type{T} where T})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{ErrorException}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{Base.SystemError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{TypeError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{Base.Meta.ParseError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{ArgumentError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{Base.KeyError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{LoadError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{MethodError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{Base.EOFError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{BoundsError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{DivideError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{DomainError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{OverflowError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{InexactError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{OutOfMemoryError}})
precompile(Tuple{typeof(PyCall.pydecref), PyCall.PyBuffer})
precompile(Tuple{typeof(PyCall.pydecref), PyCall.PyObject})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{StackOverflowError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{UndefRefError}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{InterruptException}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{DataType, Ptr{PyCall.PyObject_struct}}, Ptr{PyCall.PyObject_struct}, Type{PyCall.PyIOError}})
precompile(Tuple{typeof(Base._append!), Array{PyCall.PyMemberDef, 1}, Base.HasLength, Tuple{PyCall.PyMemberDef, PyCall.PyMemberDef}})
precompile(Tuple{typeof(PyCall.pyeval_), String, PyCall.PyDict{String, PyCall.PyObject, true}, PyCall.PyDict{String, PyCall.PyObject, true}, Int64, String})
precompile(Tuple{typeof(PyCall.pyeval_), String})
precompile(Tuple{typeof(Base.rehash!), Base.Dict{Module, PyCall.PyDict{String, PyCall.PyObject, true}}, Int64})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Module, PyCall.PyDict{String, PyCall.PyObject, true}}, Module})
precompile(Tuple{typeof(Base.setindex!), PyCall.PyDict{String, PyCall.PyObject, true}, PyCall.PyObject, String})
precompile(Tuple{getfield(PyCall, Symbol("#118#119")){Module}})
precompile(Tuple{typeof(Base.get!), getfield(PyCall, Symbol("#118#119")){Module}, Base.Dict{Module, PyCall.PyDict{String, PyCall.PyObject, true}}, Module})
precompile(Tuple{typeof(CompilerSupportLibraries_jll.__init__)})
precompile(Tuple{typeof(Base.stat), Base.Libc.RawFD})
precompile(Tuple{typeof(Base.read), Base.IOStream})
precompile(Tuple{getfield(Base, Symbol("##open#270")), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.open), getfield(Base, Symbol("#277#278")){Tuple{}}, String})
precompile(Tuple{typeof(Base.:(^)), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{typeof(Base.:(^)), String, PyCall.PyObject})
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(Base.print_to_string), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(Base.convert), Type{AbstractString}, PyCall.PyObject})
precompile(Tuple{typeof(PyCall.pystring), PyCall.PyObject})
precompile(Tuple{typeof(Base.print), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, PyCall.PyObject})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int64})
precompile(Tuple{typeof(Base.isequal), PyCall.PyObject, Symbol})
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Any, Int64}, Symbol})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##load_overrides#3")), Bool, typeof(Pkg.Artifacts.load_overrides)})
precompile(Tuple{typeof(Pkg.Artifacts.process_overrides), Base.Dict{String, Any}, Base.UUID})
precompile(Tuple{typeof(Pkg.Artifacts.do_artifact_str), String, Base.Dict{String, Any}, String, Module})
precompile(Tuple{typeof(Base.getindex), Base.Dict{Symbol, Base.Dict{K, V} where V where K}, Symbol})
precompile(Tuple{typeof(Base.haskey), Base.Dict{Base.UUID, Base.Dict{String, Union{Base.SHA1, String}}}, Base.UUID})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##artifact_meta#20")), Pkg.BinaryPlatforms.Platform, typeof(Pkg.Artifacts.artifact_meta), String, Base.Dict{String, Any}, String})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("#artifact_meta##kw")), NamedTuple{(:platform,), Tuple{Pkg.BinaryPlatforms.Linux}}, typeof(Pkg.Artifacts.artifact_meta), String, Base.Dict{String, Any}, String})
precompile(Tuple{typeof(Base.allocatedinline), Type{PyCall.PyTypeObject}})
precompile(Tuple{typeof(Pkg.Artifacts.unpack_platform), Base.Dict{String, Any}, String, String})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("#21#22")){String, String}, Base.Dict{String, Any}})
precompile(Tuple{Type{Base.Dict{Pkg.BinaryPlatforms.Platform, Base.Dict{String, Any}}}, Base.Generator{Array{Base.Dict{String, Any}, 1}, getfield(Pkg.Artifacts, Symbol("#21#22")){String, String}}})
precompile(Tuple{Type{NamedTuple{(:libgfortran_version, :libstdcxx_version, :cxxstring_abi), T} where T<:Tuple}, Tuple{Base.VersionNumber, Nothing, Nothing}})
precompile(Tuple{Type{PyCall.PyAny}, PyCall.PyObject})
precompile(Tuple{typeof(Base.:(!=)), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{typeof(Base.:(==)), Base.VersionNumber, Base.VersionNumber})
precompile(Tuple{getfield(Core, Symbol("#Type##kw")), NamedTuple{(:libgfortran_version, :libstdcxx_version, :cxxstring_abi), Tuple{Base.VersionNumber, Nothing, Nothing}}, Type{Pkg.BinaryPlatforms.CompilerABI}})
precompile(Tuple{getfield(Pkg.BinaryPlatforms, Symbol("#FreeBSD#19#20")), Nothing, Nothing, Pkg.BinaryPlatforms.CompilerABI, Type{Pkg.BinaryPlatforms.FreeBSD}, Symbol})
precompile(Tuple{getfield(Core, Symbol("#Type##kw")), NamedTuple{(:libc, :compiler_abi), Tuple{Nothing, Pkg.BinaryPlatforms.CompilerABI}}, Type{Pkg.BinaryPlatforms.FreeBSD}, Symbol})
precompile(Tuple{Type{Base.Pair{A, B} where B where A}, Pkg.BinaryPlatforms.FreeBSD, Base.Dict{String, Any}})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Pkg.BinaryPlatforms.Platform, Base.Dict{String, Any}}, Pkg.BinaryPlatforms.FreeBSD})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Pkg.BinaryPlatforms.Platform, Base.Dict{String, Any}}, Base.Dict{String, Any}, Pkg.BinaryPlatforms.FreeBSD})
precompile(Tuple{typeof(Base.mapfilter), getfield(Pkg.BinaryPlatforms, Symbol("#39#41")){Pkg.BinaryPlatforms.Linux}, typeof(Base.push!), Base.KeySet{Pkg.BinaryPlatforms.Platform, Base.Dict{Pkg.BinaryPlatforms.Platform, Base.Dict{String, Any}}}, Base.Set{Pkg.BinaryPlatforms.Platform}})
precompile(Tuple{getfield(Pkg.BinaryPlatforms, Symbol("#39#41")){Pkg.BinaryPlatforms.Linux}, Pkg.BinaryPlatforms.Linux})
precompile(Tuple{getfield(Pkg.BinaryPlatforms, Symbol("#39#41")){Pkg.BinaryPlatforms.Linux}, Pkg.BinaryPlatforms.FreeBSD})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("#ensure_artifact_installed##kw")), NamedTuple{(:platform,), Tuple{Pkg.BinaryPlatforms.Linux}}, typeof(Pkg.Artifacts.ensure_artifact_installed), String, Base.Dict{String, Any}, String})
precompile(Tuple{typeof(Pkg.Artifacts.query_override), Base.SHA1})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##artifact_paths#9")), Bool, typeof(Pkg.Artifacts.artifact_paths), Base.SHA1})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##artifact_exists#11")), Bool, typeof(Pkg.Artifacts.artifact_exists), Base.SHA1})
precompile(Tuple{typeof(Base.Filesystem.temp_cleanup_purge), Bool})
precompile(Tuple{getfield(Base.Filesystem, Symbol("##temp_cleanup_later#14")), Bool, typeof(Base.Filesystem.temp_cleanup_later), String})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##probe_cmd#13")), Bool, typeof(Pkg.PlatformEngines.probe_cmd), Base.Cmd})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##probe_platform_engines!#14")), Bool, typeof(Pkg.PlatformEngines.probe_platform_engines!)})
precompile(Tuple{getfield(Base.Filesystem, Symbol("##mktempdir#19")), String, Bool, typeof(Base.Filesystem.mktempdir), String})
precompile(Tuple{getfield(Base.Filesystem, Symbol("##tempname#17")), Bool, typeof(Base.Filesystem.tempname), String})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Symbol, String, Tuple{Symbol}, NamedTuple{(:url,), Tuple{String}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int64})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Symbol, String, Tuple{Symbol}, NamedTuple{(:file,), Tuple{String}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int64})
precompile(Tuple{typeof(Base.:(>=)), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{getfield(Base.Filesystem, Symbol("#cptree##kw")), NamedTuple{(:force, :follow_symlinks), Tuple{Bool, Bool}}, typeof(Base.Filesystem.cptree), String, String})
precompile(Tuple{typeof(Base.Filesystem.sendfile), String, String})
precompile(Tuple{getfield(Base.Filesystem, Symbol("##cptree#11")), Bool, Bool, typeof(Base.Filesystem.cptree), String, String})
precompile(Tuple{getfield(Base.Filesystem, Symbol("##cp#12")), Bool, Bool, typeof(Base.Filesystem.cp), String, String})
precompile(Tuple{typeof(Base.Filesystem.rename), String, String})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Symbol, Base.SubString{String}, Tuple{Symbol}, NamedTuple{(:server,), Tuple{Base.SubString{String}}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int64})
precompile(Tuple{typeof(Pkg.PlatformEngines.get_server_dir), String, Base.SubString{String}})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##get_auth_header#77")), Bool, typeof(Pkg.PlatformEngines.get_auth_header), String})
precompile(Tuple{typeof(Pkg.PlatformEngines.load_telemetry_file), String})
precompile(Tuple{typeof(Base.load_path_expand), String})
precompile(Tuple{typeof(Base.active_project), Bool})
precompile(Tuple{typeof(Pkg.PlatformEngines.get_telemetry_headers), String})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##download#87")), Bool, Nothing, typeof(Pkg.PlatformEngines.download), String, String})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##download_verify#88")), Bool, Bool, Bool, typeof(Pkg.PlatformEngines.download_verify), String, Nothing, String})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##unpack#96")), Bool, typeof(Pkg.PlatformEngines.unpack), String, String})
precompile(Tuple{getfield(Pkg.PlatformEngines, Symbol("##download_verify_unpack#101")), Nothing, Bool, Bool, Bool, Bool, typeof(Pkg.PlatformEngines.download_verify_unpack), String, Nothing, String})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("#artifact_paths##kw")), NamedTuple{(:honor_overrides,), Tuple{Bool}}, typeof(Pkg.Artifacts.artifact_paths), Base.SHA1})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##artifact_path#10")), Bool, typeof(Pkg.Artifacts.artifact_path), Base.SHA1})
precompile(Tuple{typeof(Pkg.Artifacts.create_artifact), getfield(Pkg.Artifacts, Symbol("#39#40")){Bool, String, Nothing}})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##download_artifact#38")), Bool, Bool, typeof(Pkg.Artifacts.download_artifact), Base.SHA1, String, Nothing})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("#43#45")){Bool, Bool, Base.SHA1}})
precompile(Tuple{typeof(Pkg.Artifacts.with_show_download_info), getfield(Pkg.Artifacts, Symbol("#43#45")){Bool, Bool, Base.SHA1}, String, Bool})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##ensure_artifact_installed#42")), Pkg.BinaryPlatforms.Platform, Bool, Bool, typeof(Pkg.Artifacts.ensure_artifact_installed), String, Base.Dict{String, Any}, String})
precompile(Tuple{typeof(Pkg.Artifacts.artifact_path), Base.SHA1})
precompile(Tuple{getfield(Pkg.Artifacts, Symbol("##query_override#7")), Base.Dict{Symbol, Base.Dict{K, V} where V where K}, typeof(Pkg.Artifacts.query_override), Base.SHA1})
precompile(Tuple{typeof(Libdl.dlopen), String})
precompile(Tuple{typeof(OpenSpecFun_jll.__init__)})
precompile(Tuple{typeof(Base.foreach), getfield(OpenSpecFun_jll, Symbol("#7#9")), Tuple{Array{String, 1}}})
precompile(Tuple{typeof(Base.foreach), getfield(OpenSpecFun_jll, Symbol("#8#10")), Tuple{Array{String, 1}}})
precompile(Tuple{typeof(SymPy.__init__)})
precompile(Tuple{typeof(PyCall.anaconda_conda)})
precompile(Tuple{typeof(PyCall.pyimport_conda), String, String, String})
precompile(Tuple{typeof(Base.getproperty), SymPy.Sym, Symbol})
precompile(Tuple{typeof(Base.in), Symbol, Tuple{Symbol}})
precompile(Tuple{typeof(Base.copy!), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{typeof(PyCall._setproperty!), PyCall.PyObject, String, Int64})
precompile(Tuple{typeof(PyCall.mpmath_init)})
precompile(Tuple{typeof(Base.:(==)), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{typeof(PyCall.pytype_mapping), PyCall.PyObject, Type{T} where T})
precompile(Tuple{typeof(Base.convert), Type{Bool}, PyCall.PyObject})
precompile(Tuple{typeof(Base.getproperty), PyCall.PyObject, Symbol})
precompile(Tuple{typeof(Base.load_path)})
precompile(Tuple{typeof(Base.identify_package), String})
precompile(Tuple{typeof(Base.:(!)), SymPy.Sym})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Module, Symbol, Symbol, String, Int64})
precompile(Tuple{getfield(Base, Symbol("#683#684")){Base.UUID, String}, Base.IOStream})
precompile(Tuple{getfield(Base, Symbol("##open#270")), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.open), getfield(Base, Symbol("#683#684")){Base.UUID, String}, String})
precompile(Tuple{typeof(Base.manifest_deps_get), String, Base.PkgId, String})
precompile(Tuple{typeof(Base.identify_package), Base.PkgId, String})
precompile(Tuple{typeof(Base.locate_package), Base.PkgId})
precompile(Tuple{typeof(Base.isvalid_file_crc), Base.IOStream})
precompile(Tuple{typeof(Base.stale_cachefile), String, String})
precompile(Tuple{typeof(Base.register_root_module), Module})
precompile(Tuple{typeof(Base._include_from_serialized), String, Array{Any, 1}})
precompile(Tuple{typeof(Base._tryrequire_from_serialized), Base.PkgId, UInt64, String})
precompile(Tuple{typeof(Base._require_search_from_serialized), Base.PkgId, String})
precompile(Tuple{typeof(Base.compilecache_path), Base.PkgId})
precompile(Tuple{typeof(Base.load_path_setup_code), Bool})
precompile(Tuple{typeof(Base.create_expr_cache), String, String, Array{Base.Pair{Base.PkgId, UInt64}, 1}, Nothing})
precompile(Tuple{typeof(Base.mapreduce_impl), typeof(Base.success), typeof(Base.:(&)), Array{Base.Process, 1}, Int64, Int64, Int64})
precompile(Tuple{typeof(Base._mapreduce), typeof(Base.success), typeof(Base.:(&)), Base.IndexLinear, Array{Base.Process, 1}})
precompile(Tuple{typeof(Base.compilecache), Base.PkgId, String})
precompile(Tuple{typeof(Base._tryrequire_from_serialized), Base.PkgId, UInt64, Nothing})
precompile(Tuple{typeof(Base._require_from_serialized), String})
precompile(Tuple{typeof(Base._require), Base.PkgId})
precompile(Tuple{typeof(Base.require), Base.PkgId})
precompile(Tuple{getfield(Logging, Symbol("##handle_message#2")), Nothing, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.CoreLogging.handle_message), Logging.ConsoleLogger, Base.CoreLogging.LogLevel, String, Nothing, Nothing, Symbol, Nothing, Int64})
precompile(Tuple{typeof(Base.require), Module, Symbol})
precompile(Tuple{typeof(Requires.__init__)})
precompile(Tuple{typeof(Requires.loadpkg), Base.PkgId})
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Base.PkgId, Array{Function, 1}}, Base.PkgId})
precompile(Tuple{typeof(Latexify.__init__)})
precompile(Tuple{getfield(Core.Compiler, Symbol("#295#300")), QuoteNode})
precompile(Tuple{typeof(Requires.listenpkg), Any, Base.PkgId})
precompile(Tuple{typeof(Base.rehash!), Base.Dict{Base.PkgId, Array{Function, 1}}, Int64})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Base.PkgId, Array{Function, 1}}, Base.PkgId})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Function, 1}, Tuple{Base.OneTo{Int64}}})
precompile(Tuple{typeof(Base.copyto!), Array{Function, 1}, Array{Any, 1}})
precompile(Tuple{typeof(Base.get!), getfield(Requires, Symbol("#1#2")), Base.Dict{Base.PkgId, Array{Function, 1}}, Base.PkgId})
precompile(Tuple{typeof(Base.push!), Array{Function, 1}, Function})
precompile(Tuple{Type{Base.Dict{Symbol, Any}}, Base.Pair{Symbol, REPL.LineEdit.Prompt}, Vararg{Base.Pair{Symbol, REPL.LineEdit.Prompt}, N} where N})
precompile(Tuple{typeof(Base.peek), Base.IOStream})
precompile(Tuple{Type{Char}, Int32})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#45#76"))}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#74#105")){REPL.LineEdit.HistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#49#58")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#251#255")){REPL.LineEdit.PrefixHistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#39#42")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.UnixTerminal, Any})
precompile(Tuple{typeof(Base.uv_alloc_buf), Ptr{Nothing}, UInt64, Ptr{Nothing}})
precompile(Tuple{typeof(Base.uv_readcb), Ptr{Nothing}, Int64, Ptr{Nothing}})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##bracketed_paste#107")), Any, typeof(REPL.LineEdit.bracketed_paste), Any})
precompile(Tuple{typeof(REPL.LineEdit.bracketed_paste), Any})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.LineEdit.MIState})
precompile(Tuple{typeof(REPL.LineEdit.refresh_line), Any})
precompile(Tuple{typeof(REPL.LineEdit.add_history), REPL.LineEdit.PromptState})
precompile(Tuple{typeof(REPL.LineEdit.add_history), REPL.LineEdit.MIState})
precompile(Tuple{typeof(REPL.LineEdit.commit_line), Any})
precompile(Tuple{typeof(Base.rehash!), Base.Dict{Ptr{PyCall.PyObject_struct}, Any}, Int64})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Ptr{PyCall.PyObject_struct}, Any}, Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Ptr{PyCall.PyObject_struct}, Any}, Base.RefValue{Any}, Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall.pyjlwrap_new), PyCall.PyTypeObject, Char})
precompile(Tuple{Type{PyCall.PyObject}, SymPy.SymPermutationGroup})
precompile(Tuple{typeof(Base.getproperty), SymPy.SymPermutationGroup, Symbol})
precompile(Tuple{typeof(PyCall.pydecref_), Ptr{PyCall.PyObject_struct}})
precompile(Tuple{typeof(PyCall._pycall!), PyCall.PyObject, PyCall.PyObject, Tuple{Bool}, Int64, Ptr{Nothing}})
precompile(Tuple{getfield(SymPy, Symbol("##sympify#12")), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(SymPy.sympify), Bool})
precompile(Tuple{getfield(SymPy, Symbol("##occursin#105")), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Base.occursin), UInt8, SymPy.SymPermutationGroup})
precompile(Tuple{getfield(REPL, Symbol("#53#62")), Any, Any, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.replace), String, Base.Pair{Char, String}})
precompile(Tuple{getfield(Base.Meta, Symbol("##parse#1")), Bool, Bool, Bool, typeof(Base.Meta.parse), String, Int64})
precompile(Tuple{getfield(Base.Meta, Symbol("#parse##kw")), NamedTuple{(:raise, :depwarn), Tuple{Bool, Bool}}, typeof(Base.Meta.parse), String, Int64})
precompile(Tuple{typeof(Base.endswith), String, Char})
precompile(Tuple{typeof(Base.prevind), String, Int64})
precompile(Tuple{typeof(Base.strip), String})
precompile(Tuple{typeof(REPL.LineEdit.replace_line), REPL.LineEdit.MIState, Any})
precompile(Tuple{typeof(REPL.LineEdit.replace_line), REPL.LineEdit.PromptState, Any})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.LineEdit.ModeState})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.TerminalBuffer, REPL.LineEdit.SearchState})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##refresh_multi_line#12")), Any, typeof(REPL.LineEdit.refresh_multi_line), REPL.LineEdit.ModeState})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.UnixTerminal, Any})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##refresh_multi_line#16")), Any, typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.UnixTerminal, Any})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.TerminalBuffer, REPL.Terminals.UnixTerminal, Union{REPL.LineEdit.PrefixSearchState, REPL.LineEdit.PromptState}})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##refresh_multi_line#38")), Any, typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.TerminalBuffer, REPL.Terminals.UnixTerminal, Union{REPL.LineEdit.PrefixSearchState, REPL.LineEdit.PromptState}})
precompile(Tuple{typeof(REPL.LineEdit.add_history), REPL.REPLHistoryProvider, Any})
precompile(Tuple{getfield(REPL, Symbol("#do_respond#38")){Bool, getfield(REPL, Symbol("#48#57")){REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt}, Any, Any, Any})
precompile(Tuple{getfield(SymPy, Symbol("#@vars")), LineNumberNode, Module, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.reverse), Tuple{Symbol, Symbol, Symbol, Expr}})
precompile(Tuple{typeof(Base.:(==)), Symbol, Symbol})
precompile(Tuple{typeof(Base.reverse), Array{Any, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.reverse), Array{Any, 1}})
precompile(Tuple{Type{NamedTuple{(:real,), T} where T<:Tuple}, Tuple{Bool}})
precompile(Tuple{getfield(SymPy, Symbol("##symbols#9")), Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:real,), Tuple{Bool}}}, typeof(SymPy.symbols), String})
precompile(Tuple{getfield(SymPy, Symbol("#symbols##kw")), NamedTuple{(:real,), Tuple{Bool}}, typeof(SymPy.symbols), Symbol})
precompile(Tuple{typeof(PyCall._pycall!), PyCall.PyObject, PyCall.PyObject, Tuple{String}, Int64, Ptr{Nothing}})
precompile(Tuple{typeof(PyCall._pycall!), PyCall.PyObject, PyCall.PyObject, Tuple{String}, Int64, PyCall.PyObject})
precompile(Tuple{Type{Base.Dict{AbstractString, Any}}})
precompile(Tuple{typeof(Base.rehash!), Base.Dict{AbstractString, Any}, Int64})
precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{AbstractString, Any}, String})
precompile(Tuple{typeof(Base.setindex!), Base.Dict{AbstractString, Any}, Bool, String})
precompile(Tuple{Type{Base.Dict{AbstractString, Any}}, Array{Base.Pair{String, Bool}, 1}})
precompile(Tuple{Type{PyCall.PyObject}, Base.Dict{AbstractString, Any}})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{Base.Pair{String, Bool}, 1}, Base.Pair{String, Bool}, Base.Generator{Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:real,), Tuple{Bool}}}, getfield(PyCall, Symbol("#108#109"))}, Int64})
precompile(Tuple{typeof(PyCall._pycall!), PyCall.PyObject, PyCall.PyObject, Tuple{String}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:real,), Tuple{Bool}}}})
precompile(Tuple{getfield(Core, Symbol("#Any##kw")), NamedTuple{(:real,), Tuple{Bool}}, PyCall.PyObject, String})
precompile(Tuple{Type{PyCall.PyObject}, String})
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{AbstractString, Any}, String})
precompile(Tuple{typeof(Base.getindex), Base.Dict{AbstractString, Any}, String})
precompile(Tuple{Type{PyCall.PyObject}, Bool})
precompile(Tuple{typeof(Base.unsafe_convert), Type{Ptr{PyCall.PyObject_struct}}, PyCall.PyObject})
precompile(Tuple{typeof(Base.convert), Type{SymPy.Sym}, PyCall.PyObject})
precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Bool}})
precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Bool}})
precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Bool}})
precompile(Tuple{typeof(Base.getindex), LaTeXStrings.LaTeXString, Base.UnitRange{Int64}})
precompile(Tuple{typeof(REPL.ends_with_semicolon), AbstractString})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Bool}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Bool}, Int64, Int64})
precompile(Tuple{typeof(Base.isimmutable), Any})
precompile(Tuple{typeof(Base.Multimedia.display), Any})
precompile(Tuple{typeof(SymPy.jprint), SymPy.Sym})
precompile(Tuple{typeof(Base.show_delim_array), Base.IOContext{REPL.Terminals.TTYTerminal}, Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}, Char, Char, Char, Bool, Int64, Int64})
precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.Multimedia.MIME{Symbol("text/plain")}, Tuple{SymPy.Sym, SymPy.Sym, SymPy.Sym}})
precompile(Tuple{typeof(Base.show_circular), Base.IOContext{REPL.Terminals.TTYTerminal}, Any})
precompile(Tuple{Type{Base.Pair{Symbol, DataType}}, Any, Any})
precompile(Tuple{typeof(PyCall._pycall!), PyCall.PyObject, PyCall.PyObject, Tuple{PyCall.PyObject}, Int64, Ptr{Nothing}})
precompile(Tuple{typeof(PyCall.pycall), PyCall.PyObject, Type{String}, PyCall.PyObject})
precompile(Tuple{typeof(REPL.LineEdit.activate), REPL.LineEdit.TextInterface, REPL.LineEdit.ModeState, Any, REPL.Terminals.TextTerminal})
precompile(Tuple{typeof(REPL.LineEdit.refresh_line), Any, Any})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.TerminalBuffer, REPL.LineEdit.ModeState})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##refresh_multi_line#13")), Any, typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.TerminalBuffer, REPL.LineEdit.ModeState})
precompile(Tuple{typeof(REPL.LineEdit.edit_insert_newline), REPL.LineEdit.PromptState, Int64})
precompile(Tuple{typeof(REPL.LineEdit.edit_insert_newline), REPL.LineEdit.PromptState})
precompile(Tuple{typeof(REPL.LineEdit.setmark), REPL.LineEdit.MIState, Bool})
precompile(Tuple{typeof(REPL.LineEdit.setmark), REPL.LineEdit.MIState})
precompile(Tuple{typeof(REPL.LineEdit.set_action!), REPL.LineEdit.MIState, Symbol})
precompile(Tuple{typeof(REPL.LineEdit.edit_insert_newline), REPL.LineEdit.MIState})
precompile(Tuple{typeof(Base.:(>)), PyCall.PyObject, PyCall.PyObject})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("#110#163")), Any, Any, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.allocatedinline), Type{Union{}}})
precompile(Tuple{typeof(Base.allocatedinline), Type{Ptr{PyCall.PyObject_struct}}})
precompile(Tuple{typeof(Base.allocatedinline), Type{PyCall.PyMethodDef}})
precompile(Tuple{getfield(Base, Symbol("##s662#431")), Any, Any, Any, Any, Any, Any})
precompile(Tuple{getfield(Base.Cartesian, Symbol("#@nexprs")), LineNumberNode, Module, Int64, Expr})
precompile(Tuple{typeof(Base.Cartesian.exprresolve_arith), Expr})
precompile(Tuple{typeof(Base.Cartesian.exprresolve_conditional), Expr})
precompile(Tuple{typeof(Base.Cartesian.exprresolve), Expr})
precompile(Tuple{typeof(Base.Cartesian.inlineanonymous), Expr, Int64})
precompile(Tuple{typeof(Base.Cartesian.lreplace!), Expr, Base.Cartesian.LReplace{String}})
precompile(Tuple{typeof(Base.Cartesian.lreplace), Expr, Symbol, Int64})
precompile(Tuple{getfield(Base.Cartesian, Symbol("#@nloops")), LineNumberNode, Module, Any, Any, Any, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.Cartesian._nloops), Int64, Symbol, Symbol, Expr, Vararg{Expr, N} where N})
precompile(Tuple{typeof(Base.Cartesian._nloops), Int64, Symbol, Expr, Expr, Vararg{Expr, N} where N})
precompile(Tuple{typeof(Base.hash), Array{Any, 1}, UInt64})
precompile(Tuple{typeof(Base.hash), Expr, UInt64})
precompile(Tuple{typeof(Base.:(&)), PyCall.PyObject, Int64})
precompile(Tuple{typeof(Base.hashindex), Expr, Int64})
precompile(Tuple{typeof(Base.haskey), Base.Dict{Symbol, Function}, Expr})
precompile(Tuple{typeof(Base.findprev), getfield(Base, Symbol("#66#67")){Base.Fix2{typeof(Base.isequal), QuoteNode}}, Array{Any, 1}, Int64})
precompile(Tuple{typeof(Base.copyto!), Array{Char, 1}, Int64, Array{Char, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.copyto!), Array{Any, 1}, Int64, Array{Char, 1}, Int64, Int64})
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Char, String}, Char})
precompile(Tuple{typeof(Base.collect_to!), Array{Char, 1}, Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}, Int64, Int64})
precompile(Tuple{typeof(Base.setindex!), Array{String, 1}, Char, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{String, 1}, Char, Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}, Int64})
precompile(Tuple{typeof(Base.setindex!), Array{Char, 1}, String, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{Char, 1}, String, Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}, Int64})
precompile(Tuple{typeof(Base.collect_to!), Array{String, 1}, Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}, Int64, Int64})
precompile(Tuple{typeof(Base.collect), Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}})
precompile(Tuple{typeof(Latexify.unicode2latex), String})
precompile(Tuple{getfield(Latexify, Symbol("##latexraw#3")), Bool, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Latexify.latexraw), Expr})
precompile(Tuple{typeof(Base.:(|>)), Expr, typeof(Latexify.latexraw)})
precompile(Tuple{typeof(MacroTools.walk), Expr, Function, getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}})
precompile(Tuple{Type{Base.Generator{I, F} where F where I}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Array{Any, 1}})
precompile(Tuple{typeof(Base.iterate), Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}})
precompile(Tuple{typeof(Base._collect), Array{Any, 1}, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}, Base.EltypeUnknown, Base.HasShape{1}})
precompile(Tuple{typeof(Base.collect_similar), Array{Any, 1}, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}})
precompile(Tuple{getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Symbol})
precompile(Tuple{typeof(Base._similar_for), Array{Any, 1}, Type{Symbol}, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}, Base.HasShape{1}})
precompile(Tuple{typeof(Base.collect_to!), Array{Symbol, 1}, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}, Int64, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{Symbol, 1}, Symbol, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}, Int64})
precompile(Tuple{getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Expr})
precompile(Tuple{getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Int64})
precompile(Tuple{typeof(Base.collect_to!), Array{Any, 1}, Base.Generator{Array{Any, 1}, getfield(MacroTools, Symbol("#19#20")){getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}}, Int64, Int64})
precompile(Tuple{getfield(Latexify, Symbol("#4#5")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Expr})
precompile(Tuple{typeof(Base.deepcopy), Expr})
precompile(Tuple{typeof(Base.deepcopy_internal), Any, Base.IdDict{Any, Any}})
precompile(Tuple{typeof(Base.deepcopy_internal), Symbol, Base.IdDict{Any, Any}})
precompile(Tuple{typeof(Base.deepcopy_internal), Array{Any, 1}, Base.IdDict{Any, Any}})
precompile(Tuple{typeof(Base.similar), Array{Any, 1}})
precompile(Tuple{Type{Core.Compiler.Signature}, Latexify.PlainNumberFormatter, Core.Compiler.Const, Array{Any, 1}, Type{T} where T})
precompile(Tuple{typeof(Latexify.convertSubscript), String})
precompile(Tuple{typeof(Latexify.convertSubscript!), Expr})
precompile(Tuple{typeof(Base._collect), Array{Any, 1}, Base.Generator{Array{Any, 1}, getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Base.EltypeUnknown, Base.HasShape{1}})
precompile(Tuple{typeof(Base.:(*)), String, PyCall.PyObject})
precompile(Tuple{typeof(Base.:(==)), WeakRef, Symbol})
precompile(Tuple{getfield(Latexify, Symbol("##latexoperation#21")), Bool, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, typeof(Latexify.latexoperation), Expr, Array{Symbol, 1}})
precompile(Tuple{getfield(Latexify, Symbol("#recurseexp!#6")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Expr})
precompile(Tuple{getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, String})
precompile(Tuple{typeof(Base._similar_for), Array{Any, 1}, Type{String}, Base.Generator{Array{Any, 1}, getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Base.HasShape{1}})
precompile(Tuple{typeof(Base.collect_to!), Array{String, 1}, Base.Generator{Array{Any, 1}, getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Int64, Int64})
precompile(Tuple{typeof(Base.collect_to_with_first!), Array{String, 1}, String, Base.Generator{Array{Any, 1}, getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}}, Int64})
precompile(Tuple{getfield(Latexify, Symbol("#22#24")){Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Int64})
precompile(Tuple{typeof(Base.in), Symbol, Base.KeySet{Symbol, Base.Dict{Symbol, String}}})
precompile(Tuple{typeof(Base.getindex), Array{String, 1}, Base.UnitRange{Int64}})
precompile(Tuple{typeof(Base.join), Array{String, 1}, String})
precompile(Tuple{typeof(Base._array_for), Type{Char}, String, Base.HasLength})
precompile(Tuple{typeof(Base.collect_to!), Array{Any, 1}, Base.Generator{String, getfield(Latexify, Symbol("#1#2"))}, Int64, Int64})
precompile(Tuple{typeof(Base.Unicode.isletter), Char})
precompile(Tuple{typeof(Base.Unicode.isdigit), Char})
precompile(Tuple{typeof(Base.join), Array{Any, 1}})
precompile(Tuple{getfield(Base, Symbol("##sprint#338")), Nothing, Int64, typeof(Base.sprint), Function, Array{Any, 1}})
precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Array{UInt8, 1}}, Array{Any, 1}})
precompile(Tuple{typeof(Base.print), LaTeXStrings.LaTeXString})
precompile(Tuple{typeof(Base.:(|>)), LaTeXStrings.LaTeXString, typeof(Base.print)})
precompile(Tuple{typeof(Base.print), Base.TTY, LaTeXStrings.LaTeXString})
precompile(Tuple{typeof(Base.hvcat), Tuple{Int64, Int64}, Int64, Vararg{Int64, N} where N})
precompile(Tuple{typeof(Base.Cartesian._nloops), Int64, Symbol, Expr, Expr})
precompile(Tuple{getfield(Base.Cartesian, Symbol("#@ncall")), LineNumberNode, Module, Int64, Any, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Float64, 2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
precompile(Tuple{typeof(Base.copyto!), Array{Float64, 2}, Array{Int64, 2}})
precompile(Tuple{typeof(LinearAlgebra.istriu), Array{Float64, 2}, Int64})
precompile(Tuple{typeof(LinearAlgebra.istril), Array{Float64, 2}, Int64})
precompile(Tuple{typeof(Base.getindex), Array{Float64, 2}, Base.StepRange{Int64, Int64}})
precompile(Tuple{typeof(LinearAlgebra.diag), Array{Float64, 2}, Int64})
precompile(Tuple{Type{Array{Float64, 2}}, LinearAlgebra.UniformScaling{Bool}, Tuple{Int64, Int64}})
precompile(Tuple{typeof(Base.permute!!), Array{Float64, 1}, Array{Int64, 1}})
precompile(Tuple{typeof(Base.swapcols!), Array{Float64, 2}, Int64, Int64})
precompile(Tuple{typeof(Base.permutecols!!), Array{Float64, 2}, Array{Int64, 1}})
precompile(Tuple{getfield(LinearAlgebra, Symbol("##eigen#151")), Bool, Bool, typeof(LinearAlgebra.eigsortby), typeof(LinearAlgebra.eigen), LinearAlgebra.Diagonal{Float64, Array{Float64, 1}}})
precompile(Tuple{typeof(LinearAlgebra.ishermitian), Array{Float64, 2}})
precompile(Tuple{typeof(Base.throw_checksize_error), Array{Float64, 2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
precompile(Tuple{typeof(Base._unsafe_getindex), Base.IndexLinear, Array{Float64, 2}, Base.Slice{Base.OneTo{Int64}}, Base.UnitRange{Int64}})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.UnitRange{Int64}}})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Float64, 1}, Tuple{Base.UnitRange{Int64}}})
precompile(Tuple{typeof(LinearAlgebra.LAPACK.syevr!), Char, Char, Char, Array{Float64, 2}, Float64, Float64, Int64, Int64, Float64})
precompile(Tuple{getfield(LinearAlgebra, Symbol("##eigen!#103")), typeof(LinearAlgebra.eigsortby), typeof(LinearAlgebra.eigen!), LinearAlgebra.Symmetric{Float64, Array{Float64, 2}}})
precompile(Tuple{typeof(LinearAlgebra.LAPACK.geevx!), Char, Char, Char, Char, Array{Float64, 2}})
precompile(Tuple{typeof(Base.fill!), Array{Base.Complex{Float64}, 2}, Base.Complex{Float64}})
precompile(Tuple{typeof(Base.__subarray_throw_boundserror), Type{Base.SubArray{Float64, 1, Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}}, Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, Int64, Int64, Tuple{Int64}})
precompile(Tuple{typeof(Base.copyto!), Base.IndexLinear, Array{Float64, 2}, Base.IndexLinear, Base.SubArray{Float64, 1, Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}})
precompile(Tuple{typeof(Base.throw_setindex_mismatch), Base.SubArray{Float64, 1, Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, Tuple{Int64, Int64}})
precompile(Tuple{typeof(Base._unsafe_setindex!), Base.IndexLinear, Array{Base.Complex{Float64}, 2}, Base.SubArray{Float64, 1, Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, Base.Slice{Base.OneTo{Int64}}, Int64})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Base.Complex{Float64}, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Float64, 2}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}})
precompile(Tuple{typeof(Base.throw_boundserror), Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, typeof(Base.complex), Tuple{Base.Broadcast.Extruded{Array{Float64, 1}, Tuple{Bool}, Tuple{Int64}}, Base.Broadcast.Extruded{Array{Float64, 1}, Tuple{Bool}, Tuple{Int64}}}}, Tuple{Int64}})
precompile(Tuple{typeof(Base.permute!!), Array{Base.Complex{Float64}, 1}, Array{Int64, 1}})
precompile(Tuple{typeof(Base.swapcols!), Array{Base.Complex{Float64}, 2}, Int64, Int64})
precompile(Tuple{typeof(Base.permutecols!!), Array{Base.Complex{Float64}, 2}, Array{Int64, 1}})
precompile(Tuple{getfield(LinearAlgebra, Symbol("##eigen!#75")), Bool, Bool, typeof(LinearAlgebra.eigsortby), typeof(LinearAlgebra.eigen!), Array{Float64, 2}})
precompile(Tuple{getfield(LinearAlgebra, Symbol("##eigen#77")), Bool, Bool, typeof(LinearAlgebra.eigsortby), typeof(LinearAlgebra.eigen), Array{Int64, 2}})
precompile(Tuple{typeof(LinearAlgebra.eigen), Array{Int64, 2}})
precompile(Tuple{typeof(Base.put_buffered), Base.Channel{Any}, Tuple{LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}, Bool}})
precompile(Tuple{typeof(Base.put_unbuffered), Base.Channel{Any}, Tuple{LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}, Bool}})
precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}, Bool}})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}, Bool}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}, Bool}, Int64, Int64})
precompile(Tuple{typeof(Base.array_summary), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 1}, Tuple{Base.OneTo{Int64}}})
precompile(Tuple{typeof(Base.print_matrix), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 1}, String, String, String, String, String, String, Int64, Int64})
precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.Multimedia.MIME{Symbol("text/plain")}, Array{Float64, 1}})
precompile(Tuple{typeof(Base.array_summary), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 2}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}})
precompile(Tuple{typeof(Base.print_matrix), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 2}, String, String, String, String, String, String, Int64, Int64})
precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.Multimedia.MIME{Symbol("text/plain")}, Array{Float64, 2}})
precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.Multimedia.MIME{Symbol("text/plain")}, LinearAlgebra.Eigen{Float64, Float64, Array{Float64, 2}, Array{Float64, 1}}})
precompile(Tuple{typeof(Base.show_type_name), Base.IOContext{REPL.Terminals.TTYTerminal}, Core.TypeName})
precompile(Tuple{typeof(Base.show_datatype), Base.IOContext{REPL.Terminals.TTYTerminal}, DataType})
precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Type{T} where T})
precompile(Tuple{typeof(Base.alignment), Base.IOContext{REPL.Terminals.TTYTerminal}, Float64})
precompile(Tuple{typeof(Base.alignment), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 1}, Base.UnitRange{Int64}, Base.UnitRange{Int64}, Int64, Int64, Int64})
precompile(Tuple{getfield(Base, Symbol("##sprint#338")), Base.IOContext{REPL.Terminals.TTYTerminal}, Int64, typeof(Base.sprint), Function, Float64})
precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Float64, Bool, Bool})
precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Float64})
precompile(Tuple{typeof(Base.print_matrix_row), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 1}, Array{Tuple{Int64, Int64}, 1}, Int64, Base.UnitRange{Int64}, String})
precompile(Tuple{getfield(Base, Symbol("##sprint#338")), Nothing, Int64, typeof(Base.sprint), Function, Tuple{String, String}, Vararg{Any, N} where N})
precompile(Tuple{typeof(Base.alignment), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 2}, Base.UnitRange{Int64}, Base.UnitRange{Int64}, Int64, Int64, Int64})
precompile(Tuple{typeof(Base.print_matrix_row), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Float64, 2}, Array{Tuple{Int64, Int64}, 1}, Int64, Base.UnitRange{Int64}, String})
precompile(Tuple{typeof(Base.allocatedinline), Type{Base.Timer}})
precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Base.Timer}, Symbol})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Base.Timer, 1}, Tuple{Int64}})
precompile(Tuple{typeof(Base.throw_boundserror), Array{Symbol, 1}, Tuple{Int64}})
precompile(Tuple{typeof(Base._delete!), Base.Dict{Symbol, Base.Timer}, Int64})
precompile(Tuple{typeof(PyCall.pygui_stop), Symbol})
precompile(Tuple{typeof(PyCall.pygui_stop_all)})
precompile(Tuple{typeof(PyCall.Py_Finalize)})
precompile(Tuple{typeof(Base.Filesystem.temp_cleanup_purge)})