Absolutely! Here is your Bash script written in a Python.
```
import os
import shutil
import mimetypes
from pathlib import Path

# Set the input folder (defaults to ~/Downloads)
input_folder = Path(os.environ.get('1', os.path.join(os.environ['HOME'], 'Downloads')))

# Create category folders if they don't exist
(input_folder / 'Documents').mkdir(exist_ok=True)
(input_folder / 'Torrents').mkdir(exist_ok=True)
(input_folder / 'Music').mkdir(exist_ok=True)
(input_folder / 'Videos').mkdir(exist_ok=True)
(input_folder / 'Programs').mkdir(exist_ok=True)

# Move files to respective category folders
for file in input_folder.glob('*'):
    if file.is_file():
        mime_type, _ = mimetypes.guess_type(file)
        if mime_type:
            if mime_type.startswith('application/pdf') or mime_type.startswith('text'):
                shutil.move(str(file), str(input_folder / 'Documents'))
            elif mime_type.startswith('application/x-bittorrent'):
                shutil.move(str(file), str(input_folder / 'Torrents'))
            elif mime_type.startswith('audio') or mime_type.endswith('/ogg'):
                shutil.move(str(file), str(input_folder / 'Music'))
            elif mime_type.startswith('video'):
                shutil.move(str(file), str(input_folder / 'Videos'))
            elif mime_type.startswith('application'):
                shutil.move(str(file), str(input_folder / 'Programs'))
```
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence