code: def test_timedelta_assignment():
      # GH 8209
      s = Series([], dtype=object)
      s.loc["B"] = timedelta(1)
      tm.assert_series_equal(
          s, Series(Timedelta("1 days"), index=["B"])
      )
  
      s = s.reindex(s.index.insert(0, "A"))
      tm.assert_series_equal(
          s, Series([np.nan, Timedelta("1 days")], index=["A", "B"])
      )
  
      s.loc["A"] = timedelta(1)
      expected = Series(Timedelta("1 days"), index=["A", "B"])
      tm.assert_series_equal(s, expected)
  
imports: from datetime import timedelta
  import re
  import numpy
  import pytest
  from pandas.errors import IndexingError
  from pandas import NA, DataFrame, Index, IndexSlice, MultiIndex, NaT, Series, Timedelta, Timestamp, concat, date_range, isna, period_range, timedelta_range
  import pandas._testing
label_desc: Use image node_id 18 for calling a global function with example usage: test_timedelta_assignment() without return types