code: def _initialize_if_needed():
      
      global IS_INITIALIZED, TENSOR_SPACE_IMPLS
      if not IS_INITIALIZED:
          # pkg_resources has long import time
          from pkg_resources import iter_entry_points
          for entry_point in iter_entry_points(group='odl.space', name=None):
              try:
                  module = entry_point.load()
              except ImportError:
                  pass
              else:
                  TENSOR_SPACE_IMPLS.update(module.tensor_space_impls())
          IS_INITIALIZED = True
docs: Initialize ``TENSOR_SPACE_IMPLS`` if not already done.