'Function to view comments of a sample in Koodous'

def _show_comments(self):

    headers = {'Authorization': ('Token    %s' % cfg.koodous.koodous_token)}
    try:
        content_file = __sessions__.current.file.data
        sha256 = hashlib.sha256(content_file).hexdigest()
    except:
        self.log('error', 'You    have    no    file    loaded')
        return
    try:
        url = ('%s/%s/comments' % (cfg.koodous.koodous_url, sha256))
        response = requests.get(url=url, headers=headers)
        if (response.json().get('count') == 0):
            self.log('info', 'This    sample    has    no    comments.')
            return
        for result in response.json().get('results'):
            self.log('info', '[{}]:    {}'.format(result['author']['username'], result['text']))
    except:
        self.log('error', 'Network    problem,    please    try    again.')
