def _maybe_cast_indexed(self, key):
if isinstance(key, IntervalIndex):<EOL><INDENT>return key<EOL><DEDENT>subtype = self.dtype.subtype<EOL>if is_float_dtype(subtype):<EOL><INDENT>if is_integer(key):<EOL><INDENT>key = float(key)<EOL><DEDENT>elif isinstance(key, (np.ndarray, Index)):<EOL><INDENT>key = key.astype('<STR_LIT>')<EOL><DEDENT><DEDENT>elif is_integer_dtype(subtype):<EOL><INDENT>if is_integer(key):<EOL><INDENT>key = int(key)<EOL><DEDENT><DEDENT>return key<EOL>
we need to cast the key, which could be a scalar
or an array-like to the type of our subtype