<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_posix_path(code_path):
 """ Change the code_path to be of unix-style if running on windows when supplied with an absolute windows path. Parameters code_path : str Directory in the host operating system that should be mounted within the container. Returns ------- str Posix equivalent of absolute windows style path. Examples -------- /Users/UserName/sam-app /c/Users/UserName/AppData/Local/Temp/mydir """


    return re.sub("^([A-Za-z])+:",
                  lambda match: posixpath.sep + match.group().replace(":", "").lower(),
                  pathlib.PureWindowsPath(code_path).as_posix()) if os.name == "nt" else code_path