# Path: uchroma/traits.py
# def get_args_dict(obj: HasTraits, incl_all=False):
#     """
#     Return a dict of user-configurable traits for an object
# 
#     :param obj: an instance of HasTraits
#     :param incl_all: If all items should be included, regardless of RO status
#     :return: dict of arguments
#     """
#     argsdict = ArgsDict()
#     for k in sorted(obj._trait_values.keys()):
#         v = obj._trait_values[k]
#         trait = obj.traits()[k]
#         if incl_all or (not trait.get_metadata('hidden') and is_trait_writable(trait)):
#             argsdict[k] = v
#     return argsdict
# 
# Path: uchroma/util.py
# def camel_to_snake(name: str) -> str:
#     """
#     Returns a snake_case_name from a CamelCaseName
#     """
#     s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()


import functools
import inspect
import re
from abc import abstractmethod
from frozendict import frozendict
from traitlets import Bool, HasTraits, Instance, Tuple, Unicode
from uchroma.traits import get_args_dict
from uchroma.util import camel_to_snake
    def get_fx(self, fx_name) -> BaseFX:
        """
        Get the requested effects implementation.

        Returns the last active object if appropriate.

        :param fx_name: The string name of the effect object
        """
        if self.current_fx[0] == fx_name:
            return self.current_fx[1]

        return self._fxmod.create_fx(fx_name)


    def disable(self) -> bool:
        if 'disable' in self.available_fx:
            return self.activate('disable')
        return False


    def _activate(self, fx_name, fx, future=None):
        # need to do this as a callback if an animation
        # is shutting down
        if fx.apply():
            if fx_name != self.current_fx[0]:
                self.current_fx = (fx_name, fx)
            if fx_name == CUSTOM:
                return True

            self._driver.preferences.fx = fx_name

# Path: uchroma/traits.py
# def get_args_dict(obj: HasTraits, incl_all=False):
#     """
#     Return a dict of user-configurable traits for an object
# 
#     :param obj: an instance of HasTraits
#     :param incl_all: If all items should be included, regardless of RO status
#     :return: dict of arguments
#     """
#     argsdict = ArgsDict()
#     for k in sorted(obj._trait_values.keys()):
#         v = obj._trait_values[k]
#         trait = obj.traits()[k]
#         if incl_all or (not trait.get_metadata('hidden') and is_trait_writable(trait)):
#             argsdict[k] = v
#     return argsdict
# 
# Path: uchroma/util.py
# def camel_to_snake(name: str) -> str:
#     """
#     Returns a snake_case_name from a CamelCaseName
#     """
#     s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
#     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()


# Path: uchroma/server/fx.py
import functools
import inspect
import re
from abc import abstractmethod
from frozendict import frozendict
from traitlets import Bool, HasTraits, Instance, Tuple, Unicode
from uchroma.traits import get_args_dict
from uchroma.util import camel_to_snake

    def get_fx(self, fx_name) -> BaseFX:
        """
        Get the requested effects implementation.

        Returns the last active object if appropriate.

        :param fx_name: The string name of the effect object
        """
        if self.current_fx[0] == fx_name:
            return self.current_fx[1]

        return self._fxmod.create_fx(fx_name)


    def disable(self) -> bool:
        if 'disable' in self.available_fx:
            return self.activate('disable')
        return False


    def _activate(self, fx_name, fx, future=None):
        # need to do this as a callback if an animation
        # is shutting down
        if fx.apply():
            if fx_name != self.current_fx[0]:
                self.current_fx = (fx_name, fx)
            if fx_name == CUSTOM:
                return True

            self._driver.preferences.fx = fx_name

            argsdict = get_args_dict(fx)