STUDY METHODS SOURCE EXCERPTS; not a standalone executable.
Source identifier: C006-frozen-gui-tools

--- Original lines 85-87 ---
def new_uuid():
    """New technical identity, never a training/default entity ID."""
    return str(uuid.uuid4())

--- Original lines 90-95 ---
def amount_micros(amount):
    """W279's one observed UI/wire scale; no universal currency claim."""
    value = Decimal(str(amount)) * 1000000
    if not value.is_finite() or value != value.to_integral_value():
        raise UnsupportedOperation("Amount cannot be represented as integer micros")
    return int(value)

--- Original lines 98-108 ---
def task_body(note, block_ids):
    """W341/W346/W1153 serialization; IDs supplied fresh by the caller."""
    if not isinstance(note, str) or len(block_ids) != 2 or len(set(block_ids)) != 2:
        raise UnsupportedOperation("Need note text and two distinct fresh block IDs")
    for ident in block_ids:
        uuid.UUID(ident)
    props = {"backgroundColor": "default", "textColor": "default", "textAlignment": "left"}
    blocks = [{"id": block_ids[0], "type": "paragraph", "props": props,
               "content": [{"type": "text", "text": note, "styles": {}}], "children": []},
              {"id": block_ids[1], "type": "paragraph", "props": props, "content": [], "children": []}]
    return {"blocknote": json.dumps(blocks, ensure_ascii=False, separators=(",", ":")), "markdown": None}

--- Original lines 111-116 ---
def select_unique(records, key, expected):
    """Select only from a returned list; never pick the first ambiguous match."""
    matches = [row for row in records if row.get(key) == expected]
    if len(matches) != 1:
        raise UnsupportedOperation(f"Selection has {len(matches)} exact matches; inspect current returned records and pagination")
    return matches[0]

