class_docstr: Runtime environment for all triggers.
  
  Mainly runs inside its own thread, where it hands control off to an asyncio
  event loop, but is also sometimes interacted with from the main thread
  (where all the DB queries are done). All communication between threads is
  done via Deques.
docstr: Convert a Trigger row into a Trigger instance.
docstr_tok: ["Convert","a","Trigger","row","into","a","Trigger","instance","."]
code: def trigger_row_to_trigger_instance(
      self, trigger_row: Trigger, trigger_class: type[U]
  ) -> U:
      """Convert a Trigger row into a Trigger instance."""
      from airflow.models.crypto import get_fernet
  
      decrypted_kwargs = {}
      fernet = get_fernet()
      for k, v in trigger_row.kwargs.items():
          if k.startswith(ENCRYPTED_KWARGS_PREFIX):
              decrypted_kwargs[
                  k[len(ENCRYPTED_KWARGS_PREFIX) :]
              ] = fernet.decrypt(v.encode("utf-8")).decode("utf-8")
          else:
              decrypted_kwargs[k] = v
      return trigger_class(**decrypted_kwargs)
  
imports: from __future__ import annotations
  import asyncio
  import logging
  import os
  import signal
  import sys
  import threading
  import time
  import warnings
  from collections import deque
  from contextlib import suppress
  from copy import copy
  from queue import SimpleQueue
  from typing import TYPE_CHECKING, TypeVar
  from sqlalchemy import func, select
  from airflow.configuration import conf
  from airflow.jobs.base_job_runner import BaseJobRunner
  from airflow.jobs.job import perform_heartbeat
  from airflow.models.trigger import ENCRYPTED_KWARGS_PREFIX, Trigger
  from airflow.stats import Stats
  from airflow.triggers.base import BaseTrigger, TriggerEvent
  from airflow.typing_compat import TypedDict
  from airflow.utils import timezone
  from airflow.utils.log.file_task_handler import FileTaskHandler
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.log.trigger_handler import DropTriggerLogsFilter, LocalQueueHandler, TriggererHandlerWrapper, TriggerMetadataFilter, ctx_indiv_trigger, ctx_task_instance, ctx_trigger_end, ctx_trigger_id
  from airflow.utils.module_loading import import_string
  from airflow.utils.session import NEW_SESSION, provide_session
label_desc: Use image node_id 8 for calling the TriggerRunner obj's underlying member method code with example usage: obj.trigger_row_to_trigger_instance(trigger_row, trigger_class) and returns: trigger_class