code: def test_reset_index_drop_errors(self):
      #  GH 20925
  
      # KeyError raised for series index when passed level name is missing
      s = Series(range(4))
      with pytest.raises(KeyError, match="does not match index name"):
          s.reset_index("wrong", drop=True)
      with pytest.raises(KeyError, match="does not match index name"):
          s.reset_index("wrong")
  
      # KeyError raised for series when level to be dropped is missing
      s = Series(range(4), index=MultiIndex.from_product([[1, 2]] * 2))
      with pytest.raises(KeyError, match="not found"):
          s.reset_index("wrong", drop=True)
  
file_path: pandas/pandas/tests/series/methods/test_reset_index.py
imports: from datetime import datetime
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, RangeIndex, Series, date_range, option_context
  import pandas._testing
label_desc: Use image node_id 6 for calling the TestResetIndex obj's underlying member method code with example usage: obj.test_reset_index_drop_errors() without return types