code: def structure_discrete_hmsvm_mosek(m_data_dict=data_dict):
      import shogun as sg
  
      try:
          _ = sg.create_machine("PrimalMosekSOSVM")
      except:
          print("Mosek not available")
          return
  
      labels_array = m_data_dict["label"][0]
  
      idxs = np.nonzero(labels_array == -1)
      labels_array[idxs] = 0
  
      labels = sg.SequenceLabels(labels_array, 250, 500, 2)
      features = sg.RealMatrixFeatures(
          m_data_dict["signal"].astype(float), 250, 500
      )
  
      num_obs = 4  # given by the data file used
      model = sg.structured_model(
          "HMSVMModel",
          features=features,
          labels=labels,
          state_model_type=SMT_TWO_STATE,
          num_obs=num_obs,
      )
  
      sosvm = sg.create_machine(
          "PrimalMosekSOSVM", model=model, labels=labels
      )
      sosvm.train()
  
      predicted = sosvm.apply()
      evaluator = sg.create_evaluation("StructuredAccuracy")
      acc = evaluator.evaluate(predicted, labels)
  
label_desc: Use image node_id 1 for calling a global function with example usage: structure_discrete_hmsvm_mosek(m_data_dict) without return types