code: def assert_dimensionless(value):
      
  
      if isinstance(value, Quantity):
          value = value.simplified
          if value.dimensionality == Dimensionality({}):
              value = value.base.item()
          else:
              raise TypeError("Score value %s must be dimensionless" % value)
      return value
docs: Tests for dimensionlessness of input.
      If input is dimensionless but expressed as a Quantity, it returns the
      bare value.  If it not, it raised an error.