code: def check(self, item_id):
          
          response = self._request("tasks/view/{id}".format(id=item_id))
  
          if response.status_code == 404:
              # probably an unknown task id
              return False
  
          try:
              content = json.loads(response.content.decode('utf-8'))
              status = content['task']["status"]
              if status == 'completed' or status == "reported":
                  return True
  
          except ValueError as e:
              raise sandboxapi.SandboxError(e)
  
          return False
docs: Check if an analysis is complete
  
          :type  item_id: int
          :param item_id: task_id to check.
  
          :rtype:  bool
          :return: Boolean indicating if a report is done or not.