Detects and sets the database platform.

        Evaluates custom platform class and version in order to set the correct platform.

        :raises InvalidPlatformSpecified: if an invalid platform was specified for this connection.
179051
def _detect_database_platform(self):
        
        version = self._get_database_platform_version()

        if version is not None:
            self._platform = self._create_database_platform_for_version(version)
        else:
            self._platform = self.get_dbal_platform()
129315
def get_build_platform():
    
    from sysconfig import get_platform

    plat = get_platform()
    if sys.platform == "darwin" and not plat.startswith('macosx-'):
        try:
            version = _macosx_vers()
            machine = os.uname()[4].replace(" ", "_")
            return "macosx-%d.%d-%s" % (
                int(version[0]), int(version[1]),
                _macosx_arch(machine),
            )
        except ValueError:
            # if someone is running a non-Mac darwin system, this will fall
            # through to the default implementation
            pass
    return plat
523209
def setTableType(self, tableType):
        
        if tableType == self._tableType:
            return
        
        self._initialized = False
        self._tableType = tableType
        self.setQuery(Query())
1067061
function assertPlatform(requiredToken) {
    var /** @type {?} */ platform = getPlatform();
    if (!platform) {
        throw new Error('No platform exists!');
    }
    if (!platform.injector.get(requiredToken, null)) {
        throw new Error('A platform with a different configuration has been created. Please destroy it first.');
    }
    return platform;
}
611615
async def self_check(self):
        

        platforms = set()

        for platform in get_platform_settings():
            try:
                name = platform['class']
                cls: Type[Platform] = import_class(name)
            except KeyError:
                yield HealthCheckFail(
                    '00004',
                    'Missing platform `class` name in configuration.'
                )
            except (AttributeError, ImportError, ValueError):
                yield HealthCheckFail(
                    '00003',
                    f'Platform "{name}" cannot be imported.'
                )
            else:
                if cls in platforms:
                    yield HealthCheckFail(
                        '00002',
                        f'Platform "{name}" is imported more than once.'
                    )
                platforms.add(cls)

                # noinspection PyTypeChecker
                async for check in cls.self_check():
                    yield check
989964
func (s *Service) SetPlatformVersion(v string) *Service {
	s.PlatformVersion = &v
	return s
}
1028138
public function getPlatformVersion() { 
		if ($this->_platformVersion === self::PLATFORM_UNKNOWN ) 
		{
			$this->_platformVersion = $this->_platform;
		}
		return $this->_platformVersion; 
	}
1364404
def handle_database(self):
        
        # TODO: When initdb and upgradedb are dropped we can just test
        # managedb, but for backwards compatibility we need to support
        # initdb without upgradedb and vice-versa

        if self.args.initdb or self.args.upgradedb:
            db = DbAdmin(self.dir, None, self.args, self.external)
            status = db.check()
            log.debug('OMERO database upgrade status: %s', status)
        else:
            log.warn('OMERO database check disabled')
            return DB_INIT_NEEDED

        if status == DB_INIT_NEEDED:
            if self.args.initdb:
                log.debug('Initialising OMERO database')
                db.init()
            else:
                log.error('OMERO database not found')
                raise Stop(DB_INIT_NEEDED,
                           'Install/Upgrade failed: OMERO database not found')

        elif status == DB_UPGRADE_NEEDED:
            log.warn('OMERO database exists but is out of date')
            if self.args.upgradedb:
                log.debug('Upgrading OMERO database')
                db.upgrade()
            else:
                raise Stop(
                    DB_UPGRADE_NEEDED,
                    'Pass --managedb or upgrade your OMERO database manually')

        else:
            assert status == DB_UPTODATE

        return status
101200
def supports_version(self, guid_set):
        

        # Don't let the test run if we haven't parsed install.rdf yet.
        if self.supported_versions is None:
            raise Exception('Early compatibility test run before install.rdf '
                            'was parsed.')

        return self._compare_version(requirements=guid_set,
                                     support=self.supported_versions)
859613
public function convertToDatabaseValueSql($value, AbstractPlatform $platform)
    {
        return parent::convertToDatabaseValueSQL($value instanceof ModelInterface ? $value->pk : $value, $platform);
    }
841233
def Platform(name = platform_default()):
    
    module = platform_module(name)
    spec = PlatformSpec(name, module.generate)
    return spec
746535
function isValidPlatform() {
    if (appSettings.overrides && appSettings.overrides.platform) {
        return true; //If a platform override is set, it's always valid
    }
    return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
}
242206
func (s *TaskSet) SetPlatformVersion(v string) *TaskSet {
	s.PlatformVersion = &v
	return s
}
1057008
public void setPlatform(com.google.api.ads.admanager.axis.v201805.MobileApplicationPlatform platform) {
        this.platform = platform;
    }
953996
public void setPlatformApplications(java.util.Collection<PlatformApplication> platformApplications) {
        if (platformApplications == null) {
            this.platformApplications = null;
            return;
        }

        this.platformApplications = new com.amazonaws.internal.SdkInternalList<PlatformApplication>(platformApplications);
    }
144207
def create_platform(platform):
    '''
    
    '''
    nb_platform = get_('dcim', 'platforms', slug=slugify(platform))
    if nb_platform:
        return False
    else:
        payload = {'name': platform, 'slug': slugify(platform)}
        plat = _add('dcim', 'platforms', payload)
        if plat:
            return {'dcim': {'platforms': payload}}
        else:
            return False
363163
function PlatformBase(opts) {
  _.extend(this, {
    platform: null,
    // path to template to use for service generation,
    // use of a template may be optional.
    template: null,
    logger: require('../logger')
  }, opts);
}