get total error contribution for component with specific tag
978640
def getErrorComponent(result, tag):
    """"""
    return math.sqrt(sum(
        (error*2)**2
        for (var, error) in result.error_components().items()
        if var.tag == tag
    ))
419139
@Override
	protected void onComponentTag(ComponentTag tag) {
		super.onComponentTag(tag);
		
		if(model.getObject().size() > 0) tag.append("class", "has-error", " ");
	}
1358417
private function tagConsoleErrorListener(ContainerBuilder $container): void
    {
        $listener = $container->getDefinition(ErrorListener::class);

        if (class_exists('Symfony\Component\Console\Event\ConsoleErrorEvent')) {
            $tagAttributes = [
                'event' => ConsoleEvents::ERROR,
                'method' => 'onConsoleError',
                'priority' => '%sentry.listener_priorities.console_error%',
            ];
        } else {
            $tagAttributes = [
                'event' => ConsoleEvents::EXCEPTION,
                'method' => 'onConsoleException',
                'priority' => '%sentry.listener_priorities.console_error%',
            ];
        }

        $listener->addTag('kernel.event_listener', $tagAttributes);
    }
948802
function getOpenTagParams(tag, tmplRule) {
  var pattern = tmplRule.openTagParams,
      matchArr,
      ret;

  while (matchArr = pattern.exec(tag)) {
    var key = matchArr[1];

    if (key === '/') {
      //If match to the last of "/", then continue the loop.
      continue;
    }

    if (!ret) {
      ret = [];
    }

    var value = matchArr[8],
        onlyBrace = matchArr[4] != null ? matchArr[4] : matchArr[6],
        onlyKey = false;

    if (value != null) {
      value = clearQuot(value); //Remove quotation marks
    } else {
      value = key; //Match to Similar to "checked" or "disabled" attribute.

      if (!onlyBrace) {
        onlyKey = true;
      }
    } //Removed at the end of "/>", ">" or "/".


    if (!matchArr[9] && !matchArr[10]) {
      if (/\/>$/.test(value)) {
        value = value.substr(0, value.length - 2);
      } else if (/>$/.test(value) || /\/$/.test(value)) {
        value = value.substr(0, value.length - 1);
      }
    } //Transform special key


    var hasColon = void 0;

    if (key[0] === ':') {
      key = key.substr(1);
      hasColon = true;
    }

    ret.push({
      key: key,
      value: value,
      onlyBrace: onlyBrace,
      hasColon: hasColon,
      onlyKey: onlyKey
    });
  }

  return ret;
}
1299693
function getErrorMess (code, name) {
  let mess
  switch (code) {
    case eCode.siteExceed:
      mess = 'storage space need less than 4k'
      break
    case eCode.lsExceed:
      mess = 'Uncaught DOMException: Failed to execute setItem on Storage: Setting the value of ' +
        name + ' exceeded the quota at ' + window.location.href
  }
  return mess
}
472731
private function checkAndRegisterDisallowedTagsError(): void
    {
        $disallowedTags = $this->getDisallowedTags();
        $tags = $this->getAllTags();

        foreach ($tags as $tagPos => $tag) {
            $tagContent = $tag['content'];

            if (in_array(substr($tagContent, 1), $disallowedTags)) {
                $this->file->addError(
                    self::MESSAGE_TAG_NOT_ALLOWED,
                    $tagPos,
                    static::CODE_TAG_NOT_ALLOWED,
                    [$tagContent]
                );
            }
        }
    }
929322
function getElementName (props, tag) {
  if (typeof props.id === 'string' && !placeholderRe.test(props.id)) {
    return camelCase(props.id)
  }
  if (typeof props.className === 'string' && !placeholderRe.test(props.className)) {
    return camelCase(props.className.split(' ')[0])
  }
  return tag || 'nanohtml'
}
425027
function() {
    var c=[], ce=this.childElements, celts=this.ctlElements, eltType;
    if (ce && ce.length) {
      for (var i=0, sz=ce.length;sz>i;i++) {
        eltType=celts[ce[i].name].type;
        if (eltType==="component") {
          c.push(ce[i].controller);
        } else if (eltType==="template") {
          c.push(ce[i]);
        } else {
          log.error(this+" Invalid element type: "+eltType);
        }
      }
    }
    return c.length>0? c : null;
  }
995431
public void doTag()
            throws JspException
    {
        if (hasErrors()) {
            reportErrors();
            return;
        }

        JspTag tag = SimpleTagSupport.findAncestorWithClass(this, IAttributeConsumer.class);
        if (!(tag instanceof IAttributeConsumer)) {
            String s = Bundle.getString("Tags_AttributeInvalidParent");
            registerTagError(s, null);
            reportErrors();
            return;
        }

        IAttributeConsumer ac = (IAttributeConsumer) tag;
        ac.setAttribute(_name, _value, _facet);
        return;
    }
