text: import time
  import traceback
  from io import StringIO
  
  
  def get_exception():
      with StringIO() as io:
          traceback.print_exc(file=io)
          io.seek(0)
          content = io.read()
  
      return content
  
  
  def reg_find_one(reg, content, default=''):
      res = reg.findall(content)
      if len(res) > 0:
          return res[0]
      else:
          return default
  
  
  def time_count(func):
      def core(*args, **kwargs):
          t = time.time()
          result = func(*args, **kwargs)
          print('%s time usage: %f' % (func.__name__, time.time() - t))
          return result
  
      return core
  
  
  def compare_version(a: str, b: str, ex=False):
      sa = a.split('-')
      sb = b.split('-')
  
      if ex is False and len(sb) > 1:
          return False
      else:
          return int(sa[0].replace('.', '')) < int(sb[0].replace('.', ''))
  