code: def test_feature_vector_of_endpoints():
      # Test subclassing Feature
      class VectorOfEndpointsFeature(dipysfeature.Feature):
          def __init__(self):
              super(VectorOfEndpointsFeature, self).__init__(False)
  
          def infer_shape(self, streamline):
              return 1, streamline.shape[1]
  
          def extract(self, streamline):
              return streamline[[-1]] - streamline[[0]]
  
      feature_types = [
          dipysfeature.VectorOfEndpointsFeature(),
          VectorOfEndpointsFeature(),
      ]
      for feature in feature_types:
          for s in [s1, s2, s3, s4]:
              # Test method infer_shape
              assert_equal(feature.infer_shape(s), (1, s.shape[1]))
  
              # Test method extract
              features = feature.extract(s)
              assert_equal(features.shape, (1, s.shape[1]))
              assert_array_almost_equal(features, s[[-1]] - s[[0]])
  
          # This feature type is not order invariant
          assert_false(feature.is_order_invariant)
          for s in [s1, s2, s3, s4]:
              features = feature.extract(s)
              features_flip = feature.extract(s[::-1])
              # The flip features are simply the negative of the features.
              assert_array_almost_equal(features, -features_flip)
  
file_path: dipy/dipy/segment/tests/test_feature.py
imports: import sys
  import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_raises, assert_equal
  import dipy.segment.featurespeed
  import dipy.segment.metric
  import dipy.segment.metricspeed
  from dipy.segment.featurespeed import extract
  from dipy.testing import assert_true, assert_false
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 6 for calling a global function with example usage: test_feature_vector_of_endpoints() and returns: int,  streamline, unknown