Check if data provider is compatible with current situation.

@return bool
978920
public function isCompatible(Map $map): bool
    {
        if (!$map->lapRace) {
            return false;
        }

        $nbLaps = 1;
        if ($map->lapRace) {
            $nbLaps = $map->nbLaps;
        }

        $scriptSettings = $this->gameDataStorage->getScriptOptions();
        if ($scriptSettings['S_ForceLapsNb'] != -1) {
            $nbLaps = $scriptSettings['S_ForceLapsNb'];
        }

        // If rounds is configured to be single laps then no need for race data. lap is sufficient.
        return $nbLaps > 1;    }
101538
public function isEnable()
    {
        if (!$this->mPDFExists() || !$this->collection()->getSize()) {
            return false;
        }

        return $this->hasConfig(self::ENABLE);
    }
770801
public function valid() : bool
    {
        if (false === $this->result->fetch(\PDO::FETCH_ASSOC, \PDO::FETCH_ORI_ABS, $this->pointer)) {
            return false;
        }
        return true;
    }
289628
def is_compatible(self):
        """"""
        for pattern in OPTIONS['compatible_patterns']:
            if fnmatch(self.package.lower(), pattern):
                return True
        return False
121028
public function exists()
    {
        try {
            $this->connection->getDataset($this->identity + ['fields' => 'datasetReference']);
        } catch (NotFoundException $ex) {
            return false;
        }

        return true;
    }
669876
public function hasPhpConfigIssue()
    {
        foreach ($this->requirements as $req) {
            if (!$req->isFulfilled() && $req instanceof PhpConfigRequirement) {
                return true;
            }
        }

        return false;
    }
252237
public function validateCompatible(array $data)
    {
        if(!count($data)) {
            /**
             * Allow empty
             */
            return true;
        }
        $count = 0;
        foreach($data as $k=>$v) {
            foreach(array('name','channel','min','max') as $fld) {
                $$fld = trim($v[$fld]);
            }
            $count++;

            $res = $this->validateUrl($channel) && strlen($channel);
            if(!$res) {
                $this->addError("Invalid or empty channel in compat. #{$count}");
            }

            $res = $this->validatePackageName($name) && strlen($name);
            if(!$res) {
                $this->addError("Invalid or empty name in compat. #{$count}");
            }
            $res1 = $this->validateVersion($min);
            if(!$res1) {
                $this->addError("Invalid or empty minVersion in compat. #{$count}");
            }
            $res2 = $this->validateVersion($max);
            if(!$res2) {
                $this->addError("Invalid or empty maxVersion in compat. #{$count}");
            }
            if($res1 && $res2 && $this->versionLower($max, $min)) {
                $this->addError("Max version is lower than min in compat #{$count}");
            }

        }
        return ! $this->hasErrors();
    }
1085664
public function valid()
    {
        if (key($this->_data) === null) {
            return false;
        }

        $current = current($this->_data);
        while (!$current->value()) {
            $current = $this->next();
            if (key($this->_data) === null) {
                return false;
            }
        }
        return true;
    }
934405
protected function _checkProvider($data)
    {
        $fields = $this->_config['fields'];

        if (empty($data[$fields['provider']])) {
            return false;
        }

        $provider = $data[$fields['provider']];

        if ($provider === 'OpenID' && empty($data[$fields['openid_identifier']])) {
            return false;
        }

        return $provider;
    }
