code: def test_head_functionality():
      # Arrange
      text = ["a", "b b b", "c c c c"]
      metadata = {"first": [1, 2, 3], "second": [4, 5, 6]}
      label = ["PER", "ORG", "GEO"]
  
      # Act
      dataset = TextData(
          raw_text=text,
          metadata=pd.DataFrame(metadata),
          task_type="text_classification",
          label=label,
      )
      result = dataset.head(n_samples=2)
  
      # Assert
      assert_that(len(result), equal_to(2))
      assert_that(
          sorted(result.columns),
          contains_exactly("first", "label", "second", "text"),
      )
      assert_that(list(result.index), contains_exactly(0, 1))
  
imports: import numpy
  import pandas
  from hamcrest import assert_that, calling, contains_exactly, equal_to, raises
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.nlp.text_data import TextData
label_desc: Use image node_id 7 for calling a global function with example usage: test_head_functionality() without return types