def category_match(a, b):
    """Return bool, whether the starting categories in a match the categories in b.

    For example, ``category_match({'categories': ('foo',)}, {"categories": ('foo', 'bar')})`` is true."""
    return tuple(a["categories"][: len(b["categories"])]) == tuple(b["categories"])