# 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
# def swab_32bit(x):
# def swab_16bit(x):
# def ceiling_div(numer, denom):
# def copy_data(data_length, blocksize, infp, outfp):
# def encode_space_pad(instr, length, encoding):
# def normpath(path):
# def gmtoffset_from_tm(tm, local):
# def zero_pad(fp, data_size, pad_size):
# def starts_with_slash(path):
# def split_path(iso_path):
# def file_object_supports_binary(fp):
# def truncate_basename(basename, iso_level, is_dir):
# def mangle_file_for_iso9660(orig, iso_level):
# def mangle_dir_for_iso9660(orig, iso_level):
#     def __init__(self, target):
#     def __enter__(self):
#     def __exit__(self, *_, **__):
#     def __len__(self):
#     def dispose(self):
#     def get_target(self):
#     def get_handle(self):
#     def get_geometry(self):
#     def tell(self):
#     def _tell(self):
#     def seek(self, offset, whence=os.SEEK_SET):
#     def read(self, size=-1):
#     def align(self, size, to=None):
# class Win32RawDevice:


import random
import struct
import sys
import time
    from cStringIO import StringIO as BytesIO
    from io import BytesIO  # pylint: disable=ungrouped-imports
from pycdlib import pycdlibexception
from pycdlib import utils
    from typing import List, Optional, Type, Union  # NOQA pylint: disable=unused-import
    from pycdlib import inode  # NOQA pylint: disable=unused-import
        Parse the passed in data into a UDF Timestamp.

        Parameters:
         data - The data to parse.
        Returns:
         Nothing.
        """
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Timestamp already initialized')

        (tz, timetype, self.year, self.month, self.day, self.hour, self.minute,
         self.second, self.centiseconds, self.hundreds_microseconds,
         self.microseconds) = struct.unpack_from(self.FMT, data, 0)

        self.timetype = timetype >> 4

        def twos_comp(val, bits):
            # type: (int, int) -> int
            """Compute the 2's complement of int value val"""
            if (val & (1 << (bits - 1))) != 0:  # if sign bit is set e.g., 8bit: 128-255
                val = val - (1 << bits)         # compute negative value
            return val                          # return positive value as is
        self.tz = twos_comp(((timetype & 0xf) << 8) | tz, 12)
        if self.tz < -1440 or self.tz > 1440:
            if self.tz != -2047:
                raise pycdlibexception.PyCdlibInvalidISO('Invalid UDF timezone')

        if self.year < 1 or self.year > 9999:
            raise pycdlibexception.PyCdlibInvalidISO('Invalid UDF year')
        if self.month < 1 or self.month > 12:

# 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
# def swab_32bit(x):
# def swab_16bit(x):
# def ceiling_div(numer, denom):
# def copy_data(data_length, blocksize, infp, outfp):
# def encode_space_pad(instr, length, encoding):
# def normpath(path):
# def gmtoffset_from_tm(tm, local):
# def zero_pad(fp, data_size, pad_size):
# def starts_with_slash(path):
# def split_path(iso_path):
# def file_object_supports_binary(fp):
# def truncate_basename(basename, iso_level, is_dir):
# def mangle_file_for_iso9660(orig, iso_level):
# def mangle_dir_for_iso9660(orig, iso_level):
#     def __init__(self, target):
#     def __enter__(self):
#     def __exit__(self, *_, **__):
#     def __len__(self):
#     def dispose(self):
#     def get_target(self):
#     def get_handle(self):
#     def get_geometry(self):
#     def tell(self):
#     def _tell(self):
#     def seek(self, offset, whence=os.SEEK_SET):
#     def read(self, size=-1):
#     def align(self, size, to=None):
# class Win32RawDevice:


# Path: pycdlib/udf.py
import random
import struct
import sys
import time
    from cStringIO import StringIO as BytesIO
    from io import BytesIO  # pylint: disable=ungrouped-imports
from pycdlib import pycdlibexception
from pycdlib import utils
    from typing import List, Optional, Type, Union  # NOQA pylint: disable=unused-import
    from pycdlib import inode  # NOQA pylint: disable=unused-import

        Parse the passed in data into a UDF Timestamp.

        Parameters:
         data - The data to parse.
        Returns:
         Nothing.
        """
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Timestamp already initialized')

        (tz, timetype, self.year, self.month, self.day, self.hour, self.minute,
         self.second, self.centiseconds, self.hundreds_microseconds,
         self.microseconds) = struct.unpack_from(self.FMT, data, 0)

        self.timetype = timetype >> 4

        def twos_comp(val, bits):
            # type: (int, int) -> int
            """Compute the 2's complement of int value val"""
            if (val & (1 << (bits - 1))) != 0:  # if sign bit is set e.g., 8bit: 128-255
                val = val - (1 << bits)         # compute negative value
            return val                          # return positive value as is
        self.tz = twos_comp(((timetype & 0xf) << 8) | tz, 12)
        if self.tz < -1440 or self.tz > 1440:
            if self.tz != -2047:
                raise pycdlibexception.PyCdlibInvalidISO('Invalid UDF timezone')

        if self.year < 1 or self.year > 9999:
            raise pycdlibexception.PyCdlibInvalidISO('Invalid UDF year')
        if self.month < 1 or self.month > 12:

            raise pycdlibexception.PyCdlibInvalidISO('Invalid UDF month')