def extract_nodegraph_info(filename):
 ksize = None
 n_tables = None
 table_size = None
 signature = None
 version = None
 ht_type = None
 occupied = None
 uint_size = len(pack('I', 0))
 uchar_size = len(pack('B', 0))
 ulonglong_size = len(pack('Q', 0))
 try:
  with open(filename, 'rb') as nodegraph:
   (signature,) = unpack('4s', nodegraph.read(4))
   (version,) = unpack('B', nodegraph.read(1))
   (ht_type,) = unpack('B', nodegraph.read(1))
   (ksize,) = unpack('I', nodegraph.read(uint_size))
   (n_tables,) = unpack('B', nodegraph.read(uchar_size))
   (occupied,) = unpack('Q', nodegraph.read(ulonglong_size))
   (table_size,) = unpack('Q', nodegraph.read(ulonglong_size))
  if (signature != 'OXLI'):
   raise ValueError(("Node graph '{}' is missing file type signature".format(filename) + str(signature)))
 except:
  raise ValueError("Node graph '{}' is corrupt ".format(filename))
 return (ksize, round(table_size, (-2)), n_tables, version, ht_type, occupied)

def extract_nodegraph_info ( filename ) : ksize = None n_tables = None table_size = None signature = None version = None ht_type = None occupied = None uint_size = len ( pack ( 'I' , 0 ) ) uchar_size = len ( pack ( 'B' , 0 ) ) ulonglong_size = len ( pack ( 'Q' , 0 ) ) try : with open ( filename , 'rb' ) as nodegraph : ( signature , ) = unpack ( '4s' , nodegraph . read ( 4 ) ) ( version , ) = unpack ( 'B' , nodegraph . read ( 1 ) ) ( ht_type , ) = unpack ( 'B' , nodegraph . read ( 1 ) ) ( ksize , ) = unpack ( 'I' , nodegraph . read ( uint_size ) ) ( n_tables , ) = unpack ( 'B' , nodegraph . read ( uchar_size ) ) ( occupied , ) = unpack ( 'Q' , nodegraph . read ( ulonglong_size ) ) ( table_size , ) = unpack ( 'Q' , nodegraph . read ( ulonglong_size ) ) if ( signature != 'OXLI' ) : raise ValueError ( ( "Node graph '{}' is missing file type signature" . format ( filename ) + str ( signature ) ) ) except : raise ValueError ( "Node graph '{}' is corrupt " . format ( filename ) ) return ( ksize , round ( table_size , ( - 2 ) ) , n_tables , version , ht_type , occupied )
open the given nodegraph file and return a tuple of information .