input: Write a python function to read .gnt files from a specified directory and return a list of tuples where each tuple contains a bitmap and a tagcode.
  assert len(read_gnt_in_directory('sample_gnt_directory')) > 0
  assert isinstance(read_gnt_in_directory('sample_gnt_directory')[0], tuple)
  assert len(read_gnt_in_directory('sample_gnt_directory')[0]) == 2
output: import os
  import struct
  import numpy as np
  
  def read_gnt_in_directory(directory):
      def read_gnt_file(filepath):
          with open(filepath, 'rb') as f:
              while True:
                  packed_length = f.read(4)
                  if not packed_length:
                      break
                  length = struct.unpack('<I', packed_length)[0]
                  tagcode = struct.unpack('<H', f.read(2))[0]
                  width = struct.unpack('<H', f.read(2))[0]
                  height = struct.unpack('<H', f.read(2))[0]
                  bitmap = np.frombuffer(f.read(width * height), dtype=np.uint8).reshape((height, width))
                  yield (bitmap, tagcode)
      
      all_data = []
      for filename in os.listdir(directory):
          if filename.endswith('.gnt'):
              filepath = os.path.join(directory, filename)
              all_data.extend(read_gnt_file(filepath))
      
      return all_data