code: def normalize(self, bias_range=1, poly_range=None, ignored_terms=None):
          
  
          def parse_range(r):
              if isinstance(r, Number):
                  return -abs(r), abs(r)
              return r
  
          if ignored_terms is None:
              ignored_terms = set()
          else:
              ignored_terms = {asfrozenset(term) for term in ignored_terms}
  
          if poly_range is None:
              linear_range, poly_range = bias_range, bias_range
          else:
              linear_range = bias_range
  
          lin_range, poly_range = map(parse_range, (linear_range, poly_range))
  
          # determine the current ranges for linear, higherorder
          lmin = lmax = 0
          pmin = pmax = 0
          for term, bias in self.items():
  
              if term in ignored_terms:
                  # we don't use the ignored terms to calculate the scaling
                  continue
  
              if len(term) == 1:
                  lmin = min(bias, lmin)
                  lmax = max(bias, lmax)
              elif len(term) > 1:
                  pmin = min(bias, pmin)
                  pmax = max(bias, pmax)
  
          inv_scalar = max(lmin / lin_range[0], lmax / lin_range[1],
                           pmin / poly_range[0], pmax / poly_range[1])
  
          if inv_scalar != 0:
              self.scale(1 / inv_scalar, ignored_terms=ignored_terms)
docs: Normalizes the biases of the binary polynomial such that they fall in
          the provided range(s).
  
          If `poly_range` is provided, then `bias_range` will be treated as
          the range for the linear biases and `poly_range` will be used for
          the range of the other biases.
  
          Args:
              bias_range (number/pair):
                  Value/range by which to normalize the all the biases, or if
                  `poly_range` is provided, just the linear biases.
  
              poly_range (number/pair, optional):
                  Value/range by which to normalize the higher order biases.
  
              ignored_terms (iterable, optional):
                  Biases associated with these terms are not scaled.