code: def test_constructor_with_metadata():
      # https://github.com/pandas-dev/pandas/pull/54922
      # https://github.com/pandas-dev/pandas/issues/55120
      df = MySubclassWithMetadata(
          np.random.default_rng(2).random((5, 3)),
          columns=["A", "B", "C"],
      )
      subset = df[["A", "B"]]
      assert isinstance(subset, MySubclassWithMetadata)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_constructor_with_metadata() without return types