# Path: praatio/utilities/utils.py
# def reportNoop(_exception: Type[BaseException], _text: str) -> None:
# def reportException(exception: Type[BaseException], text: str) -> NoReturn:
# def reportWarning(_exception: Type[BaseException], text: str) -> None:
# def getErrorReporter(reportingMode: Literal["silence", "warning", "error"]):
# def checkIsUndershoot(time: float, referenceTime: float, errorReporter) -> bool:
# def checkIsOvershoot(time: float, referenceTime: float, errorReporter) -> bool:
# def validateOption(variableName, value, optionClass):
# def intervalOverlapCheck(
#     interval: Interval,
#     cmprInterval: Interval,
#     percentThreshold: float = 0,
#     timeThreshold: float = 0,
#     boundaryInclusive: bool = False,
# ) -> bool:
# def getIntervalsInInterval(
#     start: float,
#     end: float,
#     intervals: List[Interval],
#     mode: Literal["strict", "lax", "truncated"],
# ) -> List[Interval]:
# def escapeQuotes(text: str) -> str:
# def strToIntOrFloat(inputStr: str) -> float:
# def getValueAtTime(
#     timestamp: float,
#     sortedDataTupleList: List[Tuple[Any, ...]],
#     fuzzyMatching: bool = False,
#     startI: int = 0,
# ) -> Tuple[Tuple[Any, ...], int]:
# def getValuesInInterval(dataTupleList: List, start: float, end: float) -> List:
# def sign(x: float) -> int:
# def invertIntervalList(
#     inputList: List[Tuple[float, float]], minValue: float = None, maxValue: float = None
# ) -> List[Tuple[float, float]]:
# def makeDir(path: str) -> None:
# def findAll(txt: str, subStr: str) -> List[int]:
# def runPraatScript(
#     praatEXE: str, scriptFN: str, argList: List[Any], cwd: str = None
# ) -> None:
# def safeZip(listOfLists: List[list], enforceLength: bool) -> Iterator[Any]:
# def getWavDuration(wavFN: str) -> float:
# 
# Path: praatio/utilities/errors.py
# class PraatioException(Exception):
# class SafeZipException(PraatioException):
# class FileNotFound(PraatioException):
# class ParsingError(PraatioException):
# class ArgumentError(PraatioException):
# class UnexpectedError(PraatioException):
# class WrongOption(PraatioException):
# class TextgridException(PraatioException):
# class DuplicateTierName(TextgridException):
# class OutOfBounds(TextgridException):
# class CollisionError(TextgridException):
# class TimelessTextgridTierException(TextgridException):
# class TextgridStateAutoModified(TextgridException):
# class TextgridStateError(TextgridException):
# class TierNameExistsError(TextgridException):
# class IncompatibleTierError(TextgridException):
# class PraatExecutionFailed(PraatioException):
# class EndOfAudioData(PraatioException):
# class FindZeroCrossingError(PraatioException):
# class NormalizationException(PraatioException):
#     def __init__(self, fullPath: str):
#     def __str__(self):
#     def __init__(self, argumentName: str, givenValue: str, availableOptions: List[str]):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self, tier):
#     def __str__(self):
#     def __init__(self, cmdList: List[str]):
#     def __str__(self):
#     def __init__(self, startTime: float, endTime: float):
#     def __str__(self):
#     def __str__(self):


import unittest
from praatio.utilities import utils
from praatio.utilities import errors



