code: def _is_valid_script_engine(zap, engine):
      
      engine_names = zap.script.list_engines
      short_names = [e.split(' : ')[1] for e in engine_names]
  
      return engine in engine_names or engine in short_names
docs: Check if given script engine is valid.