code: def get_caller_name(N=0, strict=True):
      
      if isinstance(N, (list, tuple)):
          name_list = []
          for N_ in N:
              try:
                  name_list.append(get_caller_name(N_))
              except AssertionError:
                  name_list.append('X')
          return '[' + ']['.join(name_list) + ']'
      # <get_parent_frame>
      parent_frame = get_stack_frame(N=N + 2, strict=strict)
      # </get_parent_frame>
      caller_name = parent_frame.f_code.co_name
      if caller_name == '<module>':
          co_filename = parent_frame.f_code.co_filename
          caller_name = splitext(split(co_filename)[1])[0]
      if caller_name == '__init__':
          co_filename = parent_frame.f_code.co_filename
          caller_name = basename(dirname(co_filename)) + '.' + caller_name
      return caller_name
docs: Standalone version of get_caller_name