def METHOD_NAME(work_path, out_path):
  """
  Extract the Python files that are added as paths in the output of
  a pyinstaller operation. The files are determined by reading through
  all of the *.toc files in the workpath of pyinstaller.
  The files will be copied into the out_path using a similar file path
  as they originally are. If any archive (.egg) files are present in the
  .toc files, then unzip the archives and substitute the archive for the
  unzipped content, i.e. we will extract the archives and collect the source
  files.
  """
  print('Extracts files from the pyinstaller workpath')
  file_path_set = set()
  for path1 in os.listdir(work_path):
    full_path = os.path.join(work_path, path1)
    if not os.path.isdir(full_path):
      continue
    # We have a directory
    for path2 in os.listdir(full_path):
      if not '.toc' in path2:
        continue
      full_toc_file = os.path.join(full_path, path2)
      get_all_files_from_toc(full_toc_file, file_path_set)
  for file_path in file_path_set:
    relative_src = file_path[1:] if file_path[0] == '/' else file_path
    dst_path = os.path.join(out_path, relative_src)
    os.makedirs(os.path.dirname(dst_path), exist_ok=True)
    shutil.copy(file_path, dst_path)