code: def test_apply_map_same_length_inference_bug():
      s = Series([1, 2])
  
      def f(x):
          return (x, x + 1)
  
      result = s.apply(f, by_row="compat")
      expected = s.map(f)
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, concat, date_range, timedelta_range
  import pandas._testing
  from pandas.tests.apply.common import series_transform_kernels
label_desc: Use image node_id 4 for calling a global function with example usage: test_apply_map_same_length_inference_bug() and returns: x,  unknown