code: def get_weight_range(weights):
      # type: (FeatureWeights) -> float
      
      return max_or_0(abs(fw.weight)
                      for lst in [weights.pos, weights.neg]
                      for fw in lst or [])
docs: Max absolute feature for pos and neg weights.