Gets the variant the user is participating in for the given test.

@param TestInterface|string $test The identifier of the test to get the variant for.
@return string|null Returns the identifier of the variant or null if not participating.
424709
public function getParticipatingVariant($test)
    {
        $test = $test instanceof TestInterface ? $test->getIdentifier() : $test;

        if ($this->storage->has($test)) {
            return $this->storage->get($test);
        }

        return null;
    }
386196
public static function createByText(string $test): self
    {
        $outputSpeech = new self();

        $outputSpeech->text = $test;

        return $outputSpeech;
    }
1103339
public static function RETURNSTRING($testValue = '')
    {
        $testValue = PHPExcel_Calculation_Functions::flattenSingleValue($testValue);

        if (is_string($testValue)) {
            return $testValue;
        }
        return null;
    }
1118078
private static function config($test = false)
    {
        $files = ['Config', 'Alias'];
        $folder = static::$root.'Config'.'/';

        self::call($files, $folder);
        //
        $files = ['ConfigException', 'DatabaseDriverNotFoundException', 'AliasedClassNotFoundException'];
        $folder = static::$root.'Config/Exceptions'.'/';

        self::call($files, $folder);
        //
        Config::load();
    }
719061
public function get($input) {
    if ($input instanceof Vertice && $this->has($input)) {
      return $this->V[$input->label];
    } elseif (array_key_exists($input, $this->V)) {
      return $this->V[$input];
    } else {
      return NULL;
    }
  }
552642
public function connect($test = false)
    {
        Argument::i()->test(1, 'bool');

        if ($this->loggedin) {
            return $this;
        }

        $host = $this->host;

        if ($this->ssl) {
            $host = 'ssl://' . $host;
        }

        $errno  =  0;
        $errstr = '';

        $this->socket = fsockopen($host, $this->port, $errno, $errstr, self::TIMEOUT);

        if (!$this->socket) {
            //throw exception
            Exception::i()
                ->setMessage(Exception::SERVER_ERROR)
                ->addVariable($host.':'.$this->port)
                ->trigger();
        }

        $welcome = $this->receive();

        strtok($welcome, '<');
        $this->timestamp = strtok('>');
        if (!strpos($this->timestamp, '@')) {
            $this->timestamp = null;
        } else {
            $this->timestamp = '<' . $this->timestamp . '>';
        }

        if ($this->tls) {
            $this->call('STLS');
            if (!stream_socket_enable_crypto(
                $this->socket,
                true,
                STREAM_CRYPTO_METHOD_TLS_CLIENT
            )) {
                $this->disconnect();
                //throw exception
                Exception::i()
                    ->setMessage(Exception::TLS_ERROR)
                    ->addVariable($host.':'.$this->port)
                    ->trigger();
            }
        }

        if ($test) {
            $this->disconnect();
            return $this;
        }

        //login
        if ($this->timestamp) {
            try {
                $this->call(
                    'APOP '.$this->username
                    . ' '
                    . md5($this->timestamp . $this->password)
                );
                return;
            } catch (Argument $e) {
                // ignore
            }
        }

        $this->call('USER '.$this->username);
        $this->call('PASS '.$this->password);

        $this->loggedin = true;

        return $this;
    }
691584
public function _after(\Codeception\TestInterface $test)
    {
        foreach ($this->permanentServices as $serviceName => $service) {
            $this->permanentServices[$serviceName] = $this->grabService($serviceName);
        }
        parent::_after($test);
    }
567664
public function variantContentType($variant)
    {
        $variants = $this->variantsAttribute();

        if ( ! empty($variants)) {
            return Arr::get($variants, "{$variant}.type") ?: false;
        }

        if (false !== ($type = $this->config->variantMimeType($variant))) {
            return $type;
        }

        return $this->contentType();
    }
1362265
@Override
	public String getAvailableVariant(String variant, VariantSet variantSet) {

		String connectionType = variantSet.getDefaultVariant();
		if (variantSet.contains(variant)) {
			connectionType = variant;
		}

		return connectionType;
	}
961634
public static function detect($test = false)
    {
        if ($test) {
            return 'en';
        }

        $key = self::$sessionName;

        $cookieName = self::cookieName($key);

        // check if the session lang exists
        if (Session::exists($key)) {
            //check if supported languages contains the session lang value
            if (!in_array(Session::get($key), self::$supported)) {
                Session::put($key, config('lang.default', 'en'));
            }

            if (Cookie::existe($cookieName)) {
                if (Cookie::get($cookieName) != Session::get($key)) {
                    Cookie::create($cookieName, Session::get($key), config('lang.lifetime'));
                }
            } else {
                Cookie::create($cookieName, Session::get($key), config('lang.lifetime'));
            }
        } // check if the cookie lang exists
        elseif (Cookie::existe($cookieName)) {
            //check if supported languages contains the cookie lang value
            if (in_array(Cookie::get($cookieName), self::$supported)) {
                Session::put($key, Cookie::get($cookieName));
            } else {
                Session::put($key, config('lang.default', 'en'));
                Cookie::create($cookieName, config('lang.default', 'en'), config('lang.lifetime'));
            }
        } // if cokkie and session not found
        else {
            Session::put($key, config('lang.default', 'en'));
            Cookie::create($cookieName, config('lang.default', 'en'), config('lang.lifetime'));
        }

        return Session::get($key);
    }
593535
protected function get($key)
    {
        $this->checkForNonEmptyKey($key);
        if (!isset($this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key])) {
            return null;
        }

        return $this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key];
    }
1068182
public function addVariant(VariantInterface $variant)
    {
        if (!$this->hasVariant($variant)) {
            $variant->setObject($this);
            $this->variants->add($variant);
        }

        return $this;
    }
710978
public function _before(TestInterface $test)
    {
        $this->init();

        $this->client = new Connector();
        $this->client->setRouter($this->container->get(RouterInterface::class));

        if (isset($this->baseRequest)) {
            $this->client->setBaseRequest($this->baseRequest);
        }
        
        if (isset($this->baseResponse)) {
            $this->client->setBaseResponse($this->baseResponse);
        }

        parent::_before($test);
    }
788601
public static function getVarietyName( $varietyValue )
	{
		// $oClass = new \ReflectionClass( "\lyquidity\XPath2\Token" );
		$oClass = new \ReflectionClass( __CLASS__ );
		foreach ( $oClass->getConstants() as $key => $value )
		{
			if ( $value == $varietyValue ) return $key;
		}

		return false;
	}
215873
public function setVariant($variant)
    {
        if ($this->isFromServer) {
            $this->validateVariant($variant);
        }

        $clone = clone $this;
        $clone->variant = $this->normalizeVariant($variant);

        return $clone;
    }
62088
public function getUnique($name)
	{
		$xpathStr = self::XPATH_THIS . $name;
		$results = $this->xpath($xpathStr);
		if (count($results) >= 1) {
			return $results[0];
		}
		return null;
	}
649207
public static function get($request, $match)
    {
        if(isset($match['userId'])){        
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $match['userId']);
        }else{
            $user = $request->user;
        }
        if (array_key_exists('profileId', $match)) {
            return Pluf_Shortcuts_GetObjectOr404('User_Profile', $match['profileId']);
        }
        $profile = self::getProfileOfUser($user);
        if($profile === null){
            $profile = new User_Profile();
            $profile->account_id = $user;
        }
        return $profile;
    }