mbr.py
def decode_partition(partition_data):
    """Decode an MBR partition table entry.

    :returns: None if the partition entry is empty, otherwise, a Partition
        object.
    """
    assert len(partition_data) == 16
    # An unused partition is all 0x00s.
    if partition_data == (b'\x00' * 16):
        return None
    status = _six.indexbytes(partition_data, 0)
    assert status in (0, 0x80)
    bootable = status == 0x80
    chs_first_sector = decode_chs_bytes(partition_data[1:4])
    partition_type = _six.indexbytes(partition_data, 4)
    chs_last_sector = decode_chs_bytes(partition_data[5:8])
    lba_data = partition_data[8:]
    lba_first_sector, num_sectors = (
        _struct.unpack_from('<II', partition_data, 8))
    return Partition(
        bootable,
        chs_first_sector, chs_last_sector,
        partition_type,
        lba_first_sector, num_sectors)
Decode an MBR partition table entry.

    :returns: None if the partition entry is empty, otherwise, a Partition
        object.
    
Decode an MBR partition table entry.
Decode an MBR partition table entry .
def decode_partition(partition_data):
    assert len(partition_data) == 16
    if partition_data == (b'\x00' * 16):
        return None
    status = _six.indexbytes(partition_data, 0)
    assert status in (0, 0x80)
    bootable = status == 0x80
    chs_first_sector = decode_chs_bytes(partition_data[1:4])
    partition_type = _six.indexbytes(partition_data, 4)
    chs_last_sector = decode_chs_bytes(partition_data[5:8])
    lba_data = partition_data[8:]
    lba_first_sector, num_sectors = (
        _struct.unpack_from('<II', partition_data, 8))
    return Partition(
        bootable,
        chs_first_sector, chs_last_sector,
        partition_type,
        lba_first_sector, num_sectors)
def decode_partition ( partition_data ) : assert len ( partition_data ) == 16 if partition_data == ( b'\x00' * 16 ) : return None status = _six . indexbytes ( partition_data , 0 ) assert status in ( 0 , 0x80 ) bootable = status == 0x80 chs_first_sector = decode_chs_bytes ( partition_data [ 1 : 4 ] ) partition_type = _six . indexbytes ( partition_data , 4 ) chs_last_sector = decode_chs_bytes ( partition_data [ 5 : 8 ] ) lba_data = partition_data [ 8 : ] lba_first_sector , num_sectors = ( _struct . unpack_from ( '<II' , partition_data , 8 ) ) return Partition ( bootable , chs_first_sector , chs_last_sector , partition_type , lba_first_sector , num_sectors )
Decode an MBR partition table entry.
Decode an MBR partition table entry .
"""Decode an MBR partition table entry.

    :returns: None if the partition entry is empty, otherwise, a Partition
        object.
    """ # An unused partition is all 0x00s.
None if the partition entry is empty, otherwise, a Partition
object.
None if the partition entry is empty otherwise a Partition object .
partition_data