# Path: hypebot/core/params_lib.py
# def _ParseChannel(channel):
# def _ParseChannels(channels):
#   def __init__(self, defaults=None):
#   def __str__(self):
#   def Override(self, params):
#   def _AssignValueConvertDict(self, key, value):
#   def _ParseDict(self, params):
#   def __setattr__(self, key, value):
#   def get(self, key, default_value=None):  # pylint: disable=invalid-name
#   def AsDict(self):
#   def Lock(self):
#   def _RaiseIfLocked(self):
# def MergeParams(defaults, *overrides):
# class HypeParams(object):
#   SPECIAL_ATTRS = ['_locked']
#   HAS_DYNAMIC_ATTRIBUTES = True


from typing import Text
from hypebot.core import params_lib
from __future__ import unicode_literals




class Factory(object):
  """Allows creation of magical goodness from strings."""

  def __init__(self, base_class, register_internal_nodes=False):
    self._base_class = base_class
    self._register_internal_nodes = register_internal_nodes
    self._registrar = {}

  def _Register(self, klass, register_internal_nodes):
    """Recursively register all valid subclasses of the klass."""
    for subclass in klass.__subclasses__():
      if register_internal_nodes or not subclass.__subclasses__():
        self._registrar[subclass.__name__] = subclass
      if subclass.__subclasses__():
        self._Register(subclass, register_internal_nodes)

  def Create(self, name: Text, *args, **kwargs):
    if name not in self._registrar:
      # Last minute re-registration to avoid import order issues.
      self._Register(self._base_class, self._register_internal_nodes)
      if name not in self._registrar:
        raise ValueError('Name %s does not exist in the registrar.' % name)
    return self._registrar[name](*args, **kwargs)

  def CreateFromParams(self,

# Path: hypebot/core/params_lib.py
# def _ParseChannel(channel):
# def _ParseChannels(channels):
#   def __init__(self, defaults=None):
#   def __str__(self):
#   def Override(self, params):
#   def _AssignValueConvertDict(self, key, value):
#   def _ParseDict(self, params):
#   def __setattr__(self, key, value):
#   def get(self, key, default_value=None):  # pylint: disable=invalid-name
#   def AsDict(self):
#   def Lock(self):
#   def _RaiseIfLocked(self):
# def MergeParams(defaults, *overrides):
# class HypeParams(object):
#   SPECIAL_ATTRS = ['_locked']
#   HAS_DYNAMIC_ATTRIBUTES = True


# Path: hypebot/core/factory_lib.py
from typing import Text
from hypebot.core import params_lib

from __future__ import unicode_literals




class Factory(object):
  """Allows creation of magical goodness from strings."""

  def __init__(self, base_class, register_internal_nodes=False):
    self._base_class = base_class
    self._register_internal_nodes = register_internal_nodes
    self._registrar = {}

  def _Register(self, klass, register_internal_nodes):
    """Recursively register all valid subclasses of the klass."""
    for subclass in klass.__subclasses__():
      if register_internal_nodes or not subclass.__subclasses__():
        self._registrar[subclass.__name__] = subclass
      if subclass.__subclasses__():
        self._Register(subclass, register_internal_nodes)

  def Create(self, name: Text, *args, **kwargs):
    if name not in self._registrar:
      # Last minute re-registration to avoid import order issues.
      self._Register(self._base_class, self._register_internal_nodes)
      if name not in self._registrar:
        raise ValueError('Name %s does not exist in the registrar.' % name)
    return self._registrar[name](*args, **kwargs)

  def CreateFromParams(self,

                       params: params_lib.HypeParams,