# Path: pycdlib/pycdlibexception.py
# class PyCdlibException(Exception):
# class PyCdlibInternalError(PyCdlibException):
# class PyCdlibInvalidInput(PyCdlibException):
# class PyCdlibInvalidISO(PyCdlibException):
#     def __init__(self, msg):
#     def __init__(self, msg):
#     def __init__(self, msg):
#     def __init__(self, msg):


    import cStringIO  # pylint: disable=import-error
import io
import math
import os
import re
import struct
import sys
import time
        import win32con  # pylint: disable=import-error
        import win32file  # pylint: disable=import-error
        import winioctlcon  # pylint: disable=import-error
from pycdlib import pycdlibexception
    from typing import BinaryIO, List, Optional, Tuple  # NOQA pylint: disable=unused-import

    Parameters:
     path - The path to normalize.
    Returns:
     The normalized path.
    """
    sep = '/'
    empty = ''
    dot = '.'
    dotdot = '..'

    if path == empty:
        return dot.encode('utf-8')

    initial_slashes = path.startswith(sep)
    comps = path.split(sep)
    new_comps = []  # type: List[str]
    for comp in comps:
        if comp in (empty, dot):
            continue
        if comp != dotdot or (not initial_slashes and not new_comps) or (new_comps and new_comps[-1] == dotdot):
            new_comps.append(comp)
        elif new_comps:
            new_comps.pop()
    newpath = sep * initial_slashes + sep.join(new_comps)
    if sys.version_info >= (3, 0):
        newpath_bytes = newpath.encode('utf-8')
    else:
        newpath_bytes = newpath.decode('utf-8').encode('utf-8')
    if not starts_with_slash(newpath_bytes):

# Path: pycdlib/pycdlibexception.py
# class PyCdlibException(Exception):
# class PyCdlibInternalError(PyCdlibException):
# class PyCdlibInvalidInput(PyCdlibException):
# class PyCdlibInvalidISO(PyCdlibException):
#     def __init__(self, msg):
#     def __init__(self, msg):
#     def __init__(self, msg):
#     def __init__(self, msg):


# Path: pycdlib/utils.py
    import cStringIO  # pylint: disable=import-error
import io
import math
import os
import re
import struct
import sys
import time
        import win32con  # pylint: disable=import-error
        import win32file  # pylint: disable=import-error
        import winioctlcon  # pylint: disable=import-error
from pycdlib import pycdlibexception
    from typing import BinaryIO, List, Optional, Tuple  # NOQA pylint: disable=unused-import


    Parameters:
     path - The path to normalize.
    Returns:
     The normalized path.
    """
    sep = '/'
    empty = ''
    dot = '.'
    dotdot = '..'

    if path == empty:
        return dot.encode('utf-8')

    initial_slashes = path.startswith(sep)
    comps = path.split(sep)
    new_comps = []  # type: List[str]
    for comp in comps:
        if comp in (empty, dot):
            continue
        if comp != dotdot or (not initial_slashes and not new_comps) or (new_comps and new_comps[-1] == dotdot):
            new_comps.append(comp)
        elif new_comps:
            new_comps.pop()
    newpath = sep * initial_slashes + sep.join(new_comps)
    if sys.version_info >= (3, 0):
        newpath_bytes = newpath.encode('utf-8')
    else:
        newpath_bytes = newpath.decode('utf-8').encode('utf-8')
    if not starts_with_slash(newpath_bytes):

        raise pycdlibexception.PyCdlibInvalidInput('Must be a path starting with /')