code: def index_of(self, period: Union[Period, str]) -> int:
      assert self.index is not None
  
      return self.index.index_of(period)
  
imports: from __future__ import annotations
  import dataclasses
  from typing import Any, Optional, NamedTuple, Union
  from typing_extensions import Literal
  from gluonts import maybe
  from ._period import Periods, Period
  from ._util import _replace
label_desc: Use image node_id 11 for calling the TimeBase obj's underlying member method code with example usage: obj.index_of(period) and returns: self