code: def test_expanding_corr_diff_index():
      # GH 7512
      s1 = Series([1, 2, 3], index=[0, 1, 2])
      s2 = Series([1, 3], index=[0, 2])
      result = s1.expanding().corr(s2)
      expected = Series([None, None, 1.0])
      tm.assert_series_equal(result, expected)
  
      s2a = Series([1, None, 3], index=[0, 1, 2])
      result = s1.expanding().corr(s2a)
      tm.assert_series_equal(result, expected)
  
      s1 = Series([7, 8, 10], index=[0, 1, 3])
      s2 = Series([7, 9, 10], index=[0, 2, 3])
      result = s1.expanding().corr(s2)
      expected = Series([None, None, None, 1.0])
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, Series, isna, notna
  import pandas._testing
label_desc: Use image node_id 31 for calling a global function with example usage: test_expanding_corr_diff_index() without return types