code: def test_binned():
      np.random.seed(42)
      sin = mkts((120,)).iloc[:, 0]
      sout = binned(sin, 8).result
      assert isinstance(sout, pd.Series)
      assert len(sout) == 8
      for start, end in zip(
          sout.index.tolist(), sout.index[1:].tolist() + [max(sin) + 1]
      ):
          assert ((sin >= start) & (sin < end)).sum() == sout.loc[start]
  
      sout = binned(sin).result
      assert len(sout) == 4
  
      sin[4:6] = np.nan
      sout = binned(sin).result
      assert len(sout) == 4
  
imports: import pytest
  from tests.unit.profile.base import *
  from tslumen.profile.distribution import binned, pd_quantiles, pd_percentiles
label_desc: Use image node_id 2 for calling a global function with example usage: test_binned() without return types