# Path: ipet/Key.py
# CONTEXT_LOGFILE = 1  # the log file of a solver which most readers are reading from
# CONTEXT_ERRFILE = 2  # the error file of a solver
# CONTEXT_SETFILE = 3  # the settings file used for solving
# CONTEXT_TRACEFILE = 5
# CONTEXT_METAFILE = 0  # the metadata
#     MINIMIZE = 1
#     MAXIMIZE = -1
# class SolverStatusCodes:
# class ProblemStatusCodes:
# class ObjectiveSenseCode:
#     def getBestStatus(*args):
#     def getWorstStatus(*args):
# def solverToProblemStatusCode(solverstatus : int) -> str:


import re
import xml.etree.ElementTree as ElementTree
import numpy as np
import datetime
import os
from xml.dom.minidom import parseString
from ipet import Key
"""
The MIT License (MIT)

Copyright (c) 2018 Zuse Institute Berlin, www.zib.de

Permissions are granted as stated in the license file you have obtained
with this software. If you find the library useful for your purpose,
please refer to README.md for how to cite IPET.

@author: Gregor Hendel
"""
"""
   Various methods for evaluation such as gap calculation, geometric means etc. and some printing methods
"""
FLOAT_INFINITY = 1e20
FLOAT_LARGE = 1e15
DEFAULT_MIN_GEOM_MEAN = 1.0
numericExpression = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+)")
numericExpressionOrInf = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+|inf)")
tablenumericExpression = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+|cutoff)")
wordExpression = re.compile(r'[^\s]+')
useStringSplit = False

def sortingKeyContext(context):
    """
    returns sortkey belonging to context
    """
    try:

# Path: ipet/Key.py
# CONTEXT_LOGFILE = 1  # the log file of a solver which most readers are reading from
# CONTEXT_ERRFILE = 2  # the error file of a solver
# CONTEXT_SETFILE = 3  # the settings file used for solving
# CONTEXT_TRACEFILE = 5
# CONTEXT_METAFILE = 0  # the metadata
#     MINIMIZE = 1
#     MAXIMIZE = -1
# class SolverStatusCodes:
# class ProblemStatusCodes:
# class ObjectiveSenseCode:
#     def getBestStatus(*args):
#     def getWorstStatus(*args):
# def solverToProblemStatusCode(solverstatus : int) -> str:


# Path: ipet/misc/misc.py
import re
import xml.etree.ElementTree as ElementTree
import numpy as np
import datetime
import os
from xml.dom.minidom import parseString
from ipet import Key

"""
The MIT License (MIT)

Copyright (c) 2018 Zuse Institute Berlin, www.zib.de

Permissions are granted as stated in the license file you have obtained
with this software. If you find the library useful for your purpose,
please refer to README.md for how to cite IPET.

@author: Gregor Hendel
"""
"""
   Various methods for evaluation such as gap calculation, geometric means etc. and some printing methods
"""
FLOAT_INFINITY = 1e20
FLOAT_LARGE = 1e15
DEFAULT_MIN_GEOM_MEAN = 1.0
numericExpression = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+)")
numericExpressionOrInf = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+|inf)")
tablenumericExpression = re.compile("([+\-]*[\d]+[.\d]*(?:e[+-])?-*[\d]*[kMG]{0,1}|[\-]+|cutoff)")
wordExpression = re.compile(r'[^\s]+')
useStringSplit = False

def sortingKeyContext(context):
    """
    returns sortkey belonging to context
    """
    try:

        return Key.context2Sortkey[context]