1336382
protected
  void parseErrorHandler(Element element, Appender appender) {
    ErrorHandler eh = (ErrorHandler) OptionConverter.instantiateByClassName(
                                       subst(element.getAttribute(CLASS_ATTR)),
                                       org.apache.log4j.spi.ErrorHandler.class, 
 				       null);
    
    if(eh != null) {
      eh.setAppender(appender);

      PropertySetter propSetter = new PropertySetter(eh);
      NodeList children = element.getChildNodes();
      final int length 	= children.getLength();

      for (int loop = 0; loop < length; loop++) {
	Node currentNode = children.item(loop);
	if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
	  Element currentElement = (Element) currentNode;
	  String tagName = currentElement.getTagName();
	  if(tagName.equals(PARAM_TAG)) {
            setParameter(currentElement, propSetter);
	  } else if(tagName.equals(APPENDER_REF_TAG)) {
	    eh.setBackupAppender(findAppenderByReference(currentElement));
	  } else if(tagName.equals(LOGGER_REF)) {
	    String loggerName = currentElement.getAttribute(REF_ATTR);	    
	    Logger logger = (catFactory == null) ? repository.getLogger(loggerName)
                : repository.getLogger(loggerName, catFactory);
	    eh.setLogger(logger);
	  } else if(tagName.equals(ROOT_REF)) {
	    Logger root = repository.getRootLogger();
	    eh.setLogger(root);
	  } else {
          quietParseUnrecognizedElement(eh, currentElement, props);
      }
	}
      }
      propSetter.activate();
      appender.setErrorHandler(eh);
    }
  }
