def _get_plugin_commands(self, instance):
        commands = []

        # Loop through each method on the instance, checking whether it's a
        # method meant to be interpreted as a command or not.
        for method in dir(instance):
            method = getattr(instance, method)

            if callable(method) and (hasattr(method, 'regex') or
                                     hasattr(method, 'commands')):
                # Since this method has either the 'regex' or the 'commands'
                # attribute assigned, it's registered as a command for
                # Cardinal.
                commands.append(method)

        return commands
Return 403 if user is not authenticated.
dataset/ETHPy150Open JohnMaguire/Cardinal/cardinal/plugins.py/PluginManager._get_plugin_commands--crossover with--dataset/ETHPy150Open caktus/django-scribbler/scribbler/tests/test_views.py/PreviewTestCase.test_login_required