@requires_segment_info
def current_context(pl, segment_info):
 name = segment_info[u'curframe'].f_code.co_name
 if (name == u'<module>'):
  name = os.path.basename(segment_info[u'curframe'].f_code.co_filename)
 return name

@ requires_segment_info def current_context ( pl , segment_info ) : name = segment_info [ u'curframe' ] . f_code . co_name if ( name == u'<module>' ) : name = os . path . basename ( segment_info [ u'curframe' ] . f_code . co_filename ) return name
displays currently executed context name this is similar to :py:func:current_code_name .