docstr: Adds a thread flow location to the diagnostic.
docstr_tok: ["Adds","a","thread","flow","location","to","the","diagnostic","."]
code: def with_thread_flow_location(
      self: _Diagnostic, location: infra.ThreadFlowLocation
  ) -> _Diagnostic:
      """Adds a thread flow location to the diagnostic."""
      self.thread_flow_locations.append(location)
      return self
  
imports: from __future__ import annotations
  import contextlib
  import dataclasses
  import gzip
  import logging
  from typing import Callable, Generator, Generic, List, Literal, Mapping, Optional, Type, TypeVar
  from torch.onnx._internal.diagnostics import infra
  from torch.onnx._internal.diagnostics.infra import formatter, sarif, utils
  from torch.onnx._internal.diagnostics.infra.sarif import version
label_desc: Use image node_id 4 for calling the Diagnostic obj's underlying member method code with example usage: obj.with_thread_flow_location(location) and returns: self