/*
Normalizes the given acc info object and ensures that all the defaults are set.
540202
function(oInfo) {
			if (!oInfo) {
				return null;
			}

			if (oInfo._normalized) {
				return oInfo;
			}

			oInfo.role = oInfo.role || "";
			oInfo.type = oInfo.type || "";
			oInfo.description = oInfo.description || "";
			oInfo.enabled = (oInfo.enabled === true || oInfo.enabled === false) ? oInfo.enabled : null;
			oInfo.editable = (oInfo.editable === true || oInfo.editable === false) ? oInfo.editable : null;
			oInfo.children = oInfo.children || [];
			oInfo._normalized = true;

			return oInfo;
		}
662045
public static void normalizeF( DMatrixRMaj A ) {
        double val = normF(A);

        if( val == 0 )
            return;

        int size = A.getNumElements();

        for( int i = 0; i < size; i++) {
            A.div(i , val);
        }
    }
983655
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        // First, basic checks that it's a valid non-empty name:
        String def = validateDefaultName(rep, normalize);

        // And then that it's one of listed values:
        String shared = mEnumValues.find(def);
        if (shared == null) {
            reportValidationProblem(rep, "Invalid default value '"+def+"': has to be one of ("
                                    +mEnumValues+")");
        }

        // Ok, cool it's ok...
        if (normalize) {
            mDefValue.setValue(shared);
        }
    }
743859
final public function normalize(): void
    {
        foreach ($this->props['items'] as &$item) {
            $item = array_replace($this->defaultItem, $item);
        }
        unset($item);
    }
15377
function normalizeSrc(val) {
  if (!val.src) return val;
  val.src = utils.arrayify(val.src);
  return val;
}
561758
protected function _normalize()
    {
        /* Clients conforming to RFC 4314 MUST ignore the virtual ACL_CREATE
         * and ACL_DELETE rights. See RFC 4314 [2.1]. However, we still need
         * to handle these rights when dealing with RFC 2086 servers since
         * we are abstracting out use of ACL_CREATE/ACL_DELETE to their
         * component RFC 4314 rights. */
        foreach ($this->_virtual as $key => $val) {
            foreach ($val as $right) {
                if ($this[$right]) {
                    foreach (array_keys($this->_virtual) as $virtual) {
                        unset($this[$virtual]);
                    }
                    return;
                }
            }
        }
        foreach ($this->_virtual as $key => $val) {
            if ($this[$key]) {
                unset($this[$key]);
                $this->_rights = array_unique(array_merge($this->_rights, $val));
            }
        }
    }
201596
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        String def = validateDefaultNmToken(rep, normalize);
        if (normalize) {
            mDefValue.setValue(def);
        }
    }
337350
protected function normalizeAccessToken($access_token) {
    if (!isset($access_token['expires_in']) && isset($access_token['expires'])) {
      $access_token['expires_in'] = $access_token['expires'];
      unset($access_token['expires']);
    }
    return parent::normalizeAccessToken($access_token);
  }
1030786
function normalize(options){
    options = options || {};

    options.printfn = options.printfn || function(obj) {
      console.dir(obj, {colors: true});
    };

   if (!options.accept) {
      if (options.include) {
         options.accept = function(propKey) { return options.include.indexOf(propKey) >= 0; };
      }
      else if (options.exclude){
         options.accept = function(propKey) { return options.exclude.indexOf(propKey) < 0; };
      }
      else {
         options.accept = function() { return true; };
      }
   }

   options.fileFilter = fileFilter(options.filter);

   return options;
}
65670
public static void normalize(AssociativeArray associativeArray) {
        double sum = 0.0;
        //Prevents numeric underflow by subtracting the max. References: http://www.youtube.com/watch?v=-RVM21Voo7Q
        for(Map.Entry<Object, Object> entry : associativeArray.entrySet()) {
            Double value = TypeInference.toDouble(entry.getValue());
            associativeArray.put(entry.getKey(), value);

            sum += value;
        }
        
        if(sum!=0.0) {
            for(Map.Entry<Object, Object> entry : associativeArray.entrySet()) {
                associativeArray.put(entry.getKey(), TypeInference.toDouble(entry.getValue())/sum);
            }
        }
    }
1311269
function SpecialSetting(oClass, name, info) {
		info = typeof info !== 'object' ? { type: info } : info;
		this.name = name;
		this.type = info.type || 'any';
		this.visibility = info.visibility || 'public';
		this.defaultValue = info.defaultValue;
		this.appData = remainder(this, info);
		this._oParent = oClass;
		this._sUID = "special:" + name;
		this._iKind = Kind.SPECIAL_SETTING;
	}
446581
function normalizeValue(value, info) {
  if (typeof value === 'number') {
    value = String(value)
  } else if (typeof value === 'boolean') {
    value = info.attribute
  } else if (typeof value === 'object' && 'length' in value) {
    value = (info.commaSeparated ? commaSeparated : spaceSeparated)(value)
  }

  return value
}
1354579
public void normalize() {
        for (int i = 0; i < size; i++) {
            keys[i] = lowerCase(keys[i]);
        }
    }
1148487
def normalize(self):
        

        if self.moc is None:
            raise CommandError('No MOC information present for normalization')

        order = int(self.params.pop())
        self.moc.normalize(order)
114321
private void setupDefaultAccountInfoHandler() {
		final BitfinexAccountSymbol accountSymbol = BitfinexSymbols.account(BitfinexApiKeyPermissions.NO_PERMISSIONS);
		final AccountInfoHandler accountInfoHandler = new AccountInfoHandler(ACCCOUNT_INFO_CHANNEL, accountSymbol);
		accountInfoHandler.onHeartbeatEvent(timestamp -> this.updateConnectionHeartbeat());
		channelIdToHandlerMap.put(ACCCOUNT_INFO_CHANNEL, accountInfoHandler);
	}
1033940
function normalizeOptions(obj) {
  for (var key in obj) {
    if (utils.optsKeys.indexOf(key) > -1) {
      obj.options = obj.options || {};
      obj.options[key] = obj[key];
      delete obj[key];
    }
  }
  return obj;
}
1048261
function normalizeIP(addr) {
  var claimsToBeIPv6 = /:/.test(addr);
  if(claimsToBeIPv6) {
    var ip6 = new Address6(addr);
    if(ip6.valid) {
      return ip6.canonicalForm();
    } else if(ip6.error) {
      throw new Error(ip6.error);
    } else {
      throw new Error("Unknown error while parsing IPv6 address.");
    }
  } else {
    var isIPv4 = false;
    try {
      var ip4 = new Address4(addr);
      isIPv4 = ip4.valid;
    }
    //  Any exception thrown implies not a valid IPv4 address.
    catch(error) {
      throw new Error("Unknown error while parsing IPv4 Address: "+error);
    }

    if(isIPv4) {
      return addr;
    }
    else {
      throw new Error("Unknown error while parsing IPv4 Address.");
    }
  }
}