code: def test_startswith_endswith_non_str_patterns(pattern):
      # GH3485
      ser = Series(["foo", "bar"])
      msg = f"expected a string or tuple, not {type(pattern).__name__}"
      with pytest.raises(TypeError, match=msg):
          ser.str.startswith(pattern)
      with pytest.raises(TypeError, match=msg):
          ser.str.endswith(pattern)
  
imports: from datetime import datetime, timedelta
  import numpy
  import pytest
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
  from pandas.core.strings.accessor import StringMethods
  from pandas.tests.strings import object_pyarrow_numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_startswith_endswith_non_str_patterns(pattern) without return types