970552
async function getTagCommit(githubRepo, tag) {
  const cachedResult = await renovateCache.get(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`)
  );
  // istanbul ignore if
  if (cachedResult) {
    return cachedResult;
  }
  let digest;
  try {
    const url = `https://api.github.com/repos/${githubRepo}/git/refs/tags/${tag}`;
    digest = (await ghGot(url)).body.object.sha;
  } catch (err) {
    logger.info(
      { githubRepo, err },
      'Error getting tag commit from GitHub repo'
    );
  }
  if (!digest) {
    return null;
  }
  const cacheMinutes = 120;
  await renovateCache.set(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`),
    digest,
    cacheMinutes
  );
  return digest;
}
36272
function reportNonMatchingComponentName(node, rawName, name, filename) {
      context.report(
        node,
        'Component name ' + rawName + ' (' + name + ') does not match filename ' + filename
      );
    }
416629
function getErrors(conf, path, props) {
  var originInfo = path || props ? "problem with prop: `".concat(props, "` at path: `").concat(path, "`") : '';
  var tradPatt = conf.pattern === 'traditional';
  var setter = conf.setter;
  var deletor = conf.deletor;
  var prop = 'items';
  var mutationNameSet = tradPatt ? 'SET_' + prop.toUpperCase() : prop;
  var mutationNameDel = tradPatt ? 'DELETE_' + prop.toUpperCase() : prop;
  var exampleSetters__Wildcard = "\n    Correct usage examples:\n    // From Vue-components:\n    ".concat(setter, "('").concat(prop, ".*', {'123': {name: 'the best item'}})\n\n    // From the Vuex store:\n    dispatch('").concat(setter, "/").concat(prop, ".*', {'123': {name: 'the best item'}})\n    // or\n    commit('").concat(mutationNameSet, ".*', {'123': {name: 'the best item'}})");
  var exampleSetters__DoubleWildcard = "\n    Correct usage examples:\n    // From Vue-components:\n    ".concat(setter, "('").concat(prop, ".*.tags.*', ['123', {water: true}])\n\n    // From the Vuex store:\n    dispatch('").concat(setter, "/").concat(prop, ".*.tags.*', ['123', {water: true}])\n    // or\n    commit('").concat(mutationNameSet, ".*.tags.*', ['123', {water: true}])");
  var exampleDeletor = "\n    Correct usage examples:\n    // From Vue-components:\n    ".concat(deletor, "('").concat(prop, ".*', '123')\n\n    // From the Vuex store:\n    dispatch('").concat(deletor, "/").concat(prop, ".*', '123')\n    // or\n    commit('").concat(mutationNameDel, ".*', '123')");
  return {
    mutationSetterNoId: "".concat(originInfo, "\n      The payload needs to be an object with an `id` field.\n      ").concat(exampleSetters__Wildcard),
    mutationSetterPropPathWildcardMissingItemDoesntExist: "".concat(originInfo, "\n      The item does not exist! Make sure you first set the item.\n      ").concat(exampleSetters__Wildcard),
    mutationSetterPropPathWildcardIdCount: "".concat(originInfo, "\n      The amount of ids and wildcards `'*'` are not equal.\n      If you have multiple wildcards you need to pass an array, where each item is an ID and the last is the property you want to set.\n      ").concat(exampleSetters__DoubleWildcard, "\n      "),
    mutationDeleteNoId: "".concat(originInfo, "\n      The payload needs to be an object with an `id` field.\n      ").concat(exampleDeletor, "\n      "),
    wildcardFormatWrong: "".concat(originInfo, "\n      There was something wrong with the payload passed when using a path with wildcards.\n\n      A) Path with wildcard:\n      ").concat(exampleSetters__Wildcard, "\n\n      B) Path with multiple wildcards:\n      ").concat(exampleSetters__DoubleWildcard, "\n    "),
    missingDeleteMutation: "\n      There is no mutation set for '".concat(path, "'.\n      Something went wrong with your vuex-easy-access setup.\n      Did you manually add `...defaultMutations(state)` to your modules?\n      See the documentation here:\n        https://github.com/mesqueeb/VuexEasyAccess#setup\n\n\n      // You can also manually add a mutation like so in the correct module (not recommended!!):\n      mutations: {\n        '").concat(tradPatt ? 'DELETE_' + props.toUpperCase() : '-' + props, "': (state, payload) => {\n          this._vm.$delete(state.").concat(props, ")\n        }\n      }\n    "),
    missingSetterMutation: "\n      There is no mutation set for '".concat(path, "'.\n      Something went wrong with your vuex-easy-access setup.\n      Did you manually add `...defaultMutations(state)` to your modules?\n      See the documentation here:\n        https://github.com/mesqueeb/VuexEasyAccess#setup\n\n\n      // You can also manually add a mutation like so in the correct module (not recommended!!):\n      mutations: {\n        '").concat(tradPatt ? 'SET_' + props.toUpperCase() : props, "': (state, payload) => {\n          state.").concat(props, " = payload\n        }\n      }\n    ")
  };
}
1205700
def getRenderModelErrorNameFromEnum(self, error):
        """"""

        fn = self.function_table.getRenderModelErrorNameFromEnum
        result = fn(error)
        return result
1176055
function(item) {
  var result = {};

  _.each(item, function(value, key) {
    if (fix[key]) {
      result[key] = parseItem(fix[key](value));
    } else if (key === 'Tags') {
      result[key] = parseTags(value);
    } else {
      result[key] = parseItem(value);
    }
  });

  return result;
}
784565
function defaultOnInputValidationResult(el, validationsResult, validatorName, stateEnum) {

        var errorDiv;

        // for radio buttons and checkboxes:  get the last element in group by name
        if ((el.nodeName.toLowerCase() === 'input' && (el.type === 'radio' || el.type === 'checkbox'))) {

            var getAllByName = el.parentNode.querySelectorAll('input[name="' + el.name + '"]');

            el = getAllByName.item(getAllByName.length - 1);
        }

        if (validationsResult.stateEnum === stateEnum.invalid) {

            errorDiv = getExistingErrorDiv(el);
            if (errorDiv) {
                errorDiv.textContent = validationsResult.message;
            } else {
                appendNewErrorDiv(el, validationsResult.message);
            }

            el.style.borderStyle = "solid";
            el.style.borderColor = "#ff0000";
            $$.addClass(el, "vivalid-error-input");
        } else {
            errorDiv = getExistingErrorDiv(el);
            if (errorDiv) {
                errorDiv.parentNode.removeChild(errorDiv);
                el.style.borderStyle = "";
                el.style.borderColor = "";
                $$.removeClass(el, "vivalid-error-input");
            }
        }

        function getExistingErrorDiv(el) {
            if (el.nextElementSibling && el.nextElementSibling.className === "vivalid-error") {
                return el.nextElementSibling;
            }

        }

        function appendNewErrorDiv(el, message) {
            errorDiv = document.createElement("DIV");
            errorDiv.className = "vivalid-error";
            errorDiv.style.color = "#ff0000";
            var t = document.createTextNode(validationsResult.message);
            errorDiv.appendChild(t);
            el.parentNode.insertBefore(errorDiv, el.nextElementSibling);
        }

    }
410951
public void doTag()
            throws JspException
    {
        JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IFormattable.class);

        // if there are errors we need to either add these to the parent AbstractBastTag or report an error.
        if (hasErrors()) {
            if (parentTag instanceof IFormattable) {
                IFormattable parent = (IFormattable) parentTag;
                parent.formatterHasError();
            }
            reportErrors();
            return;
        }

        // if there are no errors then add this to the parent as a formatter.
        if (parentTag instanceof IFormattable) {
            NumberFormatter formatter = new NumberFormatter();
            formatter.setPattern(_pattern);
            formatter.setType(_type);
            formatter.setLocale(getLocale());
            IFormattable parent = (IFormattable) parentTag;
            parent.addFormatter(formatter);
        }
        else {
            String s = Bundle.getString("Tags_FormattableParentRequired");
            registerTagError(s, null);
            reportErrors();
        }
    }