Loop through each match and build the array of changes that will be passed to the template.
340638
function getChanges(log, regex) {
      var changes = [];
      var match;

      while ((match = regex.exec(log))) {
        var change = '';

        for (var i = 1, len = match.length; i < len; i++) {
          change += match[i];
        }

        changes.push(change.trim());
      }

      return changes;
    }
155393
def compute_changes
      spec_sets_diff!

      old_spec_set.each do |old_gem|
        updated_gem = new_spec_set.find { |new_gem| new_gem.name == old_gem.name }
        next unless updated_gem && old_gem.version != updated_gem.version

        fill_changes(old_gem, updated_gem)
      end
    end
665402
def data
      templates = @templates.deep_clone

      templates.each_pair do |name, value|
        if value['bindings']
          value['bindings'].each_pair do |number, binding|
            value['bindings'][number] = binding.map { |code| eval(code) }
          end
        end
      end

      templates
    end
253656
public function replaceTemplateTypesWithStandins(
        array &$template_types,
        array &$generic_params,
        Codebase $codebase = null,
        Atomic $input_type = null,
        bool $replace = true,
        bool $add_upper_bound = false,
        int $depth = 0
    ) {
        foreach ($this->properties as $offset => $property) {
            $input_type_param = null;

            if ($input_type instanceof Atomic\ObjectLike
                && isset($input_type->properties[$offset])
            ) {
                $input_type_param = $input_type->properties[$offset];
            }

            $property->replaceTemplateTypesWithStandins(
                $template_types,
                $generic_params,
                $codebase,
                $input_type_param,
                $replace,
                $add_upper_bound,
                $depth
            );
        }
    }
523808
function() {
							this.calculateItemCounts();
							this.getParent().updateItems(sap.ui.model.ChangeReason.Change);
							template.removeDelegate(oDelegate);
						}
45446
function applyChanges(state, changes, queryInfo) {
  if (state === undefined) return state;
  return changes.reduce(function (stateValue, change) {
    return applyChange(stateValue, change, queryInfo);
  }, state);
}
244325
function(params, options) {
      var t = this;

      // If raw text was sent to the template, compile and return
      if (t.get('text')) {
        t.compile();
        return;
      }

      // Watch for changes in the text element
      t.on('change:text', t.compile, t);

      // Process a file template
      var path = t.get('path');
      if (path) {
        // Load the file
        if (t.asyncLoad) {
          FS.readFile(path, function(err, text) {
            if (err) {
              return console.error('Error reading file: ' + path, err);
            }
            t.set({text: text.toString()});
          });
        } else {
          t.set({text: FS.readFileSync(path).toString()});
        }

        // Watch the file for changes
        if (t.get('watchFile')) {
          t._watchFile();
        }
      }
    }
1219666
public function replaceTemplateTypesWithStandins(
        array &$template_types,
        array &$generic_params,
        Codebase $codebase = null,
        Atomic $input_type = null,
        bool $replace = true,
        bool $add_upper_bound = false,
        int $depth = 0
    ) {
        foreach ($this->type_params as $offset => $type_param) {
            $input_type_param = null;

            if (($input_type instanceof Atomic\TGenericObject
                    || $input_type instanceof Atomic\TIterable
                    || $input_type instanceof Atomic\TArray)
                &&
                    isset($input_type->type_params[$offset])
            ) {
                $input_type_param = $input_type->type_params[$offset];
            } elseif ($input_type instanceof Atomic\ObjectLike) {
                if ($offset === 0) {
                    $input_type_param = $input_type->getGenericKeyType();
                } elseif ($offset === 1) {
                    $input_type_param = $input_type->getGenericValueType();
                } else {
                    throw new \UnexpectedValueException('Not expecting offset of ' . $offset);
                }
            }

            $type_param->replaceTemplateTypesWithStandins(
                $template_types,
                $generic_params,
                $codebase,
                $input_type_param,
                $replace,
                $add_upper_bound,
                $depth + 1
            );
        }
    }
