code: def test_list(action_objs, sagemaker_session):
      slack = datetime.timedelta(minutes=1)
      now = datetime.datetime.now(datetime.timezone.utc)
      action_names = [actn.action_name for actn in action_objs]
  
      for sort_order in ["Ascending", "Descending"]:
          action_names_listed = [
              action_listed.action_name
              for action_listed in action.Action.list(
                  created_after=now - slack,
                  created_before=now + slack,
                  sort_by="CreationTime",
                  sort_order=sort_order,
                  sagemaker_session=sagemaker_session,
              )
              if action_listed.action_name in action_names
          ]
  
      if sort_order == "Descending":
          action_names_listed = action_names_listed[::-1]
      assert action_names == action_names_listed
      # sanity check
      assert action_names
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/lineage/test_action.py
imports: from __future__ import absolute_import
  import datetime
  import logging
  import time
  import pytest
  from sagemaker.lineage import action
  from sagemaker.lineage.query import LineageQueryDirectionEnum
label_desc: Use image node_id 5 for calling a global function with example usage: test_list(action_objs, sagemaker_session) without return types