<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _flag_transform(flags):
 """Transform flags to glob defaults."""


    # Here we force `PATHNAME`.
    flags = (flags & FLAG_MASK) | _wcparse.PATHNAME
    if flags & _wcparse.REALPATH and util.platform() == "windows":
        flags |= _wcparse._FORCEWIN
        if flags & _wcparse.FORCECASE:
            flags ^= _wcparse.FORCECASE
    return flags