code: def get_associated_resource(self, task):
          
  
          if not task:
              raise HPOneViewUnknownType(MSG_INVALID_TASK)
  
          if task['category'] != 'tasks' and task['category'] != 'backups':
              # it is an error if type is not in obj, so let the except flow
              raise HPOneViewUnknownType(MSG_UNKNOWN_OBJECT_TYPE)
  
          if task['type'] == 'TaskResourceV2':
              resource_uri = task['associatedResource']['resourceUri']
  
              if resource_uri and resource_uri.startswith("/rest/appliance/support-dumps/"):
                  # Specific for support dumps
                  return task, resource_uri
  
          elif task['type'] == 'BACKUP':
              task = self._connection.get(task['taskUri'])
              resource_uri = task['uri']
          else:
              raise HPOneViewInvalidResource(MSG_TASK_TYPE_UNRECONIZED % task['type'])
  
          entity = {}
  
          if resource_uri:
              entity = self._connection.get(resource_uri)
  
          return task, entity
docs: Retrieve a resource associated with a task.
  
          Args:
              task: task dict
  
          Returns:
              tuple: task (updated), the entity found (dict)