1000675
def _change(self, changes):
        
        if changes is None:
            return
        for position, new_tile in changes:
            self._array[position] = new_tile
468945
public function buildMatcher()
    {
        $res = [];
        $allMatchers = $this->_matchers;
        $declarations = [];
        // Matchers->iterate
        for ($i = sizeof($allMatchers) - 1; $i >= 0; $i--) {
            $matcherInfo = $allMatchers[$i];
            $decl = ['fn' => $matcherInfo['fn'], '__id' => $matcherInfo['__id'], 'index' => $i]
                + static::parseBemCssClasses($matcherInfo['expr']);
            $declarations[] = $decl;
        }

        $res[] = 'return function ($ctx, $json) use ($ms) {';

        $declByBlock = static::groupBy($declarations, 'block');

        if (isset($declByBlock['$before'])) {
            foreach ($declByBlock['$before'] as $decl) {
                static::pushMatcher($res, $decl['__id'], $decl['index']);
            }
        }

        $afterEach = isset($declByBlock['$after']) ? $declByBlock['$after'] : null;
        unset($declByBlock['$before'], $declByBlock['$after']);

        if ($declByBlock) :
        $res[] = 'switch ($json->block ?: __undefined) {';
        foreach ($declByBlock as $blockName => $blockData) {
            $res[] = 'case "' . $blockName . '":';

            $res[] = '  switch ($json->elem ?: __undefined) {';
            $declsByElem = static::groupBy($blockData, 'elem');
            foreach ($declsByElem as $elemName => $decls) {
                $elemCase = $elemName === __undefined ? '__undefined' : '"' . $elemName . '"';
                $res[] = '  case ' . $elemCase . ':';

                foreach ($decls as $decl) {
                    $__id = $decl['__id'];
                    $conds = [];
                    $conds[] = ('!isset($json->_m[' . $__id . '])');
                    if (isset($decl['elemMod'])) {
                        $modKey = $decl['elemMod'];
                        $conds[] = (
                            'isset($json->elemMods) && $json->elemMods->{"' . $modKey . '"} === ' .
                                ($decl['elemModVal'] === true ? 'true' : '"' . $decl['elemModVal'] . '"'));
                    }
                    if (isset($decl['blockMod'])) {
                        $modKey = $decl["blockMod"];
                        $conds[] = (
                            'isset($json->mods) && $json->mods->{"' . $modKey . '"} === ' .
                                ($decl['blockModVal'] === true ? 'true' : '"' . $decl['blockModVal'] . '"'));
                    }

                    $res[] = ('    if (' . join(' && ', $conds) . ') {');
                    static::pushMatcher($res, $__id, $decl['index']);
                    $res[] = ('    }');
                }

                $res[] = ('    break;');
            }
            $res[] = ('}');
            $res[] = ('  break;');
        }
        $res[] = ('}');
        endif;

        if ($afterEach) {
            foreach ($afterEach as $decl) {
                static::pushMatcher($res, $decl['__id'], $decl['index']);
            }
        }

        $res[] = ('};');

        return "return function (\$ms) {\n" . join("\n", $res) . "\n};";
    }
