# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/10_utils.ipynb.

# %% auto 0
__all__ = ['safe_not_equal', 'retrieve_name']

# %% ../nbs/10_utils.ipynb 3
def safe_not_equal(a,b):
    "Check if `a` is not equal to `b`"
    primitive = (int, str, bool, frozenset)
    return (a != b) if isinstance(a, primitive) else True

# %% ../nbs/10_utils.ipynb 8
import inspect

# %% ../nbs/10_utils.ipynb 9
def retrieve_name(var): # From: https://stackoverflow.com/a/40536047/1344369
        """
        Gets the name of var. Does it from the out most frame inner-wards.
        :param var: variable to get name from.
        :return: string
        """
        for fi in reversed(inspect.stack()):
            names = [var_name for var_name, var_val in fi.frame.f_locals.items() if var_val is var]
            if len(names) > 0:
                return names[0]
