def add_component(self, namespace, component_type, definition, overwrite=False):
      """
      Install a component definition into an actor store
      namespace is relative to config parameter actor_paths
      component_type is the "class" name and must be unique wrt namespace
      definition is the component definition as derived by the compiler
      Returns True on success, False otherwise
      """
      # Find place to store component based on namespace
      paths = self.paths_for_module(namespace)
      if not paths:
          _log.error('namespace creation not implemented: %s' % namespace)
          return False
      qualified_name = namespace + "." % component_type
      found, is_primitive, _ = self.lookup(qualified_name)
      if found and is_primitive:
          _log.error("Can't overwrite actor: %s" % qualified_name)
          return False
      if found and not overwrite:
          _log.error("Can't overwrite existing component (overwrite=%s): %s" % (overwrite, qualified_name))
          return False

      filename = component_type + ".comp"
      filepath = os.path.join(paths[0], filename)
      comp = {'type':component_type, 'definition':definition}

      try:
        with open(filepath, 'w') as f:
          json.dump(comp, f)
      except Exception as e:
         _log.exception("Could not write component to: %s" % filepath)
         return False
      return True
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/actorstore/store.py/ActorStore.add_component/operator `+` -> `%`