Create a small "IP rollout kit" with two Python utilities and a demo notebook.
The kit does NOT run heavy image/video generation here, but provides ready-to-run scripts.
Files:
tag_injector.py : add '@' alongside hashtags and (optionally) after comment # in .py and .ipynb
emoji_meme_pipeline.py : generate simple emoji memes (PNG/JPG) and optionally stitch into .mov
sample_notebook.ipynb : minimal example for testing
import json, os, textwrap, zipfile, datetime, sys, re
base = "/mnt/data/calvin_ip_rollout_kit"
os.makedirs(base, exist_ok=True)
tag_injector = r'''#!/usr/bin/env python3
"""
tag_injector.py — Calvin IP rollout helper
Add an '@' mention form next to every hashtag (#tag → #tag @tag)
Optionally, annotate Python comments so "# comment" becomes "#@ comment".
Also works across Markdown (.md) and Jupyter notebooks (.ipynb).
USAGE (common):
python tag_injector.py path_or_folder --mode hashtags_only
python tag_injector.py my_notebook.ipynb --mode comments_too --add-header "CALVIN THOMAS — MY IP — NOTHING ELSE — @sama"
FILES SUPPORTED:
- .md, .txt (Markdown/plain)
- .py (Python code; preserves shebang lines '#!' and encoding hints)
- .ipynb (Jupyter notebooks: processes markdown cells and comment lines inside code cells)
BEHAVIOR:
- Hashtags: converts "#AI is here" → "#AI @AI is here" (keeps original hashtag to avoid breaking links)
- Comments (mode=comments_too): "# note" → "#@ note" (no change to '#!' shebang or '# -*- coding:' lines)
- Headings (e.g., '# Title'): left UNCHANGED by default. Use --touch-headings to also tag headings.
"""
from future import annotations
import argparse, json, os, re, sys
from typing import List
HASHTAG_RX = re.compile(r'(?<!\w)#([A-Za-z0-9_]{1,64})')
def tag_hashtags(text: str, touch_headings: bool=False) -> str:
lines = text.splitlines(keepends=False)
out_lines = []
for ln in lines:
if not touch_headings and ln.lstrip().startswith("# "):
out_lines.append(ln)
continue
Replace inline hashtags (#word) with "#word @word"
def repl(m):
tag = m.group(1)
return f"#{tag} @{tag}"
out_lines.append(HASHTAG_RX.sub(repl, ln))
return "\n".join(out_lines)