code: def guess_worker_impl(link):
      
      worker_impls = []
      task = link.task
      name = link.name
      errors = []
  
      if task['payload'].get("image"):
          worker_impls.append("docker-worker")
      if task['provisionerId'] in link.context.config['scriptworker_provisioners']:
          worker_impls.append("scriptworker")
      if task['workerType'] in link.context.config['scriptworker_worker_types']:
          worker_impls.append("scriptworker")
      if task['payload'].get("mounts") is not None:
          worker_impls.append("generic-worker")
      if task['payload'].get("osGroups") is not None:
          worker_impls.append("generic-worker")
      if task.get('tags', {}).get("worker-implementation", {}):
          worker_impls.append(task['tags']['worker-implementation'])
  
      for scope in task['scopes']:
          if scope.startswith("docker-worker:"):
              worker_impls.append("docker-worker")
  
      if not worker_impls:
          errors.append("guess_worker_impl: can't find a worker_impl for {}!\n{}".format(name, task))
      if len(set(worker_impls)) > 1:
          errors.append("guess_worker_impl: too many matches for {}: {}!\n{}".format(name, set(worker_impls), task))
      raise_on_errors(errors)
      log.debug("{} {} is {}".format(name, link.task_id, worker_impls[0]))
      return worker_impls[0]
docs: Given a task, determine which worker implementation (e.g., docker-worker) it was run on.
  
      * check for the `worker-implementation` tag
      * docker-worker: ``task.payload.image`` is not None
      * check for scopes beginning with the worker type name.
      * generic-worker: ``task.payload.osGroups`` is not None
      * generic-worker: ``task.payload.mounts`` is not None
  
      Args:
          link (LinkOfTrust or ChainOfTrust): the link to check.
  
      Returns:
          str: the worker type.
  
      Raises:
          CoTError: on inability to determine the worker implementation