'Function to upload the session file to Koodous'

def _upload(self):

    content_file = __sessions__.current.file.data
    if (content_file[:2] != 'PK'):
        self.log('info', 'Koodous    only    accepts    APKs,    try    with    VirusTotal.')
        return
    sha256 = hashlib.sha256(content_file).hexdigest()
    url = ('%s/%s/get_upload_url' % (cfg.koodous.koodous_url, sha256))
    headers = {'Authorization': ('Token    %s' % cfg.koodous.koodous_token)}
    response = requests.get(url=url, headers=headers)
    if (response.status_code == 200):
        upload_url = response.json().get('upload_url', None)
        files = {'file': BytesIO(__sessions__.current.file.data)}
        response = requests.post(url=upload_url, files=files)
        if (response == 200):
            self.log('File    uploaded    correctly.')
            return
    elif (response.status_code == 409):
        self.log('info', 'This    file    already    exists    in    Koodous.')
    else:
        self.log('error', 'Unknown    error,    sorry!')
