... )
Step 2: Create a diagnostic engine. >>> engine = DiagnosticEngine()
Step 3: Start a new diagnostic context. >>> with
   engine.create_diagnostic_context("torch.onnx.export",
   version="1.0") as context: ...     ...
Step 4: Add diagnostics in your code. ...
   context.diagnose(rules.rule1, infra.Level.ERROR)
Step 5: Afterwards, get the SARIF log. >>> sarif_log =
   engine.sarif_log()
clear()
  Clears all diagnostic contexts.

create_diagnostic_context(name, version, options=None, diagnostic_type=)
  Creates a new diagnostic context.

  Parameters:
     * **name** (*str*) -- The subject name for the diagnostic
       context.

     * **version** (*str*) -- The subject version for the
       diagnostic context.

     * **options** (*Optional**[**DiagnosticOptions**]*) -- The
       options for the diagnostic context.

  Returns:
     A new diagnostic context.
