user: What is Data-Blocks Previews and how is it used in Blender Python scripting?

assistant: Blender will automatically generate previews for some type of data, mainly the ones related to shading
(like images, textures, materials, lights and world shaders).

It can also store previews for scenes, collections and objects, but those need to be generated manually.

These previews can then be used by the *Thumbnail* view of the File Browser, when linking or appending data-blocks.

### Refresh Data-Block Previews

Refresh all data-block previews that can be automatically generated by Blender (shading-related ones),
in the current blend-file. You still need to save the file if you want to write them to the drive.

### Batch Generate Previews

Generate some data-block types’ previews (you can choose which in its options),
in one or more blend-files on your drive. You should not use this operator on the file currently opened in Blender.

This is currently the only way to generate and store in blend-files previews for scenes, collections and objects.
Note that since this involves a lot of rendering, even of small sizes, the process may take some time to complete.

Scenes
:   Generate previews of scenes and their collections.

Collections
:   Generate previews of collections of objects.

Objects
:   Generate previews of objects.

Materials & Textures
:   Generates previews for materials, textures, images, and other internal data.

Trusted Blend Files
:   When enabled, Python scripts and drivers that may be included in the file will be run automatically.
    Enable this only if you created the file yourself,
    or you trust that the person who gave it to you did not include any malicious code with it.
    See [Python Security](../../advanced/scripting/security.xhtml) to configure default trust options.

Save Backups
:   Keep a [backup version](../../editors/preferences/save_load.xhtml#bpy-types-preferencesfilepaths-save-version) (`blend1-file`)
    of the files when saving with generated previews.

### Clear Data-Block Previews

Clear all, a generic type of, or a specific data-block type of previews in the current blend-file.
You still need to save the file if you want to clear them from the drive.

### Batch Clear Previews

Clear some data-block types’ previews (you can choose which in its options),
in one or more blend-files on your drive. You should not use this operator on the file currently opened in Blender.

Scenes
:   Clear previews of scenes and their collections.

Collections
:   Clear previews of collections of objects.

Objects
:   Clear previews of objects.

Materials & Textures
:   Clear previews for materials, textures, images, and other internal data.

Trusted Blend Files
:   When enabled, Python scripts and drivers that may be included in the file will be run automatically.
    Enable this only if you created the file yourself,
    or you trust that the person who gave it to you did not include any malicious code with it.
    See [Python Security](../../advanced/scripting/security.xhtml) to configure default trust options.

Save Backups
:   Keep a [backup version](../../editors/preferences/save_load.xhtml#bpy-types-preferencesfilepaths-save-version) (`blend1-file`)
    of the files when saving with cleared previews.