pyinstaller for spacy code

# HOOK FILE FOR SPACY
from PyInstaller.utils.hooks import collect_all

# ----------------------------- SPACY -----------------------------
data = collect_all('spacy')

datas = data[0]
binaries = data[1]
hiddenimports = data[2]

# ----------------------------- THINC -----------------------------
data = collect_all('thinc')

datas += data[0]
binaries += data[1]
hiddenimports += data[2]

# ----------------------------- CYMEM -----------------------------
data = collect_all('cymem')

datas += data[0]
binaries += data[1]
hiddenimports += data[2]

# ----------------------------- PRESHED -----------------------------
data = collect_all('preshed')

datas += data[0]
binaries += data[1]
hiddenimports += data[2]

# ----------------------------- BLIS -----------------------------

data = collect_all('blis')

datas += data[0]
binaries += data[1]
hiddenimports += data[2]

# ----------------------------- OTHER ----------------------------

hiddenimports += ['srsly.msgpack.util']


from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("en_core_web_sm")

Here is what the above code is Doing:
1. Collecting all the data files for spacy, thinc, cymem, preshed, blis, and other
2. Adding them to the datas variable
3. Adding all the binaries for spacy, thinc, cymem, preshed, blis, and other
4. Adding them to the binaries variable
5. Adding all the hidden imports for spacy, thinc, cymem, preshed, blis, and other
6. Adding them to the hiddenimports variable
7. Adding the en_core_web_sm data file to the datas variable