code: def get_index_by_alias(self, alias):
          
          try:
              info = self.es.indices.get_alias(name=alias)
              return next(iter(info.keys()))
          except elasticsearch.exceptions.NotFoundError:
              return alias
docs: Get index name for given alias.
  
          If there is no alias assume it's an index.
  
          :param alias: alias name