<commit_before>from view_common import *
from core.xoslib.objects.sliceplus import SlicePlus

class DownloadSSHCommandsView(View):
    url = r'^sshcommands/(?P<sliceid>\d+)/$'

    def get(self, request, sliceid=None, **kwargs):
        #slice = Slices.objects.get(id=sliceid);
        #for sliver in slice.slivers.all():
        #    if (sliver.instance_id && sliver.instance_name):

        slice = SlicePlus.objects.get(id=sliceid)


        return HttpResponse(slice.getSliceInfo()["sshCommands"], content_type='text/text')

<commit_msg>download_ssh_commands view, deprecated<commit_after>from view_common import *
from core.xoslib.objects.sliceplus import SlicePlus

# This was intended to serve as a download feature for the tenant view. Found
# a better way to do it. This is deprecated.

class DownloadSSHCommandsView(View):
    url = r'^sshcommands/(?P<sliceid>\d+)/$'

    def get(self, request, sliceid=None, **kwargs):
        #slice = Slices.objects.get(id=sliceid);
        #for sliver in slice.slivers.all():
        #    if (sliver.instance_id && sliver.instance_name):

        slice = SlicePlus.objects.get(id=sliceid)

        return HttpResponse(slice.getSliceInfo()["sshCommands"], content_type='text/text')


{'fraction_non_alphanumeric': 0.12682926829268293, 'fraction_numerical': 0.0, 'mean_word_length': 3.9437751004016066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7388832', 'n_tokens_mistral': 403, 'n_tokens_neox': 389, 'n_words': 85}