85802
function checkMutations(mutations) {

	// Skip iterating the nodes, if a run is already scheduled, to improve performance
	if (scheduledCall && (scheduledCall._level < 3 || !scheduledCall._contexts)) {
		return;
	}

	var addedNodes = [];
	var stylesChanged = false;

	var replacedSheets = [];
	processedSheets.forEach(function(newNode) {
		replacedSheets.push(newNode);
	});

	arrayFrom(mutations).forEach(function(mutation) {

		addedNodes.push.apply(addedNodes, arrayFrom(mutation.addedNodes).filter(function(node) {
			return node.nodeType === 1;
		}));

		arrayFrom(mutation.removedNodes).forEach(function(node) {
			var index = addedNodes.indexOf(node);
			if (index !== -1) {
				addedNodes.splice(index, 1);
			}
			else if (
				(node.tagName === 'LINK' || node.tagName === 'STYLE')
				&& replacedSheets.indexOf(node) === -1
			) {
				stylesChanged = true;
			}
		});

	});

	addedNodes.forEach(function(node) {
		if (node.sheet && replacedSheets.indexOf(node) === -1) {
			stylesChanged = true;
		}
	});

	if (stylesChanged) {
		scheduleExecution(1);
	}
	else if (addedNodes.length) {
		scheduleExecution(3, false, addedNodes);
	}

}
463955
function buildChangelogs (changelogList, entityTypeToLanguage, groupByApi) {
  const processSelection = changelogList.select('process')
  const tagSelections = processSelection.selectAll(tags, {recursive: true})

  // Select the versions and build a map for fast lookup
  const versionSelections = changelogList.selectAll('version')
  const versionSelectionsByVersion = {}
  versionSelections.forEach(versionSelection => {
    versionSelectionsByVersion[versionSelection.ps()] = versionSelection
  })

  const versions = Object.keys(versionSelectionsByVersion).sort(utils.semanticVersionComparator)

  // Group the tags by version
  const tagSelectionsByVersion = {}
  versions.forEach(version => {
    tagSelectionsByVersion[version] = []
  })
  tagSelections.forEach(t => {
    const version = t.ps()
    tagSelectionsByVersion[version] = tagSelectionsByVersion[version] || []
    tagSelectionsByVersion[version].push(t)
  })

  // Copy any deprecated tags across to the next version until a removed tag is reached
  versions.forEach((version, i) => {
    if (i + 1 < versions.length) {
      const nextVersion = versions[i + 1]
      tagSelectionsByVersion[version]
        .filter(tag => tag.type() === 'deprecated')
        .forEach(tag => {
          const parentHasRemoved = tag.parent().has('removed')
          const parentRemovedInNextVersion = parentHasRemoved && tag.parent().select('removed').ps() === nextVersion
          if (!parentHasRemoved || !parentRemovedInNextVersion) {
            tagSelectionsByVersion[nextVersion].push(tag)
          }
        })
    }
  })

  // Create the changelogs for each version and add the descriptions from the changelogList
  return versions.map(version => {
    const changelog = buildChangelog(version, versions, tagSelectionsByVersion[version], entityTypeToLanguage, groupByApi)
    const versionSelection = versionSelectionsByVersion[version]

    if (versionSelection && versionSelection.has('description')) {
      changelog.content.unshift(versionSelection.select('description').entity())
    }
    if (versionSelection && versionSelection.has('link')) {
      changelog.content.unshift(versionSelection.select('link').entity())
    }
    return changelog
  })
}
454955
def hook_get_results(self, changelist):
        """"""

        # Poor NestedSet guys they've punished themselves once chosen that approach,
        # and now we punish them again with all those DB hits.

        result_list = list(changelist.result_list)

        # Get children stats.
        filter_kwargs = {'%s' % self.left_field: models.F('%s' % self.right_field) - 1}  # Leaf nodes only.
        filter_kwargs.update(self.get_immediate_children_filter(self.parent))

        stats_qs = changelist.result_list.filter(**filter_kwargs).values_list('id')
        leafs = [item[0] for item in stats_qs]

        for result in result_list:

            if result.id in leafs:
                setattr(result, self.CHILD_COUNT_MODEL_ATTR, 0)
            else:
                setattr(result, self.CHILD_COUNT_MODEL_ATTR, '>1')  # Too much pain to get real stats, so that'll suffice.

        if self.pid:
            # Render to upper level link.
            parent = self.parent

            filter_kwargs = {
                '%s__lt' % self.left_field: getattr(parent, self.left_field),
                '%s__gt' % self.right_field: getattr(parent, self.right_field),
            }

            try:
                granparent_id = changelist.model.objects.filter(**filter_kwargs).order_by('-%s' % self.left_field)[0].id
            except IndexError:
                granparent_id = None

            if granparent_id != parent.id:
                parent = changelist.model(pk=granparent_id)

            setattr(parent, self.UPPER_LEVEL_MODEL_ATTR, True)
            result_list = [parent] + result_list

        changelist.result_list = result_list
