class_docstr: Profiling Task class.
  
  A task is a logical unit of work performed by a particular thread.
  Tasks can nest; thus, tasks typically correspond to functions, scopes, or a case block
  in a switch statement.
  You can use the Task API to assign tasks to threads.
  
  This is different from Frame in that all profiling statistics for passes
  through the task's begin and endpoints are accumulated together into a single statistical
  analysys, rather than a separate analysis for each pass (as with a Frame)
  
  Parameters
  ----------
  domain : Domain object
      Domain to which this object belongs
  name : string
      Name of the task
code: def __init__(self, domain, name):
      self.name = name
      self.handle = ProfileHandle()
      check_call(
          _LIB.MXProfileCreateTask(
              domain.handle, c_str(self.name), ctypes.byref(self.handle)
          )
      )
  
imports: import ctypes
  import contextlib
  import contextvars
  import warnings
  from .base import _LIB, check_call, c_str, ProfileHandle, c_str_array, py_str, KVStoreHandle
label_desc: Use image node_id 1 to create a new Task object from inherited base classes: object with example: obj = Task(domain, name)