import re


def is_uuid4(x):
    """A little helper function - does the passed in string match a uuid4
    pattern?  Return true if it does match, false otherwise.  Used to
    replace random stock_id with the year and ID number.

    - regex from: https://stackoverflow.com/questions/11384589

    Arguments:
    - `x`: a string that may or may not be a uuid4 value.

    """

    regex = re.compile(
        r"[0-9a-f]{8}\-[0-9a-f]{4}\-4[0-9a-f]{3}\-[89ab][0-9a-f]{3}\-[0-9a-f]{12}"
    )

    return bool(regex.match(x))