243819
def put(self, template_name):
        """"""
        self.reqparse.add_argument('template', type=str, required=True)
        args = self.reqparse.parse_args()

        template = db.Template.find_one(template_name=template_name)

        if not template:
            return self.make_response('No such template found', HTTP.NOT_FOUND)

        changes = diff(template.template, args['template'])
        template.template = args['template']
        template.is_modified = True

        db.session.add(template)
        db.session.commit()
        auditlog(
            event='template.update',
            actor=session['user'].username,
            data={
                'template_name': template_name,
                'template_changes': changes
            }
        )

        return self.make_response('Template {} has been updated'.format(template_name))
1280547
def get_changes(self, remove=True, only_current=False, resources=None,
                    task_handle=taskhandle.NullTaskHandle()):
        
        changes = ChangeSet('Inline method <%s>' % self.name)
        if resources is None:
            resources = self.project.get_python_files()
        if only_current:
            resources = [self.original]
            if remove:
                resources.append(self.resource)
        job_set = task_handle.create_jobset('Collecting Changes',
                                            len(resources))
        for file in resources:
            job_set.started_job(file.path)
            if file == self.resource:
                changes.add_change(self._defining_file_changes(
                    changes, remove=remove, only_current=only_current))
            else:
                aim = None
                if only_current and self.original == file:
                    aim = self.offset
                handle = _InlineFunctionCallsForModuleHandle(
                    self.project, file, self.others_generator, aim)
                result = move.ModuleSkipRenamer(
                    self.occurrence_finder, file, handle).get_changed_module()
                if result is not None:
                    result = _add_imports(self.project, result,
                                          file, self.imports)
                    if remove:
                        result = _remove_from(self.project, self.pyname,
                                              result, file)
                    changes.add_change(ChangeContents(file, result))
            job_set.finished_job()
        return changes
998628
public function replaceTemplateTypesWithStandins(
        array &$template_types,
        array &$generic_params,
        Codebase $codebase = null,
        Atomic $input_type = null,
        bool $replace = true,
        bool $add_upper_bound = false,
        int $depth = 0
    ) {
        if ($this->params) {
            foreach ($this->params as $offset => $param) {
                $input_param_type = null;

                if (($input_type instanceof Atomic\Fn || $input_type instanceof Atomic\TCallable)
                    && isset($input_type->params[$offset])
                ) {
                    $input_param_type = $input_type->params[$offset]->type;
                }

                if (!$param->type) {
                    continue;
                }

                $param->type->replaceTemplateTypesWithStandins(
                    $template_types,
                    $generic_params,
                    $codebase,
                    $input_param_type,
                    $replace,
                    !$add_upper_bound,
                    $depth
                );
            }
        }

        if (($input_type instanceof Atomic\TCallable || $input_type instanceof Atomic\Fn)
            && $this->return_type
            && $input_type->return_type
        ) {
            $this->return_type->replaceTemplateTypesWithStandins(
                $template_types,
                $generic_params,
                $codebase,
                $input_type->return_type,
                $replace,
                $add_upper_bound
            );
        }
    }
823662
function Changed(opts){
 	/**
     * @define {object} Collection of public methods.
     */
    var self = {};

    /**
     * @define {object} Options for the constructor 
     */
    var opts = opts || {};

     /**
     * @define {array} Holds the values
     */
	var values;

	/**
	 * Trigger and update if values are changed
	 */
	function trigger(){
		/** Convert to array */
		var args = Array.prototype.slice.call(arguments);

		/** Splice to get the callback */
		var callback = args.splice(-1)[0];

		/** Loop through args */
		for (var i = 0; i < args.length; i++) {

			/** Check if values are changed */
			if(!values || values[i] != args[i]){

				/** If Changed call the callback */
				callback.apply(window, args);
				break;
			}
		}

		/** Set the values to the args */
		values = args;
	}

	/*
	* Public
	*/
	self.trigger = trigger;

	return self;
}