code: def sort_public_keys(pub_keys: List[bytes] or List[str]):
          
          for index, key in enumerate(pub_keys):
              if isinstance(key, str):
                  pub_keys[index] = bytes.fromhex(key)
          return sorted(pub_keys, key=ProgramBuilder.compare_pubkey)
docs: :param pub_keys: a list of public keys in format of bytes.
          :return: sorted public keys.