code: def test_combine(
      is_sparse: bool,
      type: Text,
      number: int,
      use_expected_origin: bool,
  ):
      (
          features_list,
          modifications,
      ) = _generate_feature_list_and_modifications(
          is_sparse=is_sparse, type=type, number=number
      )
      modified_features = [
          Features(**config) for config in modifications
      ]
      first_dim = features_list[0].features.shape[0]
  
      origins = [f"origin-{idx}" for idx in range(len(features_list))]
      if number == 1:
          # in this case the origin will be same str as before, not a list
          origins = origins[0]
      expected_origin = origins if use_expected_origin else None
  
      # works as expected
      combination = Features.combine(
          features_list, expected_origins=expected_origin
      )
      assert combination.features.shape[1] == int(
          number * (number + 1) / 2
      )
      assert combination.features.shape[0] == first_dim
      assert combination.origin == origins
      assert combination.is_sparse() == is_sparse
      matrix = combination.features
      if is_sparse:
          matrix = combination.features.todense()
      for idx in range(number):
          offset = int(idx * (idx + 1) / 2)
          assert np.all(
              matrix[:, offset : (offset + idx + 1)] == idx + 1
          )
  
      # fails as expected in these cases
      if use_expected_origin and number > 1:
          for modified_feature in modified_features:
              features_list_copy = features_list.copy()
              features_list_copy[-1] = modified_feature
              with pytest.raises(ValueError):
                  Features.combine(
                      features_list_copy,
                      expected_origins=expected_origin,
                  )
  
imports: import itertools
  from typing import Optional, Text, List, Dict, Tuple, Any
  import numpy
  import pytest
  import scipy.sparse
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.constants import FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE, TEXT, INTENT
label_desc: Use image node_id 9 for calling a global function with example usage: test_combine(is_sparse, type, number, use_expected_origin) without return types