class_docstr: Wrapper class for the basic BlueFog API.
class_docstr_tok: ["Wrapper","class","for","the","basic","BlueFog","API","."]
docstr: Context manager for activating timeline record.
  If you want to use this function, please make sure to turn on the timeline first by
  setting the ENV variable BLUEFOG_TIMELINE = {file_name}, or use
  bfrun --timeline-filename {file_name} ...
  
  Args:
      tensor_name (str): The activity associated tensor name.
      activity_name (str): The activity type.
  
  Example:
      >>> with bf.timeline_context(tensor_name, activity_name):
      >>>     time.sleep(1.0)
docstr_tok: ["Context","manager","for","activating","timeline","record",".","If","you","want","to","use","this","function",",","please","make","sure","to","turn","on","the","timeline","first","by","setting","the","ENV","variable","BLUEFOG_TIMELINE","=","{","file_name","}",",","or","use","bfrun","--","timeline-filename","{","file_name","}","...","Args",":","tensor_name","(","str",")",":","The","activity","associated","tensor","name",".","activity_name","(","str",")",":","The","activity","type",".","Example",":",">",">",">","with","bf.timeline_context","(","tensor_name",",","activity_name",")",":",">",">",">","time.sleep","(","1.0",")"]
code: def timeline_context(self, tensor_name: str, activity_name: str):
      """Context manager for activating timeline record.
      If you want to use this function, please make sure to turn on the timeline first by
      setting the ENV variable BLUEFOG_TIMELINE = {file_name}, or use
      bfrun --timeline-filename {file_name} ...
  
      Args:
          tensor_name (str): The activity associated tensor name.
          activity_name (str): The activity type.
  
      Example:
          >>> with bf.timeline_context(tensor_name, activity_name):
          >>>     time.sleep(1.0)
      """
      self.timeline_start_activity(tensor_name, activity_name)
      try:
          yield
      finally:
          self.timeline_end_activity(tensor_name)
  
imports: from typing import List, Callable, Optional
  import atexit
  import contextlib
  import ctypes
  import logging
  import networkx
  import bluefog.common.util
  import bluefog.common.topology_util
label_desc: Use image node_id 28 for calling the BlueFogBasics obj's underlying member method code with example usage: obj.timeline_context(tensor_name, activity_name) without return types