code: def _read_header(f):
      
  
      # http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format
  
      line = f.readline().decode("utf-8")
      # Split the line
      # 4.1 0 8
      # into its components.
      str_list = list(filter(None, line.split()))
      fmt_version = str_list[0]
      assert str_list[1] in ["0", "1"]
      is_ascii = str_list[1] == "0"
      data_size = int(str_list[2])
      if not is_ascii:
          # The next line is the integer 1 in bytes. Useful for checking
          # endianness. Just assert that we get 1 here.
          one = f.read(struct.calcsize("i"))
          assert struct.unpack("i", one)[0] == 1
          line = f.readline().decode("utf-8")
          assert line == "\n"
      line = f.readline().decode("utf-8")
      assert line.strip() == "$EndMeshFormat"
      return fmt_version, data_size, is_ascii
docs: Read the mesh format block
  
      specified as
  
       version(ASCII double; currently 4.1)
         file-type(ASCII int; 0 for ASCII mode, 1 for binary mode)
         data-size(ASCII int; sizeof(size_t))
       < int with value one; only in binary mode, to detect endianness >
  
      though here the version is left as str