def _load_actor_from_local(self, driver_id, function_descriptor):
        """Load actor class from local code."""
        module_name, class_name = (function_descriptor.module_name,
                                   function_descriptor.class_name)
        try:
            module = importlib.import_module(module_name)
            actor_class = getattr(module, class_name)
            if isinstance(actor_class, ray.actor.ActorClass):
                return actor_class._modified_class
            else:
                return actor_class
        except Exception:
            logger.exception(
                "Failed to load actor_class %s.".format(class_name))
            raise Exception(
                "Actor {} failed to be imported from local code.".format(
                    class_name))
Load actor class from local code.