<commit_before>import os, sys
import stat
from subprocess import call
import shutil
import pathlib

from .utils import get_environment_label


PATH = f"{sys.exec_prefix}/bin"
CONDA_ENV_LABEL = get_environment_label()


def get_script(python_exec, path, terminal):
    script = \
f"""#!{python_exec}

import sys
import os.path
import subprocess

folders = [path for path in sys.argv[1:] if os.path.isdir(path)]
any_file_selected = len(folders) < len(sys.argv[1:])
if any_file_selected:
    subprocess.Popen(["{path}/jupyter-{terminal}"])
for folder in folders:
    os.chdir(folder)
    subprocess.Popen(["{path}/jupyter-{terminal}"])
    os.chdir("..")

"""
    return script

def get_desktop(path, terminal, logo, shortcut_name):<commit_msg>Unlike nautilus, in caja the shortcuts are available when nothing is selected and the scripts was broken because the folders list was empty.<commit_after>import os, sys
import stat
from subprocess import call
import shutil
import pathlib

from .utils import get_environment_label


PATH = f"{sys.exec_prefix}/bin"
CONDA_ENV_LABEL = get_environment_label()


def get_script(python_exec, path, terminal):
    script = \
f"""#!{python_exec}

import sys
import os.path
import subprocess

folders = [path for path in sys.argv[1:] if os.path.isdir(path)]
any_file_selected = len(folders) < len(sys.argv[1:])
if any_file_selected or len(folders) == 0:
    subprocess.Popen(["{path}/jupyter-{terminal}"])
for folder in folders:
    os.chdir(folder)
    subprocess.Popen(["{path}/jupyter-{terminal}"])
    os.chdir("..")

"""
    return script

def get_desktop(path, terminal, logo, shortcut_name):
{'fraction_non_alphanumeric': 0.12392638036809817, 'fraction_numerical': 0.003067484662576687, 'mean_word_length': 5.085820895522388, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7526036', 'n_tokens_mistral': 573, 'n_tokens_neox': 547, 'n_words': 146}