def parse_from_file(filename, nodata=False):
    """Parse df message from file.

    @filename - path to file
    @nodata - do not load data
    @return - [binary header, metadata, binary data]

    """
    header = None
    with open(filename, "rb") as file:
        header = read_machine_header(file)
        meta_raw = file.read(header['meta_len'])
        meta = __parse_meta(meta_raw, header)
        data = b''
        if not nodata:
            data = __decompress(meta, file.read(header['data_len']))

        return header, meta, data
def parse_from_file ( filename , nodata = False ) : header = None with open ( filename , "rb" ) as file : header = read_machine_header ( file ) meta_raw = file . read ( header [ 'meta_len' ] ) meta = __parse_meta ( meta_raw , header ) data = b'' if not nodata : data = __decompress ( meta , file . read ( header [ 'data_len' ] ) ) return header , meta , data
Parse df message from file.

    @filename - path to file
    @nodata - do not load data
    @return - [binary header, metadata, binary data]