Please refer to the specification for details about normalized definitions.
496548
def get_normalized_definition(self):
        """"""
        cast_mode = 'saturated' if self.cast_mode == PrimitiveType.CAST_MODE_SATURATED else 'truncated'
        primary_type = {
            PrimitiveType.KIND_BOOLEAN: 'bool',
            PrimitiveType.KIND_UNSIGNED_INT: 'uint' + str(self.bitlen),
            PrimitiveType.KIND_SIGNED_INT: 'int' + str(self.bitlen),
            PrimitiveType.KIND_FLOAT: 'float' + str(self.bitlen)
        }[self.kind]
        return cast_mode + ' ' + primary_type
1051565
def p_definitions(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))
1348583
function normalizeDimensionsDefine(dimensionsDefine) {
    if (!dimensionsDefine) {
        // The meaning of null/undefined is different from empty array.
        return;
    }
    var nameMap = createHashMap();
    return map(dimensionsDefine, function (item, index) {
        item = extend({}, isObject(item) ? item : {name: item});

        // User can set null in dimensions.
        // We dont auto specify name, othewise a given name may
        // cause it be refered unexpectedly.
        if (item.name == null) {
            return item;
        }

        // Also consider number form like 2012.
        item.name += '';
        // User may also specify displayName.
        // displayName will always exists except user not
        // specified or dim name is not specified or detected.
        // (A auto generated dim name will not be used as
        // displayName).
        if (item.displayName == null) {
            item.displayName = item.name;
        }

        var exist = nameMap.get(item.name);
        if (!exist) {
            nameMap.set(item.name, {count: 1});
        }
        else {
            item.name += '-' + exist.count++;
        }

        return item;
    });
}
809396
protected function needDefined()
    {
        if ($this->defined) return;
        $this->defined = true;

        $name = $pattern = $note = null;

        if (preg_match(PARSER_PATTERN, $this->definition, $matches)) {
            $body = $matches[1];
            $name = $matches[2];
            $note = $matches[3];

            $pos = strpos($name, '|');
            if ($pos !== false) {
                $pattern = $this->assertPattern(trim(substr($name, $pos + 1)));

                $name = trim(substr($name, 0, $pos));
            }
        } else {
            $body = $this->definition;
        }

        $this->define($body, $name, $pattern, $note);
    }
120376
function normalizeConfig(config, pkg) {

  const rules = config.rules || {};

  const validatedRules = Object.keys(rules).reduce((normalizedRules, name) => {

    const value = rules[name];

    // prefix local rule definition
    if (name.indexOf('bpmnlint/') === 0) {
      name = name.substring('bpmnlint/'.length);
    }

    normalizedRules[name] = value;

    return normalizedRules;
  }, {});

  return {
    ...config,
    rules: validatedRules
  };
}
1352637
private void normalizeDate() {
		while (day <= 0) {
			int days = TimeUtils.yearLength(month > 2 ? year : year - 1);
			day += days;
			--year;
		}

		if (month <= 0) {
			int years = month / 12 - 1;
			year += years;
			month -= 12 * years;
		} else if (month > 12) {
			int years = (month - 1) / 12;
			year += years;
			month -= 12 * years;
		}

		while (true) {
			if (month == 1) {
				int yearLength = TimeUtils.yearLength(year);
				if (day > yearLength) {
					++year;
					day -= yearLength;
				}
			}

			int monthLength = TimeUtils.monthLength(year, month);
			if (day <= monthLength) {
				break;
			}

			day -= monthLength;
			if (++month > 12) {
				month -= 12;
				++year;
			}
		}
	}
125303
def _normalize_data_types(self, strategy):
        '''  '''
        for k, v in strategy.iteritems():
            if not isinstance(v, str):
                # There is probably nothing to do
                continue
            if v == 'true':
                strategy[k] = True
            elif v == 'false' or v is None:
                strategy[k] = False
            else:
                try:
                    if v.find('.') > 0:
                        strategy[k] = float(v)
                    else:
                        strategy[k] = int(v)
                except ValueError:
                    pass
815637
private String genInnerTypeDef(StructureDefinition sd, ElementDefinition ed) {
    String path = ed.hasBase() ? ed.getBase().getPath() : ed.getPath();;
    ST element_reference = tmplt(SHAPE_DEFINITION_TEMPLATE);
    element_reference.add("resourceDecl", "");  // Not a resource
    element_reference.add("id", path);
    String comment = ed.getShort();
    element_reference.add("comment", comment == null? " " : "# " + comment);

    List<String> elements = new ArrayList<String>();
    for (ElementDefinition child: ProfileUtilities.getChildList(sd, path, null))
      elements.add(genElementDefinition(sd, child));

    element_reference.add("elements", StringUtils.join(elements, "\n"));
    return element_reference.render();
  }
