def close_statement(self, snippet):
    api = get_spark_api(self.user)

    session_id = snippet['result']['handle']['id']
    if session_id not in None:
      api.close_batch(session_id)
      return {
        'session': session_id,
        'status': 0
      }
    else:
      return {'status': -1}  # skipped
dataset/ETHPy150Open cloudera/hue/desktop/libs/notebook/src/notebook/connectors/spark_batch.py/SparkBatchApi.close_statement/operator `is not` -> `not in`