docs: def freeze(script_path, target_dir='frozen', **kw):
      """Wraps pyinstaller and provides an easy to use interface
  
      Args:
          script_path: Absolute path to python script to be frozen.
  
      Returns:
          List of freeze commands ran
  
      Raises:
          subprocess.CalledProcessError: Freeze error.
          OSError: Freeze not found.
      """
      cmds = []
      freeze_start_time = time.time()
      logging.debug('/\\%s%s Output%s/\\' % ('-' * 10, 'Pyinstaller', '-' * 10))
      orig_dir = os.path.abspath('.')
      script_path = os.path.abspath(script_path)
      try:
          os.chdir(target_dir)
          cmds += _freeze_config()
          pyinst_path = '%s/thirdparty/pyinstaller' % __path__[0]
          cur_cmd = 'python -O %s/pyinstaller.py %s --skip-configure' % (pyinst_path, script_path)
          cmds.append(cur_cmd)
          if _run(cur_cmd):  # If there is a problem, try removing the config and re-doing
              _freeze_config(force=True)
              cur_cmd = 'python -O %s/pyinstaller.py %s' % (pyinst_path, script_path)
              _run(cur_cmd)
      finally:
          os.chdir(orig_dir)
      logging.debug('\\/%s%s Output%s\\/' % ('-' * 10, 'Pyinstaller', '-' * 10))
      logging.info('Pyinstaller took [%f] seconds' % (time.time() - freeze_start_time))
      return cmds