# Path: pyphysim/util/conversion.py
# def single_matrix_to_matrix_of_matrices(
#         single_matrix: np.ndarray,
#         nrows: Optional[np.ndarray] = None,
#         ncols: Optional[np.ndarray] = None) -> np.ndarray:
# def dB2Linear(valueIndB: NumberOrArray) -> NumberOrArray:
# def linear2dB(valueInLinear: NumberOrArray) -> NumberOrArray:
# def dBm2Linear(valueIndBm: NumberOrArray) -> NumberOrArray:
# def linear2dBm(valueInLinear: NumberOrArray) -> NumberOrArray:
# def binary2gray(num: IntOrIntArray) -> IntOrIntArray:
# def gray2binary(num: IntOrIntArray) -> IntOrIntArray:
# def SNR_dB_to_EbN0_dB(SNR: NumberOrArray, bits_per_symb: int) -> NumberOrArray:
# def EbN0_dB_to_SNR_dB(EbN0: NumberOrArray,
#                       bits_per_symb: int) -> NumberOrArray:
#         K = ncols.size
#     K = nrows.size
#     SNR = EbN0 + 10 * np.log10(bits_per_symb)


    from matplotlib import pyplot as plt
from abc import ABCMeta, abstractmethod
from collections.abc import Iterable
from typing import Any, Optional, TypeVar, cast
from pyphysim.util import conversion
import math
import warnings
import numpy as np
            else:
                msg = ("The distance is too small to calculate a valid"
                       " path loss.")
                raise RuntimeError(msg.format(d))
        return PL

    def calc_path_loss(self, d: NumberOrArray,
                       **kargs: Any) -> NumberOrArray:  # pragma: no cover
        """
        Calculates the path loss (linear scale) for a given distance (in
        Km).

        Parameters
        ----------
        d : float | np.ndarray
            Distance (in Km)
        kargs : dict
            Extra named parameters. This is used in subclasses for extra
            parameters for the path loss calculation.

        Other Parameters
        ----------------
        kwargs : dict
            Additional keywords that might be necessary in a subclass.

        Returns
        -------
        pl : float | np.ndarray
            Path loss (in linear scale) for the given distance(s).
        """

# Path: pyphysim/util/conversion.py
# def single_matrix_to_matrix_of_matrices(
#         single_matrix: np.ndarray,
#         nrows: Optional[np.ndarray] = None,
#         ncols: Optional[np.ndarray] = None) -> np.ndarray:
# def dB2Linear(valueIndB: NumberOrArray) -> NumberOrArray:
# def linear2dB(valueInLinear: NumberOrArray) -> NumberOrArray:
# def dBm2Linear(valueIndBm: NumberOrArray) -> NumberOrArray:
# def linear2dBm(valueInLinear: NumberOrArray) -> NumberOrArray:
# def binary2gray(num: IntOrIntArray) -> IntOrIntArray:
# def gray2binary(num: IntOrIntArray) -> IntOrIntArray:
# def SNR_dB_to_EbN0_dB(SNR: NumberOrArray, bits_per_symb: int) -> NumberOrArray:
# def EbN0_dB_to_SNR_dB(EbN0: NumberOrArray,
#                       bits_per_symb: int) -> NumberOrArray:
#         K = ncols.size
#     K = nrows.size
#     SNR = EbN0 + 10 * np.log10(bits_per_symb)


# Path: pyphysim/channels/pathloss.py
    from matplotlib import pyplot as plt
from abc import ABCMeta, abstractmethod
from collections.abc import Iterable
from typing import Any, Optional, TypeVar, cast
from pyphysim.util import conversion
import math
import warnings
import numpy as np

            else:
                msg = ("The distance is too small to calculate a valid"
                       " path loss.")
                raise RuntimeError(msg.format(d))
        return PL

    def calc_path_loss(self, d: NumberOrArray,
                       **kargs: Any) -> NumberOrArray:  # pragma: no cover
        """
        Calculates the path loss (linear scale) for a given distance (in
        Km).

        Parameters
        ----------
        d : float | np.ndarray
            Distance (in Km)
        kargs : dict
            Extra named parameters. This is used in subclasses for extra
            parameters for the path loss calculation.

        Other Parameters
        ----------------
        kwargs : dict
            Additional keywords that might be necessary in a subclass.

        Returns
        -------
        pl : float | np.ndarray
            Path loss (in linear scale) for the given distance(s).
        """

        pl = conversion.dB2Linear(-self.calc_path_loss_dB(d, **kargs))