Check the user has configured API version correctly.
466
def check_stripe_api_version(app_configs=None, **kwargs):
	""""""
	from . import settings as djstripe_settings

	messages = []
	default_version = djstripe_settings.DEFAULT_STRIPE_API_VERSION
	version = djstripe_settings.get_stripe_api_version()

	if not validate_stripe_api_version(version):
		msg = "Invalid Stripe API version: {}".format(version)
		hint = "STRIPE_API_VERSION should be formatted as: YYYY-MM-DD"
		messages.append(checks.Critical(msg, hint=hint, id="djstripe.C004"))

	if version != default_version:
		msg = (
			"The Stripe API version has a non-default value of '{}'. "
			"Non-default versions are not explicitly supported, and may "
			"cause compatibility issues.".format(version)
		)
		hint = "Use the dj-stripe default for Stripe API version: {}".format(default_version)
		messages.append(checks.Warning(msg, hint=hint, id="djstripe.W001"))

	return messages
1351185
public function validateVersion()
    {
        if ($_SERVER['REQUEST_METHOD'] != 'POST') {
            $this->_logger->log('Invalid request method', Icepay_Api_Logger::ERROR);
            return false;
        }

        if ($this->generateChecksumForVersion() != $this->data->checksum) {
            $this->_logger->log('Checksum does not match', Icepay_Api_Logger::ERROR);
            return false;
        }

        return true;
    }
85025
def _check_version(version):
    """"""
    if version != pyphi.__version__:
        raise pyphi.exceptions.JSONVersionError(
            'Cannot load JSON from a different version of PyPhi. '
            'JSON version = {0}, current version = {1}.'.format(
                version, pyphi.__version__))
219409
def checkVersion(self):
        """"""

        r = self.doQuery('version')

        if r.status_code == 200:  # Query ok ?
            data = r.json()

            if data['result'] == 'Ok' and data['version'] == self.PI_API_VERSION and data['protocol'] == self.PI_API_NAME:
                return True
        return False
495436
def _validate_version(request)
      unless self.class.versions.include?(request.version)
        _error!(Errors::NotFoundError, request.version)
      end
    end
696159
def version_ok(self, version):
        """"""
        return self.attribute is None or self.format is None or \
            str(version) != "unknown" and version >= self.requested_version
712842
def validate_python_version():
    """"""
    python_version = LooseVersion(platform.python_version())
    minimal_version = LooseVersion('3.3.0')
    if python_version < minimal_version:
        print("Sorry, Python 3.3+ is required")
        sys.exit(1)
236298
def api_version(self):
        """"""

        now = datetime.utcnow()

        if self.version_cache_timestamp and self.version_cache_timestamp + self.version_cache_timeout > now:
            return self.version_cache_value  # we have a cached value

        self.version_cache_value = self.get_api_version()

        if self.minimum_version and self.version_cache_value < self.minimum_version:
            raise NotSupportedError('%s requires ejabberd >= %s' % (self.__class__.__name__,
                                                                    self.minimum_version))

        self.version_cache_timestamp = now
        return self.version_cache_value
1006545
private static boolean validateVersion(Context ctx, ChangeLog clog){

        // Get Preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
        int lastSeen = prefs.getInt(PREF_CHANGELOG_LAST_SEEN, -1);

        // Second sort versions by it's code
        int latest = Integer.MIN_VALUE;
        for(Version version: clog.versions){
            if(version.code > latest){
                latest = version.code;
            }
        }

        // Get applications current version
        if(latest > lastSeen){
            if(!BuildConfig.DEBUG) prefs.edit().putInt(PREF_CHANGELOG_LAST_SEEN, latest).apply();
            return true;
        }

        return false;
    }
475243
def check_api_version(self):
        
        url = self.base_url + "/status/"
        juicer.utils.Log.log_debug("[REST:GET:%s]", url)

        _r = requests.get(url, auth=self.auth, headers=self.headers,
                          verify=False)

        if _r.status_code == Constants.PULP_GET_OK:  # server is up, cool.
            version = juicer.utils.load_json_str(_r.content)['api_version'].strip()
            if version != Constants.EXPECTED_SERVER_VERSION:  # we done goofed
                raise JuicerPulpError("Client expects %s and got %s -- you should probably update!" \
                                      % (Constants.EXPECTED_SERVER_VERSION, version))
        return True
583261
def _check_ver(pyver, op, wanted):
    '''
    
    '''
    pyver = distutils.version.LooseVersion(pyver)
    wanted = distutils.version.LooseVersion(wanted)
    return getattr(operator, '__{}__'.format(op))(pyver, wanted)
1178352
def check(self, package_name, package_version, **extra_data):
        """"""
        data = extra_data
        data['package_name'] = package_name
        data['package_version'] = package_version
        data['python_version'] = sys.version.split()[0]
        data['platform'] = platform.platform(True) or 'Unspecified'

        try:
            headers = {'connection': 'close',
                       'content-type': 'application/json'}
            response = requests.put(self.url, json.dumps(data), timeout=1,
                                    headers=headers)
            if response.status_code == codes.UNPROCESSABLE_ENTITY:
                return 'update_checker does not support {!r}'.format(
                    package_name)
            data = response.json()
        except (requests.exceptions.RequestException, ValueError):
            return None

        if not data or not data.get('success') \
                or (parse_version(package_version) >=
                    parse_version(data['data']['version'])):
            return None

        return UpdateResult(package_name, running=package_version,
                            available=data['data']['version'],
                            release_date=data['data']['upload_time'])
1134216
function checkOlderIE() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
  if (!isIE) {
    return false;
  }
  const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
  const versionNumber = parseFloat(version);
  if (versionNumber < 10) {
    return true;
  }
  return false;
}
615575
def validate_current_versions(self):  # type: () -> bool
        
        versions = self.all_current_versions()
        for _, version in versions.items():
            if "Invalid Semantic Version" in version:
                logger.error(
                    "Invalid versions, can't compare them, can't determine if in sync"
                )
                return False

        if not versions:
            logger.warning("Found no versions, will use default 0.1.0")
            return True

        if not self.all_versions_equal(versions):
            if self.almost_the_same_version([x for x in versions.values()]):
                # TODO: disable with strict option
                logger.warning("Version very by a patch level, will use greater.")
                return True
            logger.error("Found various versions, how can we rationally pick?")
            logger.error(unicode(versions))
            return False

        for _ in versions:
            return True
        return False
1371836
def appliance_api_version
      options = { 'Content-Type' => :none, 'X-API-Version' => :none, 'auth' => :none }
      response = rest_api(:get, '/rest/version', options)
      version = response_handler(response)['currentVersion']
      raise ConnectionError, "Couldn't get API version" unless version
      version = version.to_i if version.class != Integer
      version
    rescue ConnectionError
      @logger.warn "Failed to get OneView max api version. Using default (#{OneviewSDK::DEFAULT_API_VERSION})"
      OneviewSDK::DEFAULT_API_VERSION
    end
1230314
def check_update():
    
    r = requests.get("https://pypi.python.org/pypi/prof/json")
    data = r.json()
    if versiontuple(data['info']['version']) > versiontuple(__version__):
        return True
    return False
1033905
def _get_api_version(self):
        
        url = "{base_url}/api/server_info".format(base_url=self._base_url())
        server_info = self._make_request(url=url, method="get")
        return server_info["latest_api_version"]