(data, name, exc_details)
return flags
Perform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.
Perform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.
Perform basic validity checking of a pyc header and return the flags field which determines how the pyc should be further validated against the source .
def _classify_pyc(data, name, exc_details):
    """Perform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    """
    magic = data[:4]
    if magic != MAGIC_NUMBER:
        message = f'bad magic number in {name!r}: {magic!r}'
        _bootstrap._verbose_message('{}', message)
        raise ImportError(message, **exc_details)
    if len(data) < 16:
        message = f'reached EOF while reading pyc header of {name!r}'
        _bootstrap._verbose_message('{}', message)
        raise EOFError(message)
    flags = _unpack_uint32(data[4:8])
    # Only the first two flags are defined.
    if flags & ~0b11:
        message = f'invalid flags {flags!r} in {name!r}'
        raise ImportError(message, **exc_details)
    return flags
def _classify_pyc ( data , name , exc_details ) : magic = data [ : 4 ] if magic != MAGIC_NUMBER : message = f'bad magic number in {name!r}: {magic!r}' _bootstrap . _verbose_message ( '{}' , message ) raise ImportError ( message , * * exc_details ) if len ( data ) < 16 : message = f'reached EOF while reading pyc header of {name!r}' _bootstrap . _verbose_message ( '{}' , message ) raise EOFError ( message ) flags = _unpack_uint32 ( data [ 4 : 8 ] ) # Only the first two flags are defined. if flags & ~ 0b11 : message = f'invalid flags {flags!r} in {name!r}' raise ImportError ( message , * * exc_details ) return flags