def _GetKeys(data):
  """Get the keys of a H5Dataset or numpy compound data type."""
  if hasattr(data, 'keys'):
    return set(data.keys())
  elif hasattr(data, 'dtype') and data.dtype.names:
    return set(data.dtype.names)
  else:
    return None