Set Isogeo base URLs according to platform.

        :param str platform: platform to use. Options:

          * prod [DEFAULT]
          * qa
          * int
510627
def set_base_url(self, platform: str = "prod"):
        
        platform = platform.lower()
        self.platform = platform
        if platform == "prod":
            ssl = True
            logging.debug("Using production platform.")
        elif platform == "qa":
            ssl = False
            logging.debug("Using Quality Assurance platform (reduced perfs).")
        else:
            logging.error(
                "Platform must be one of: {}".format(" | ".join(self.API_URLS.keys()))
            )
            raise ValueError(
                3,
                "Platform must be one of: {}".format(" | ".join(self.API_URLS.keys())),
            )
        # method ending
        return (
            platform.lower(),
            self.API_URLS.get(platform),
            self.APP_URLS.get(platform),
            self.CSW_URLS.get(platform),
            self.MNG_URLS.get(platform),
            self.OC_URLS.get(platform),
            ssl,
        )
10333
def url_api_version(self, api_version):
        
        # Set base url depending on API version.
        if api_version == 1:
            # QualysGuard API v1 url.
            url = "https://%s/msp/" % (self.server,)
        elif api_version == 2:
            # QualysGuard API v2 url.
            url = "https://%s/" % (self.server,)
        elif api_version == 'was':
            # QualysGuard REST v3 API url (Portal API).
            url = "https://%s/qps/rest/3.0/" % (self.server,)
        elif api_version == 'am':
            # QualysGuard REST v1 API url (Portal API).
            url = "https://%s/qps/rest/1.0/" % (self.server,)
        elif api_version == 'am2':
            # QualysGuard REST v1 API url (Portal API).
            url = "https://%s/qps/rest/2.0/" % (self.server,)
        else:
            raise Exception("Unknown QualysGuard API Version Number (%s)" % (api_version,))
        logger.debug("Base url =\n%s" % (url))
        return url
1074095
def check_platform(platform)
      options = %w[ios android all]
      if platform.nil?
        puts 'No platform detected... Options: ios,android,all'
        exit
      elsif !options.include? platform.downcase
        puts "Invalid platform #{platform}"
        exit
      end
    end
561462
def platform(self, with_prompt, platforms=None):
        """"""
        if platforms is None:
            platforms = self._dict['generic']['prompt_detection']

        for platform in platforms:
            pattern = self.pattern(platform, 'prompt')
            result = re.search(pattern, with_prompt)
            if result:
                return platform
        return None
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()
1112648
def build_url_base(host, port, is_https):
    
    base = "http"
    if is_https:
        base += 's'

    base += "://"
    base += host

    if port:
        base += ":"
        base += str(port)

    return base
554965
function _Platform_initialize(
    flagDecoder,
    args,
    init,
    update,
    subscriptions,
    stepperBuilder
  ) {
    var result = A2(
      _Json_run,
      flagDecoder,
      _Json_wrap(args ? args["flags"] : undefined)
    );
    elm$core$Result$isOk(result) ||
      _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/);
    var managers = {};
    result = init(result.a);
    var model = result.a;
    var stepper = stepperBuilder(sendToApp, model);
    var ports = _Platform_setupEffects(managers, sendToApp);

    function sendToApp(msg, viewMetadata) {
      result = A2(update, msg, model);
      stepper((model = result.a), viewMetadata);
      _Platform_dispatchEffects(managers, result.b, subscriptions(model));
    }

    _Platform_dispatchEffects(managers, result.b, subscriptions(model));

    return ports ? { ports: ports } : {};
  }
210110
def format_platforms(cls, platforms):
        ''''''
        lines = []
        if platforms:
            lines.append('This DAP is only supported on the following platforms:')
            lines.extend([' * ' + platform for platform in platforms])
        return lines
1184192
async def get_platform(self, name: Text):
        

        if not self._is_init:
            await self.init()

        if name not in self.platforms:
            self.platforms[name] = \
                await self.build_platform(self.get_class(name), name)

        return self.platforms[name]
548859
def reset_base_headers():
    
    import plexapi
    return {
        'X-Plex-Platform': plexapi.X_PLEX_PLATFORM,
        'X-Plex-Platform-Version': plexapi.X_PLEX_PLATFORM_VERSION,
        'X-Plex-Provides': plexapi.X_PLEX_PROVIDES,
        'X-Plex-Product': plexapi.X_PLEX_PRODUCT,
        'X-Plex-Version': plexapi.X_PLEX_VERSION,
        'X-Plex-Device': plexapi.X_PLEX_DEVICE,
        'X-Plex-Device-Name': plexapi.X_PLEX_DEVICE_NAME,
        'X-Plex-Client-Identifier': plexapi.X_PLEX_IDENTIFIER,
        'X-Plex-Sync-Version': '2',
    }
113690
function config() {
  if(!process.env.PLATFORM_PROJECT) {
    throw Error('This is not running on platform.sh');
  }

  return {
    application: read_base64_json('PLATFORM_APPLICATION'),
    relationships: read_base64_json('PLATFORM_RELATIONSHIPS'),
    variables: read_base64_json('PLATFORM_VARIABLES'),
    application_name: process.env.PLATFORM_APPLICATION_NAME,
    app_dir: process.env.PLATFORM_APP_DIR,
    environment: process.env.PLATFORM_ENVIRONMENT,
    project: process.env.PLATFORM_PROJECT,
    routes: read_base64_json('PLATFORM_ROUTES'),
    tree_id: process.env.PLATFORM_TREE_ID,
    project_entropy: process.env.PLATFORM_PROJECT_ENTROPY,
    branch: process.env.PLATFORM_BRANCH,
    document_root: process.env.PLATFORM_DOCUMENT_ROOT,
    port: process.env.PORT,
    omp_num_threads: num_of_cpus()
  };
}
683773
function setPlatformConfig(platformName, platformConfigs) {
    configProperties.platform[platformName] = platformConfigs;
    provider.platform[platformName] = {};

    addConfig(configProperties, configProperties.platform[platformName]);

    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');
  }
293373
def set_api_from_config_path(self):
        """"""
        config = ConfigParser(allow_no_value=False)
        config.optionxform = str
        config.read(self.config_path, "utf-8")
        if config.has_option("defaults", "dynamic_loading"):
            dynamic_loading = config.get("defaults", "dynamic_loading")
        else:
            dynamic_loading = "infura"
        if dynamic_loading == "infura":
            self.set_api_rpc_infura()
        elif dynamic_loading == "localhost":
            self.set_api_rpc_localhost()
        else:
            self.set_api_rpc(dynamic_loading)
1064074
function(arn, attributes) {
        var params = {
            PlatformApplicationArn: arn,
            Attributes: attributes
        };

        return this.svc.setPlatformApplicationAttributes(params);
    }
281975
public function setPlatform($platform)
    {
        if (!in_array($platform, array(Software::PLATFORM_MAC, Software::PLATFORM_IOS), true)) {
            throw new \InvalidArgumentException(sprintf('Undefined software platform "%s".', $platform));
        }

        $this->platform = $platform;

        return $this;
    }
1123086
def generate(env):
    """"""
    for t in SCons.Tool.tool_list(env['PLATFORM'], env):
        SCons.Tool.Tool(t)(env)
526195
def _get_platform_patterns(spec, package, src_dir):
        
        raw_patterns = itertools.chain(
            spec.get('', []),
            spec.get(package, []),
        )
        return (
            # Each pattern has to be converted to a platform-specific path
            os.path.join(src_dir, convert_path(pattern))
            for pattern in raw_patterns
        )