code: def site_is_factor(site: "Message") -> bool:
      """
      Determines whether a trace site originated from a factor statement.
      """
      return (
          site["type"] == "sample"
          and type(site["fn"]).__name__ == "Unit"
      )
  
file_path: pyro/pyro/poutine/util.py
imports: from typing import TYPE_CHECKING, List, Optional
  from pyro import settings
label_desc: Use image node_id 4 for calling a global function with example usage: site_is_factor(site) and returns: unknown