






from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
     import accelerate

def      __lowercase					( snake_case ):







    """simple docstring"""






    if not is_accelerate_available():
        return method
    __magic_name__		:Any        =      version.parse(accelerate.__version__ ).base_version
    if version.parse(snake_case ) < version.parse('''0.17.0''' ):
        return method

    def wrapper(self,  *snake_case,  **snake_case ):
        if hasattr(self,  '''_hf_hook''' ) and hasattr(self._hf_hook,  '''pre_forward''' ):
            self._hf_hook.pre_forward(self )
        return method(self,  *snake_case,  **snake_case )

    return wrapper














from __future__ import annotations

from math import pi, sqrt

def      __lowercase					( snake_case,  snake_case ):







				"""simple docstring"""






				if inductance <= 0:
								raise ValueError('''Inductance cannot be 0 or negative''' )

				elif capacitance <= 0:
								raise ValueError('''Capacitance cannot be 0 or negative''' )

				else:
								return (
								    "Resonant frequency",
								    float(1 / (2 * pi * (sqrt(inductance * capacitance ))) ),
								)


if __name__ == "__main__":
					import doctest

					doctest.testmod()






