Check if the event should be included in the statistics counter.

@param string $type
Name of event type
@param string $sub_type
Name of event sub type
@return boolean
166163
private static function validStats($type, $sub_type) {
    if ( ($type === 'content' && $sub_type === 'shortcode insert') || // Count number of shortcode inserts
         ($type === 'library' && $sub_type === NULL) || // Count number of times library is loaded in editor
         ($type === 'results' && $sub_type === 'content') ) { // Count number of times results page has been opened
      return TRUE;
    }
    elseif (self::isAction($type, $sub_type)) { // Count all actions
      return TRUE;
    }
    return FALSE;
  }
1065263
public function countGroup($type, $selection_name)
    {
        $group_name = $type->getName();
        $key = $group_name.'_'.$selection_name;

        if(!array_key_exists($key, $this->counts))
        {
            $family = $type->getFamily();
            $Amapper = $this->mappersMediator->getAMapper($family);
            $selectionUnit = $this->tuner->getSelection($group_name, $selection_name);
            $count_val = $Amapper->count($selectionUnit);
            $this->counts[$key] = $count_val;
        }

        return $this->counts[$key];
    }
449396
public boolean recordTypeSummary() {
    if (!currentInfo.isTypeSummary() && !currentInfo.isExterns()) {
      currentInfo.setTypeSummary(true);
      populated = true;
      return true;
    } else {
      return false;
    }
  }
43005
public function isNodeTypeBlacklisted(string $type) : bool
    {
        return $this->nodeTypeBlacklist && isset($this->nodeTypeBlacklist[$type]);
    }
1013371
public static function isSubType($subType, $mimeType) {
        return in_array(self::_findMimeType($mimeType), self::getSubTypeList($subType));
    }
715315
public function is_included() {
		$queried_object = get_queried_object();

		if ( ! empty( $queried_object->taxonomy ) && $queried_object->taxonomy == $this->get_subtype() ) {
			return true;
		}

		return false;
	}
741234
protected function countJobsByType($type)
    {
        $minutes = $type === 'failed_jobs' ? $this->failedJobExpires : $this->recentJobExpires;

        return $this->connection()->zcount(
            $type, '-inf', Chronos::now()->subMinutes($minutes)->getTimestamp() * -1
        );
    }
828229
public function isTypehintAble(): bool
    {
        if ($this->hasRemovedTypes()) {
            return false;
        }

        $typeCount = count($this->types);

        if ($typeCount >= 2 && $this->isArraySubtype($this->types)) {
            return true;
        }

        return $typeCount === 1;
    }
387476
public function isType($type)
    {
        if ($this->has(strtolower($type))) {
            return true;
        }

        return $this->detectType() === $type;
    }
472043
public function count_response($subpart, $try = 0) {
        $responseanalysisforclass = $this->get_response_class($subpart->responseclassid);
        $responseanalysisforclass->count_response($subpart->response, $subpart->fraction, $try);
    }
244057
public static function getRowCount( $table, $type = 'row' ) {

		$stat = self::find()->where( '`table`=:table AND type=:type', [ ':table' => $table, ':type' => $type ] )->one();

		if( isset( $stat ) ) {

			return $stat->count;
		}

		return 0;
	}
489166
@SuppressWarnings("SimplifiableIfStatement")
    public boolean isSubTypeOf(Type maybeSubType, Type superType) {
        TypeInfo maybeSubTypeInfo = TypeInfo.typeInfo(maybeSubType);
        TypeInfo superTypeInfo = TypeInfo.typeInfo(superType);
        // Equivalent type is a valid subtype
        if (maybeSubTypeInfo.equals(superTypeInfo)) {
            return true;
        }


        // If superType is non-null, maybeSubType must also be non-null.
        if (superTypeInfo.isNonNull()) {
            if (maybeSubTypeInfo.isNonNull()) {
                return isSubTypeOf(maybeSubTypeInfo.unwrapOneType(), superTypeInfo.unwrapOneType());
            }
            return false;
        }
        if (maybeSubTypeInfo.isNonNull()) {
            // If superType is nullable, maybeSubType may be non-null or nullable.
            return isSubTypeOf(maybeSubTypeInfo.unwrapOneType(), superType);
        }

        // If superType type is a list, maybeSubType type must also be a list.
        if (superTypeInfo.isList()) {
            if (maybeSubTypeInfo.isList()) {
                return isSubTypeOf(maybeSubTypeInfo.unwrapOneType(), superTypeInfo.unwrapOneType());
            }
            return false;
        }
        if (maybeSubTypeInfo.isList()) {
            // If superType is not a list, maybeSubType must also be not a list.
            return false;
        }

        // If superType type is an abstract type, maybeSubType type may be a currently
        // possible object type.
        if (isInterfaceOrUnion(superType) &&
                isObjectType(maybeSubType) &&
                isPossibleType(superType, maybeSubType)) {
            return true;
        }

        // Otherwise, the child type is not a valid subtype of the parent type.
        return false;
    }
322339
private void addSubType(FunctionType subType) {
    if (subTypes == null) {
      subTypes = new ArrayList<>();
    }
    subTypes.add(subType);
  }
1018751
private function allowedTypeExist(string $type):bool
    {
        foreach ($this->allowed_text_render as $one) {
            if ($one["type"] === $type) {
                return (true);
            }
        }
        return (false);
    }
43183
public function get_plugin_by_type($subtype, $type) {
        $shortsubtype = substr($subtype, strlen('assign'));
        $name = $shortsubtype . 'plugins';
        if ($name != 'feedbackplugins' && $name != 'submissionplugins') {
            return null;
        }
        $pluginlist = $this->$name;
        foreach ($pluginlist as $plugin) {
            if ($plugin->get_type() == $type) {
                return $plugin;
            }
        }
        return null;
    }
1164230
public function hasMenuAction(ResourceType $type)
    {
        $menuActions = $this->menuRepo->findBy(
            array('resourceType' => $type)
        );

        return count($menuActions) > 0;
    }
1254541
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            minValue = gauge.getMinValue();
            maxValue = gauge.getMaxValue();
            range    = gauge.getRange();
            redraw();
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            Helper.enableNode(subTitleText, !gauge.getSubTitle().isEmpty());
            Helper.enableNode(averageLine, gauge.isAverageVisible());
            Helper.enableNode(averageText, gauge.isAverageVisible());
            Helper.enableNode(stdDeviationArea, gauge.isAverageVisible());
            redraw();
        } else if ("SECTION".equals(EVENT_TYPE)) {

        } else if ("ALERT".equals(EVENT_TYPE)) {

        } else if ("VALUE".equals(EVENT_TYPE)) {
            if(gauge.isAnimated()) { gauge.setAnimated(false); }
            if (!gauge.isAveragingEnabled()) { gauge.setAveragingEnabled(true); }
            double value = clamp(minValue, maxValue, gauge.getValue());
            addData(value);
            drawChart(value);
        } else if ("AVERAGING_PERIOD".equals(EVENT_TYPE)) {
            noOfDatapoints = gauge.getAveragingPeriod();
            // To get smooth lines in the chart we need at least 4 values
            if (noOfDatapoints < 4) throw new IllegalArgumentException("Please increase the averaging period to a value larger than 3.");
            for (int i = 0; i < noOfDatapoints; i++) { dataList.add(minValue); }
            pathElements.clear();
            pathElements.add(0, new MoveTo());
            for (int i = 1 ; i < noOfDatapoints ; i++) { pathElements.add(i, new LineTo()); }
            sparkLine.getElements().setAll(pathElements);
            redraw();
        }
    }