def index(self, req, server_id):
        context = _authorize_context(req)

        self.security_group_api.ensure_default(context)

        with translate_exceptions():
            instance = common.get_instance(self.compute_api, context,
                                           server_id)
            groups = self.security_group_api.get_instance_security_groups(
                context, instance, True)

        result = [self._format_security_group(context, group)
                    for group in groups]

        return {'security_groups':
                list(sorted(result,
                            key=lambda k: (k['tenant_id'], k['name'])))}
Reads an URL from disk and returns the parsed news story.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/legacy_v2/contrib/security_groups.py/ServerSecurityGroupController.index--crossover with--dataset/ETHPy150Open deepmind/rc-data/generate_questions.py/StoreMapper