# Path: pylinac/core/typing.py

# 
# Path: pylinac/version.py



import decimal
import os
import os.path as osp
import struct
import subprocess
import numpy as np
import pydicom
from collections.abc import Iterable
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Union, Sequence, Type, BinaryIO
from .typing import NumberLike
from .. import __version__
"""Utility functions for pylinac."""




def convert_to_enum(value: Union[str, Enum, None], enum: Type[Enum]) -> Enum:
    """Convert a value to an enum representation from an enum value if needed"""
    if isinstance(value, enum):
        return value
    else:
        return enum(value)


@dataclass
class ResultBase:
    pylinac_version: str = field(init=False)  #:
    date_of_analysis: datetime = field(init=False)  #:

    def __post_init__(self):

# Path: pylinac/core/typing.py

# 
# Path: pylinac/version.py



# Path: pylinac/core/utilities.py
import decimal
import os
import os.path as osp
import struct
import subprocess
import numpy as np
import pydicom
from collections.abc import Iterable
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Union, Sequence, Type, BinaryIO
from .typing import NumberLike
from .. import __version__

"""Utility functions for pylinac."""




def convert_to_enum(value: Union[str, Enum, None], enum: Type[Enum]) -> Enum:
    """Convert a value to an enum representation from an enum value if needed"""
    if isinstance(value, enum):
        return value
    else:
        return enum(value)


@dataclass
class ResultBase:
    pylinac_version: str = field(init=False)  #:
    date_of_analysis: datetime = field(init=False)  #:

    def __post_init__(self):

        self.pylinac_version = __version__