code: async def wait_for_action(self, action_id):
          
  
          if action_id.startswith("action-"):
              # if we've been passed action.tag, transform it into the
              # id that the api deltas will use.
              action_id = action_id[7:]
  
          def predicate(delta):
              return delta.data['status'] in ('completed', 'failed')
  
          return await self._wait('action', action_id, None, predicate)
docs: Given an action, wait for it to complete.