def analyse(file, length=None):
    """Analyse application layer packets.

    Keyword arguments:
        * file -- bytes or file-like object, packet to be analysed
        * length -- int, length of the analysing packet

    Returns:
        * Analysis -- an Analysis object from `pcapkit.analyser`

    """
    if isinstance(file, bytes):
        file = io.BytesIO(file)

    io_check(file)
    int_check(length or sys.maxsize)

    return analyse2(file, length)
def analyse ( file , length = None ) : if isinstance ( file , bytes ) : file = io . BytesIO ( file ) io_check ( file ) int_check ( length or sys . maxsize ) return analyse2 ( file , length )
Analyse application layer packets.

    Keyword arguments:
        * file -- bytes or file-like object, packet to be analysed
        * length -- int, length of the analysing packet

    Returns:
        * Analysis -- an Analysis object from `pcapkit.analyser`