human
Complete this python program:
def _lazy_re_compile(regex, flags=0):
assistant
#Here is the Python program you requested.

    """Lazily compile a regex with flags.
    """
    def _compile():
        if isinstance(regex, str):
            return re.compile(regex, flags)
        else:
            assert (not flags), 'flags    must    be    empty    if    regex    is    passed    pre-compiled'
            return regex
    return SimpleLazyObject(_compile)