def _extend_shell_commands(self, name, module, version):
        classes = inspect.getmembers(module, inspect.isclass)
        for cls_name, cls in classes:
            if (issubclass(cls, client_extension.NeutronClientExtension) and
                    hasattr(cls, 'shell_command')):
                cmd = cls.shell_command
                if hasattr(cls, 'versions'):
                    if version not in cls.versions:
                        continue
                try:
                    name_prefix = "[%s]" % name
                    cls.__doc__ = ("%s %s" % (name_prefix, cls.__doc__) if
                                   cls.__doc__ else name_prefix)
                    self.command_manager.add_command(cmd, cls)
                    self.commands[version][cmd] = cls
                except __HOLE__:
                    pass
dataset/ETHPy150Open openstack/python-neutronclient/neutronclient/shell.py/NeutronShell._extend_shell_commands