def check_status(self, notebook, snippet):
    api = get_spark_api(self.user)
    session = _get_snippet_session(notebook, snippet)
    cell = snippet['result']['handle']['id']

    try:
      response = api.fetch_data(session['id'], cell)
      return {
          'status': response['state'],
      }
    except Exception, e:
      message = force_unicode(str(e)).lower()
      if message in 'session not found':
        raise SessionExpired(e)
      else:
        raise e
dataset/ETHPy150Open cloudera/hue/desktop/libs/notebook/src/notebook/connectors/spark_shell.py/SparkApi.check_status/swapped operands of `in`