614831
public function isObsolete()
    {
        if ($this->refreshNthRequests == 1 || $this->isRefreshNeededByProbability()) {
            return true;
        }
        if (isset($_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH'])) {
            if ($_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH'] <= 1) {
                return true; // @codeCoverageIgnore
            }
            $_SESSION['__HANDLER_REQUESTS_BEFORE_REFRESH']--;
        }
        if (isset($_SESSION['__HANDLER_SECONDS_BEFORE_REFRESH'])) {
            $timeDifference = time() - $_SESSION['__HANDLER_LAST_ACTIVITY_TIMESTAMP'];
            if ($timeDifference >= $_SESSION['__HANDLER_SECONDS_BEFORE_REFRESH']) {
                return true;
            }
        }
        return false;
    }
235252
public function valid() {

		if ( empty( $this->pod_id ) ) {
			return false;
		}

		if ( $this->iterator ) {
			return isset( $this->rows[ $this->row_number ] );
		}

		return true;
	}
364139
private function supportData()
    {
        $dataClass = $this->type->getDataClass();

        return $this->data instanceof $dataClass || $dataClass === get_class($this->data);
    }
1189883
public function isWorking()
    {
        // test with an example IP to make sure the provider is working
        // NOTE: At the moment only country, region & city info is tested.
        try {
            $supportedInfo = $this->getSupportedLocationInfo();

            list($testIp, $expectedResult) = self::getTestIpAndResult();

            // get location using test IP
            $location = $this->getLocation(array('ip' => $testIp));

            // check that result is the same as expected
            $isResultCorrect = true;
            foreach ($expectedResult as $key => $value) {
                // if this provider is not configured to support this information type, skip it
                if (empty($supportedInfo[$key])) {
                    continue;
                }

                if (empty($location[$key])
                    || $location[$key] != $value
                ) {
                    $isResultCorrect = false;
                }
            }

            if (!$isResultCorrect) {
                $unknown = Piwik::translate('General_Unknown');

                $location = "'"
                    . (empty($location[self::CITY_NAME_KEY]) ? $unknown : $location[self::CITY_NAME_KEY])
                    . ", "
                    . (empty($location[self::REGION_CODE_KEY]) ? $unknown : $location[self::REGION_CODE_KEY])
                    . ", "
                    . (empty($location[self::COUNTRY_CODE_KEY]) ? $unknown : $location[self::COUNTRY_CODE_KEY])
                    . "'";

                $expectedLocation = "'" . $expectedResult[self::CITY_NAME_KEY] . ", "
                    . $expectedResult[self::REGION_CODE_KEY] . ", "
                    . $expectedResult[self::COUNTRY_CODE_KEY] . "'";

                $bind = array($testIp, $location, $expectedLocation);
                return Piwik::translate('UserCountry_TestIPLocatorFailed', $bind);
            }

            return true;
        } catch (Exception $ex) {
            return $ex->getMessage();
        }
    }
580459
public function valid()
    {
        if ($this->container['transcoderWatermark'] === null) {
            return false;
        }
        if ($this->container['serverVersion'] === null) {
            return false;
        }
        if ($this->container['gpuAcceleration'] === null) {
            return false;
        }
        if ($this->container['wseName'] === null) {
            return false;
        }
        if ($this->container['transcoderLicensed'] === null) {
            return false;
        }
        if ($this->container['javaMaxHeapSize'] === null) {
            return false;
        }
        if ($this->container['transcoderLicensesInUse'] === null) {
            return false;
        }
        if ($this->container['javaVersion'] === null) {
            return false;
        }
        if ($this->container['httpOriginAvailable'] === null) {
            return false;
        }
        if ($this->container['serverName'] === null) {
            return false;
        }
        if ($this->container['osArchitecture'] === null) {
            return false;
        }
        if ($this->container['drmApplications'] === null) {
            return false;
        }
        if ($this->container['javaVMVersion'] === null) {
            return false;
        }
        if ($this->container['transcoderLicenses'] === null) {
            return false;
        }
        if ($this->container['timeRunning'] === null) {
            return false;
        }
        if ($this->container['licenseType'] === null) {
            return false;
        }
        if ($this->container['osBitness'] === null) {
            return false;
        }
        if ($this->container['dvrApplications'] === null) {
            return false;
        }
        if ($this->container['osVersion'] === null) {
            return false;
        }
        if ($this->container['serverBuild'] === null) {
            return false;
        }
        if ($this->container['javaName'] === null) {
            return false;
        }
        if ($this->container['maxConnections'] === null) {
            return false;
        }
        if ($this->container['dvrLicensed'] === null) {
            return false;
        }
        if ($this->container['serverMode'] === null) {
            return false;
        }
        if ($this->container['javaBitness'] === null) {
            return false;
        }
        if ($this->container['currentConnections'] === null) {
            return false;
        }
        if ($this->container['drmLicensed'] === null) {
            return false;
        }
        if ($this->container['javaVendor'] === null) {
            return false;
        }
        if ($this->container['osName'] === null) {
            return false;
        }
        if ($this->container['version'] === null) {
            return false;
        }
        if ($this->container['transcoderApplications'] === null) {
            return false;
        }
        if ($this->container['transcoderAvailable'] === null) {
            return false;
        }
        if ($this->container['javaHome'] === null) {
            return false;
        }
        if ($this->container['maxIncommingStreams'] === null) {
            return false;
        }
        if ($this->container['totalMemory'] === null) {
            return false;
        }
        if ($this->container['availableMemory'] === null) {
            return false;
        }
        if ($this->container['nativeBase'] === null) {
            return false;
        }
        if ($this->container['dvrInUse'] === null) {
            return false;
        }
        if ($this->container['drmInUse'] === null) {
            return false;
        }
        if ($this->container['licenseExpireDate'] === null) {
            return false;
        }
        if ($this->container['processorCores'] === null) {
            return false;
        }
        if ($this->container['restAPIAvailable'] === null) {
            return false;
        }
        return true;
    }
315356
public function accept()
    {
        $path = $this->current()->getPathname();
        if ($this->_excluded($path)) {
            return false;
        }
        if (!$this->_included($path)) {
            return false;
        }
        return $this->_matchType();
    }
953963
public function isAppReadyToInstall() {
		$checkPHPversion = $this->checkPhpVersion();
		if ($checkPHPversion === false) {
			return false;
		}

		$checkPHPextensions = $this->checkPhpExtensions(true);
		if ($checkPHPextensions === false) {
			return false;
		}

		return true;
	}
263513
public function isSupported()
    {
        $row = $this->getMixer();

        if($row instanceof DatabaseRowInterface)
        {
            if(!$row->hasProperty($this->_parent_column))  {
                return false;
            }
        }

        return true;
    }