@param BunqEnumApiEnvironmentType $environmentType
@param string|null $apiKey

@return bool
12832
private static function shouldSandboxUserBeCreated(
        BunqEnumApiEnvironmentType $environmentType,
        string $apiKey = null
    ): bool {
        return $environmentType->equals(BunqEnumApiEnvironmentType::SANDBOX()) && is_null($apiKey);
    }
290492
protected function setEnvironment(Application $app, ?string $env = null): void
    {
        $app->detectEnvironment(function () use ($env) {
            return $env ?: env('APP_ENV', 'production');
        });
    }
97506
def option_vip_by_environment_vip_type(self, environment_vip_id, type_option):
        

        uri = "api/v3/option-vip/environment-vip/%s/type-option/%s/" % (environment_vip_id, type_option)

        return self.get(uri)
864511
public function getPropertiesForEnvironment(Application $application, ?Environment $environment): array
    {
        $environmentCriteria = Criteria::expr()->isNull('environment');

        if ($environment) {
            $specificEnvironment = Criteria::expr()->eq('environment', $environment);
            $environmentCriteria = Criteria::expr()->orX($specificEnvironment, $environmentCriteria);
        }

        $criteria = (new Criteria)
            ->where(Criteria::expr()->eq('application', $application))
            ->andWhere($environmentCriteria)

            // null must be first!
            ->orderBy(['environment' => 'ASC']);

        $properties = $this
            ->matching($criteria)
            ->toArray();


        $config = [];

        // We do this so that "global/no-env" properties are loaded first, and can be overwritten by environment-specific config.
        foreach ($properties as $property) {
            $config[$property->name()] = $property;
        }

        return $config;
    }
856358
public void associateEnvironmentToJndi(JNDIResourceModel resource, EnvironmentReferenceModel ref)
    {
        LOG.info("Associating JNDI: " + resource + " to Environmental Ref: " + ref.getName() + ", " + ref.getReferenceId() + ", "
                    + ref.getReferenceType());
        // hook up the JNDI resource to the environment reference
        if (ref.getJndiReference() == null)
        {
            ref.setJndiReference(resource);
        }
        jndiResourceService.associateTypeJndiResource(resource, ref.getReferenceType());
    }
66328
def pool_by_environmentvip(self, environment_vip_id):
        

        uri = 'api/v3/pool/environment-vip/%s/' % environment_vip_id

        return super(ApiPool, self).get(uri)
615262
public JanbaneryToWorkspace connectUsing(String apiKey) {
    DefaultConfiguration conf = new DefaultConfiguration(apiKey);
    return connectUsing(conf);
  }
656078
@Override
	public void setEnvironment(ConfigurableEnvironment environment) {
		super.setEnvironment(environment);
		this.reader.setEnvironment(environment);
		this.scanner.setEnvironment(environment);
	}
303012
public static function create($params = null, $apiKey = null)
    {
        if (!isset($params['report']) || !is_array($params['report'])) {
            $clone = $params;
            unset($params);
            $params['report'] = $clone;
        }

        if (!isset($params['report']['type'])) {
            throw new Error('Undetermined Report Type');
        } else {
            $type = $params['report']['type'];

            self::_validate('create', $params, $apiKey);
            $requestor = new Requestor($apiKey);

            $url = self::reportUrl($type);

            list($response, $apiKey) = $requestor->request('post', $url, $params, true);
            return Util::convertToEasyPostObject($response, $apiKey);
        }
    }
42002
public final static function checkEnv($key, $r, $optional = false) {
        $rst = [];
        $rel = strtolower(ini_get($key));
        $rel = ($rel == '0' || $rel == 'off' || $rel == '') ? 0 : 1;
        if ($rel == $r) {
            $rst['pass'] = true;
        } else {
            $rst['pass'] = false;
        }
        $rst['required'] = $r ? '开' : '关';
        $rst['checked']  = $rel ? '开' : '关';
        $rst['optional'] = $optional;

        return $rst;
    }
1116931
@Override
    public OAuthToken get(String envKey) {
        if (!oAuthToken.containsKey(envKey)) return null;
        
        return oAuthToken.get(envKey);
    }
1009773
public static function init($locale, $environment, $version)
    {
        $envFilename = Registry::get('applicationPath') . '/.env';
        if (file_exists($envFilename)) {
            $env = Ini::parse($envFilename, true, $locale . '-' . $environment . '-' . $version, 'common', false);
            $env = self::mergeEnvVariables($env);
        } else {
            $env = new \StdClass();
        }
        self::$data = Ini::bindArrayToObject($env);
    }
702978
public function findByUrlAndEnvironment($url, $environment)
    {
        $queryBuilder = $this->createQueryBuilder('u')
            ->where('u.url = :url')
            ->andWhere('u.environment = :environment');

        $query = $queryBuilder->getQuery();
        $query->setParameter('url', $url);
        $query->setParameter('environment', $environment);

        try {
            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
297407
public static function env($key, $default = null)
    {
        static::setDotenv(static::$projectRoot);
        if (!static::$dotenvLoaded) {
            throw new \RuntimeException('Dotenv configs are not loaded. Failed to get value for key [' . $key . ']');
        }

        $value = getenv($key);
        if (false === $value) {
            return $default;
        } else {
            if ($value === 'true' || $value === 'TRUE') {
                return true;
            } elseif ($value === 'false' || $value === 'FALSE') {
                return false;
            } elseif (is_numeric($value)) {
                return (1 * $value);
            } else {
                return $value;
            }
        }
    }
1323620
def get_environments(self, project_key: str) -> dict:
        
        try:
            resp = self.client.get_project(project_key)
        except launchdarkly_api.rest.ApiException as ex:
            msg = "Unable to get environments."
            resp = "API response was {0} {1}.".format(ex.status, ex.reason)
            LOG.error("%s %s", msg, resp)
            sys.exit(1)

        envs = []

        for env in resp.environments:
            env = dict(
                key=env.key,
                api_key=env.api_key,
                client_id=env.id
            )
            envs.append(env)

        return envs
283984
public function getEnvOption($key, $default = null)
    {
        if (!array_key_exists('environments', $this->configuration) || !is_array($this->configuration['environments'])) {
            return $default;
        }

        if (!array_key_exists($this->environment, $this->configuration['environments'])) {
            return $default;
        }

        if (array_key_exists($key, $this->configuration['environments'][$this->environment])) {
            return $this->configuration['environments'][$this->environment][$key];
        }

        return $default;
    }
824551
def create_environment(self, environment):
        

        uri = 'api/v3/environment/'

        data = dict()
        data['environments'] = list()
        data['environments'].append(environment)

        return super(ApiEnvironment, self).post(uri, data)