# Path: flowpipe/utilities.py
# def get_hash(obj, hash_func=lambda x: sha256(x).hexdigest()):
#     """Safely get the hash of an object.
# 
#     This function tries to compute the hash as safely as possible, dealing with
#     json data and strings in a well-defined manner.
# 
#     Args:
#         obj: The object to hash
#         hash_func (func(obj) -> str): The hashing function to use
# 
#     Returns:
#         (str): A hash of the obj
# 
#     """
#     try:
#         return hash_func(obj)
#     except (TypeError, ValueError):
#         try:
#             js = json.dumps(obj, sort_keys=True)
#         except TypeError:  # pragma: no cover
#             pass
#         else:
#             obj = js
#         if isinstance(obj, str):
#             return hash_func(obj.encode("utf-8"))
#         if sys.version_info.major > 2:  # pragma: no cover
#             try:
#                 return hash_func(bytes(obj))
#             except TypeError:
#                 return None
#         else:
#             return None


import sys
import warnings
from abc import abstractmethod
from .utilities import get_hash
    from collections import OrderedDict
    from ordereddict import OrderedDict
        self._is_dirty = True

    def __rshift__(self, other):
        """Create a connection to the given IPlug.

        Args:
            other (IPlug): The IPlug to connect to.
        """
        warnings.warn(
            "Use the connect method instead", DeprecationWarning, stacklevel=2
        )
        self.connect(other)

    def __lshift__(self, other):
        """Break a connection to the given IPlug.

        Args:
            other (IPlug): The IPlug to disconnect.
        """
        warnings.warn(
            "Use the disconnect method instead",
            DeprecationWarning,
            stacklevel=2,
        )
        self.disconnect(other)

    # Extra function to make re-use in subclasses easier
    def _update_value(self, value):
        """Update the internal value."""
        old_hash = get_hash(self._value)

# Path: flowpipe/utilities.py
# def get_hash(obj, hash_func=lambda x: sha256(x).hexdigest()):
#     """Safely get the hash of an object.
# 
#     This function tries to compute the hash as safely as possible, dealing with
#     json data and strings in a well-defined manner.
# 
#     Args:
#         obj: The object to hash
#         hash_func (func(obj) -> str): The hashing function to use
# 
#     Returns:
#         (str): A hash of the obj
# 
#     """
#     try:
#         return hash_func(obj)
#     except (TypeError, ValueError):
#         try:
#             js = json.dumps(obj, sort_keys=True)
#         except TypeError:  # pragma: no cover
#             pass
#         else:
#             obj = js
#         if isinstance(obj, str):
#             return hash_func(obj.encode("utf-8"))
#         if sys.version_info.major > 2:  # pragma: no cover
#             try:
#                 return hash_func(bytes(obj))
#             except TypeError:
#                 return None
#         else:
#             return None


# Path: flowpipe/plug.py
import sys
import warnings
from abc import abstractmethod
from .utilities import get_hash
    from collections import OrderedDict
    from ordereddict import OrderedDict

        self._is_dirty = True

    def __rshift__(self, other):
        """Create a connection to the given IPlug.

        Args:
            other (IPlug): The IPlug to connect to.
        """
        warnings.warn(
            "Use the connect method instead", DeprecationWarning, stacklevel=2
        )
        self.connect(other)

    def __lshift__(self, other):
        """Break a connection to the given IPlug.

        Args:
            other (IPlug): The IPlug to disconnect.
        """
        warnings.warn(
            "Use the disconnect method instead",
            DeprecationWarning,
            stacklevel=2,
        )
        self.disconnect(other)

    # Extra function to make re-use in subclasses easier
    def _update_value(self, value):
        """Update the internal value."""
        old_hash = get_hash(self._value)

        new_hash = get_hash(value)