code: def test_year_frac():
      actual = ffn.year_frac(
          pd.to_datetime("2004-03-10"), pd.to_datetime("2004-03-29")
      )
      # not exactly the same as excel but close enough
      aae(actual, 0.0520, 4)
  
imports: import ffn
  import pandas
  import numpy
  from pytest import fixture
  from numpy.testing import assert_almost_equal
label_desc: Use image node_id 14 for calling a global function with example usage: test_year_frac() without return types