class_docstr: Dataset object constructed from name, description, url, key_properties,
  and versions specified in JSON configuration file or a provided :obj:`dict`
  mapping dataset names to configurations.
  
  Parameters
  ----------
  name : :obj:`str`
      Name of dataset.
  description : :obj:`str`
      Brief description of dataset.
  url : :obj:`str`
      Cloud URL to access dataset.
  key_properties : :class:`set` of :obj:`str`
      Set containing key property strings, if present. Valid properties
      include ``'gene'`` and ``'unique'``.
  versions : :class:`list` of :class:`.DatasetVersion`
      List of :class:`.DatasetVersion` objects.
docstr: Get index from compatible version of annotation dataset.
  
  Checks for compatible indexed values from each :class:`.DatasetVersion`
  in :attr:`.Dataset.versions`, where `key_expr` is the row key struct
  from the dataset to be annotated.
  
  Parameters
  ----------
  key_expr : :class:`.StructExpression`
      Row key struct from relational object to be annotated.
  
  Returns
  -------
  :class:`.StructExpression`
      Struct of compatible indexed values.
docstr_tok: ["Get","index","from","compatible","version","of","annotation","dataset",".","Checks","for","compatible","indexed","values","from","each",":","class",":","`",".DatasetVersion","`","in",":","attr",":","`",".Dataset.versions","`",",","where","`","key_expr","`","is","the","row","key","struct","from","the","dataset","to","be","annotated",".","Parameters","--","--","--","--","--","key_expr",":",":","class",":","`",".StructExpression","`","Row","key","struct","from","relational","object","to","be","annotated",".","Returns","--","--","--","-",":","class",":","`",".StructExpression","`","Struct","of","compatible","indexed","values","."]
code: def index_compatible_version(
      self, key_expr: StructExpression
  ) -> StructExpression:
      """Get index from compatible version of annotation dataset.
  
      Checks for compatible indexed values from each :class:`.DatasetVersion`
      in :attr:`.Dataset.versions`, where `key_expr` is the row key struct
      from the dataset to be annotated.
  
      Parameters
      ----------
      key_expr : :class:`.StructExpression`
          Row key struct from relational object to be annotated.
  
      Returns
      -------
      :class:`.StructExpression`
          Struct of compatible indexed values.
      """
      all_matches = "unique" not in self.key_properties
      compatible_indexed_values = [
          (version.maybe_index(key_expr, all_matches), version.version)
          for version in self.versions
          if version.maybe_index(key_expr, all_matches) is not None
      ]
      if len(compatible_indexed_values) == 0:
          versions = [
              f"{(v.version, v.reference_genome)}"
              for v in self.versions
          ]
          raise ValueError(
              f"Could not find compatible version of {self.name} for user"
              f" dataset with key {key_expr.dtype}.\n"
              f"This annotation dataset is available for the following"
              f' versions and reference genome builds: {", ".join(versions)}.'
          )
      else:
          indexed_values = sorted(
              compatible_indexed_values, key=lambda x: x[1]
          )[-1]
  
      if len(compatible_indexed_values) > 1:
          info(
              f"index_compatible_version: More than one compatible version"
              f" exists for annotation dataset: {self.name}. Rows have been"
              f" annotated with version {indexed_values[1]}."
          )
      return indexed_values[0]
  
imports: import json
  import os
  import warnings
  from typing import Iterable, List, Optional, Set, Tuple, Union
  import hail
  import pkg_resources
  from hailtop.utils import external_requests_client_session, retry_response_returning_functions
  from .lens import MatrixRows, TableRows
  from ..expr import StructExpression
  from ..matrixtable import MatrixTable, matrix_table_type
  from ..table import Table, table_type
  from ..typecheck import oneof, typecheck_method
  from ..utils.java import Env, info
label_desc: Use image node_id 4 for calling the Dataset obj's underlying member method code with example usage: obj.index_compatible_version(key_expr) and returns: indexed_values