code: def get_level_variable(self, level):
          
          if self.level_names is None:
              raise ValueError("IndexVariable %r has no MultiIndex" % self.name)
          index = self.to_index()
          return type(self)(self.dims, index.get_level_values(level))
docs: Return a new IndexVariable from a given MultiIndex level.