class TestUtils(unittest.TestCase):
    def test_interval_overlap_check_using_time_threshold_flag(self):
        self.assertTrue(utils.intervalOverlapCheck([0, 5], [2, 7]))
        self.assertTrue(utils.intervalOverlapCheck([0, 5], [2, 7], timeThreshold=3))
        self.assertFalse(utils.intervalOverlapCheck([0, 5], [2, 7], timeThreshold=4))

    def test_interval_overlap_check_using_precent_threshold_flag(self):
        self.assertTrue(utils.intervalOverlapCheck([0, 100], [50, 100]))
        self.assertTrue(

# Path: praatio/utilities/utils.py
# def reportNoop(_exception: Type[BaseException], _text: str) -> None:
# def reportException(exception: Type[BaseException], text: str) -> NoReturn:
# def reportWarning(_exception: Type[BaseException], text: str) -> None:
# def getErrorReporter(reportingMode: Literal["silence", "warning", "error"]):
# def checkIsUndershoot(time: float, referenceTime: float, errorReporter) -> bool:
# def checkIsOvershoot(time: float, referenceTime: float, errorReporter) -> bool:
# def validateOption(variableName, value, optionClass):
# def intervalOverlapCheck(
#     interval: Interval,
#     cmprInterval: Interval,
#     percentThreshold: float = 0,
#     timeThreshold: float = 0,
#     boundaryInclusive: bool = False,
# ) -> bool:
# def getIntervalsInInterval(
#     start: float,
#     end: float,
#     intervals: List[Interval],
#     mode: Literal["strict", "lax", "truncated"],
# ) -> List[Interval]:
# def escapeQuotes(text: str) -> str:
# def strToIntOrFloat(inputStr: str) -> float:
# def getValueAtTime(
#     timestamp: float,
#     sortedDataTupleList: List[Tuple[Any, ...]],
#     fuzzyMatching: bool = False,
#     startI: int = 0,
# ) -> Tuple[Tuple[Any, ...], int]:
# def getValuesInInterval(dataTupleList: List, start: float, end: float) -> List:
# def sign(x: float) -> int:
# def invertIntervalList(
#     inputList: List[Tuple[float, float]], minValue: float = None, maxValue: float = None
# ) -> List[Tuple[float, float]]:
# def makeDir(path: str) -> None:
# def findAll(txt: str, subStr: str) -> List[int]:
# def runPraatScript(
#     praatEXE: str, scriptFN: str, argList: List[Any], cwd: str = None
# ) -> None:
# def safeZip(listOfLists: List[list], enforceLength: bool) -> Iterator[Any]:
# def getWavDuration(wavFN: str) -> float:
# 
# Path: praatio/utilities/errors.py
# class PraatioException(Exception):
# class SafeZipException(PraatioException):
# class FileNotFound(PraatioException):
# class ParsingError(PraatioException):
# class ArgumentError(PraatioException):
# class UnexpectedError(PraatioException):
# class WrongOption(PraatioException):
# class TextgridException(PraatioException):
# class DuplicateTierName(TextgridException):
# class OutOfBounds(TextgridException):
# class CollisionError(TextgridException):
# class TimelessTextgridTierException(TextgridException):
# class TextgridStateAutoModified(TextgridException):
# class TextgridStateError(TextgridException):
# class TierNameExistsError(TextgridException):
# class IncompatibleTierError(TextgridException):
# class PraatExecutionFailed(PraatioException):
# class EndOfAudioData(PraatioException):
# class FindZeroCrossingError(PraatioException):
# class NormalizationException(PraatioException):
#     def __init__(self, fullPath: str):
#     def __str__(self):
#     def __init__(self, argumentName: str, givenValue: str, availableOptions: List[str]):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self, tier):
#     def __str__(self):
#     def __init__(self, cmdList: List[str]):
#     def __str__(self):
#     def __init__(self, startTime: float, endTime: float):
#     def __str__(self):
#     def __str__(self):


# Path: tests/utilities/test_utils.py
import unittest
from praatio.utilities import utils
from praatio.utilities import errors




class TestUtils(unittest.TestCase):
    def test_interval_overlap_check_using_time_threshold_flag(self):
        self.assertTrue(utils.intervalOverlapCheck([0, 5], [2, 7]))
        self.assertTrue(utils.intervalOverlapCheck([0, 5], [2, 7], timeThreshold=3))
        self.assertFalse(utils.intervalOverlapCheck([0, 5], [2, 7], timeThreshold=4))

    def test_interval_overlap_check_using_precent_threshold_flag(self):
        self.assertTrue(utils.intervalOverlapCheck([0, 100], [50, 100]))
        self.assertTrue(

            utils.intervalOverlapCheck([0, 100], [50, 100], percentThreshold=0.5)