code: def is_run_trial_component(
      trial_component_name: str, sagemaker_session: Session
  ) -> bool:
      """Check if a trial component is generated by `sagemaker.experiments.Run`
  
      Args:
          trial_component_name (str): The name of the trial component.
          sagemaker_session (sagemaker.session.Session): Session object which
              manages interactions with Amazon SageMaker APIs and any other
              AWS services needed. If not specified, one is created using the
              default AWS configuration chain.
  
      Returns:
          bool: Indicate whether the trial component is created by
              `sagemaker.experiments.Run` or not.
      """
      search_filter = Filter(
          name="TrialComponentName",
          operator=Operator.EQUALS,
          value=trial_component_name,
      )
      search_expression = SearchExpression(filters=[search_filter])
  
      def search():
          return list(
              _TrialComponent.search(
                  search_expression=search_expression,
                  max_results=1,  # TrialComponentName is unique in an account
                  sagemaker_session=sagemaker_session,
              )
          )[0]
  
      try:
          tc_search_res = retry_with_backoff(search, 4)
          from sagemaker.experiments.run import RUN_TC_TAG
  
          if (
              not tc_search_res.tags
              or RUN_TC_TAG not in tc_search_res.tags
          ):
              return False
          return True
      except Exception as ex:  # pylint: disable=broad-except
          logging.warning(
              "Failed to inspect the type of the trial component (%s), due to (%s)",
              trial_component_name,
              str(ex),
          )
          return False
  
imports: from __future__ import absolute_import
  import logging
  import os
  import mimetypes
  import urllib
  from functools import wraps
  from typing import Optional
  from sagemaker import Session
  from sagemaker.apiutils import _utils
  from sagemaker.experiments._environment import _RunEnvironment, _EnvironmentType
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.utilities.search_expression import Filter, Operator, SearchExpression
  from sagemaker.utils import retry_with_backoff
label_desc: Use image node_id 8 for calling a global function with example usage: is_run_trial_component(trial_component_name, sagemaker_session) and returns: list, True, False, False