from typing import Dict


def _metadata(gray_max, threshold) -> Dict:
    """Create metadata dict."""
    video_dark_flag = gray_max < threshold
    return {"gray_max": gray_max, "video_dark_flag": video_dark_flag, "flagged": video_dark_flag}