181184
function mapDefinitionsFromModel(model) {
  const definitionMap = [];

  /* istanbul ignore else */
  if (model && model.definitions) {
    debug('Parsing %s definitions', Object.keys(model.definitions).length);
    for (const definitionName of Object.keys(model.definitions)) {
      debug('  Reading definition for %s', definitionName);
      const definitionKey = util.format('#/definitions/%s', definitionName);
      const currentDef = model.definitions[definitionName];
      currentDef.definitionName = definitionName;
      currentDef.referencePath = definitionKey;
      definitionMap[definitionKey] = currentDef;
    }
  }

  return definitionMap;
}
901973
def p_description(self, p):
        ''
        p[0] = Description(definitions=p[1], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
424887
function normalizeMultiArgReportCall() {
  // If there is one argument, it is considered to be a new-style call already.
  if (arguments.length === 1) {
    return arguments[0];
  }

  // If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
  if (typeof arguments[1] === 'string') {
    return {
      node: arguments[0],
      message: arguments[1],
      data: arguments[2],
      fix: arguments[3],
    };
  }

  // Otherwise, the arguments are interpreted as [node, loc, message, data, fix].
  return {
    node: arguments[0],
    loc: arguments[1],
    message: arguments[2],
    data: arguments[3],
    fix: arguments[4],
  };
}
790925
def generate_specifications(self, count=1):
        

        out = {}

        # mapping of UID index to AR objects {1: <AR1>, 2: <AR2> ...}
        copy_from = self.get_copy_from()

        for arnum in range(count):
            # get the source object
            source = copy_from.get(arnum)

            if source is None:
                out[arnum] = {}
                continue

            # get the results range from the source object
            results_range = source.getResultsRange()

            # mapping of keyword -> rr specification
            specification = {}
            for rr in results_range:
                specification[rr.get("keyword")] = rr
            out[arnum] = specification

        return out
106006
def AddSpecification(self, specification):
    
    if specification.identifier in self._format_specifications:
      raise KeyError(
          'Format specification {0:s} is already defined in store.'.format(
              specification.identifier))

    self._format_specifications[specification.identifier] = specification

    for signature in specification.signatures:
      signature_index = len(self._signature_map)

      signature_identifier = '{0:s}:{1:d}'.format(
          specification.identifier, signature_index)

      if signature_identifier in self._signature_map:
        raise KeyError('Signature {0:s} is already defined in map.'.format(
            signature_identifier))

      signature.SetIdentifier(signature_identifier)
      self._signature_map[signature_identifier] = specification
769980
function Description (msg, f, options) {
  this.id = ++id;
  // Static fields:
  this.message = msg;
  this.behavior = f;
  this.verbose = false;
  this.specificationIntended = undefined;
  Object.assign(this, options || {});
  // Internal (dynamic) fields:
  this.specifications = [];
  this.result = undefined;
  this.raisedException = false;
  this.exception = null;
  this.specificationAttempted = 0;
  this.specificationSuccessful = 0;
  this.expectationAttempted = 0;
  this.expectationSuccessful = 0;
  this.pass = false;
  this.log = [];
}
1287369
void normalize()
    {
        double nrm = norm();
        for (Map.Entry<Integer, Double> d : entrySet())
        {
            d.setValue(d.getValue() / nrm);
        }
    }
1000069
function getParamsDetails(spec_c) {
  var paras = getChildren(spec_c, 'para');
  var details = _.find(_.map(paras, function(para) {
    return getChild(para, 'parameterlist');
  }), function(obj) { return (obj != undefined); });
  return (details ? details.children : undefined);
}
505972
protected static function aggregateDefinitions()
    {
        array_map(function (TypesDefinition $definition) {
            static::$compounds = array_merge(
                static::$compounds,
                $definition->getCompounds()
            );

            static::$scalars = array_merge(
                static::$scalars,
                $definition->getScalars()
            );

            static::$specials = array_merge(
                static::$specials,
                $definition->getSpecial()
            );

            static::$types = array_merge(
                static::$types,
                $definition->getCompounds(),
                $definition->getScalars(),
                $definition->getSpecial()
            );
        }, static::$definitions);
    }