def match(a, b, strict=False):
    """Utility function to match two dictionaries

    Params:

    - a (dict): Query dictionary
    - b (dict): Dictionary to match
    - strict (bool): Require exact matching

    Examples:

    ```
    a = {'foo': 'bar'}
    b = {'foo': 'bar baz'}
    match(a, b)
    # True

    a = {'foo': 'bar'}
    b = {'foo': 'bar baz'}
    match(a, b, strict=True)
    # False

    a = {}
    b = {'foo': 'bar'}
    match(a, b)
    # True

    a = {}
    b = {}
    match(a, b)
    # True
    ```
    """
    if not a:
        return True
    if not a and not b:
        return True
    if a and not b:
        return False
    for k, v in a.items():
        if not b.get(k):
            return False
        if strict:
            if v == b.get(k):
                continue
            else:
                return False
        if v in b.get(k):
            continue
        else:
            return False
    return True