docstr: Get Assets by an Action ID
docstr_tok: ["Get","Assets","by","an","Action","ID"]
code: def get_assets_by_action_id(
      self, context: AuthedServiceContext, uid: UID
  ) -> Union[List[Asset], SyftError]:
      """Get Assets by an Action ID"""
      datasets = self.get_by_action_id(context=context, uid=uid)
      assets = []
      if isinstance(datasets, list):
          for dataset in datasets:
              for asset in dataset.asset_list:
                  if asset.action_id == uid:
                      assets.append(asset)
          return assets
      elif isinstance(datasets, SyftError):
          return datasets
      return []
  
imports: from collections.abc import Collection
  from typing import List
  from typing import Optional
  from typing import Union
  from ...serde.serializable import serializable
  from ...store.document_store import DocumentStore
  from ...types.dicttuple import DictTuple
  from ...types.uid import UID
  from ...util.telemetry import instrument
  from ..action.action_permissions import ActionObjectPermission
  from ..action.action_permissions import ActionPermission
  from ..context import AuthedServiceContext
  from ..response import SyftError
  from ..response import SyftSuccess
  from ..service import AbstractService
  from ..service import SERVICE_TO_TYPES
  from ..service import TYPE_TO_SERVICE
  from ..service import service_method
  from ..user.user_roles import DATA_OWNER_ROLE_LEVEL
  from ..user.user_roles import DATA_SCIENTIST_ROLE_LEVEL
  from ..user.user_roles import GUEST_ROLE_LEVEL
  from ..warnings import CRUDReminder
  from ..warnings import HighSideCRUDWarning
  from .dataset import Asset
  from .dataset import CreateDataset
  from .dataset import Dataset
  from .dataset import DatasetPageView
  from .dataset_stash import DatasetStash
label_desc: Use image node_id 7 for calling the DatasetService obj's underlying member method code with example usage: obj.get_assets_by_action_id(context, uid) and returns: list, assets, datasets