Returns the opposite visibility function for the value of the initial visibility field, e.g. show/hide. This
will toggle the "hide" class either way, which is handled by CSS.

@param string $initialState
@param boolean $invert
@return string
977695
public function toggleDisplayText($initialState, $invert = false)
    {
        $action = strtolower($initialState) === 'hide' ? 'removeClass' : 'addClass';
        if ($invert) {
            $action = $action === 'removeClass' ? 'addClass' : 'removeClass';
        }
        return sprintf('%s("hide")', $action);
    }
410664
public function & InitAll () {
		/** @var $this \MvcCore\Route */
		if ($this->match === NULL && $this->reverse === NULL) {
			$this->initMatchAndReverse();
		} else if ($this->match !== NULL && ($this->reverseParams === NULL || $this->lastPatternParam === NULL)) {
			$this->initReverse();
		}
		return $this;
	}
965139
private function invertTransparency($value, $originalMax, $invert = true)
		# Purpose:  This does two things:
		#       1) Convert the range from 0-127 to 0-100
		#       2) Inverts value to 100 is not transparent while 0 is fully
		#          transparent (like Photoshop)
	{
		// *** Test max range
		if ($value > $originalMax)
		{
			$value = $originalMax;
		}

		// *** Test min range
		if ($value < 0)
		{
			$value = 0;
		}

		if ($invert)
		{
			return $originalMax - (($value / 100) * $originalMax);
		}
		else
		{
			return ($value / 100) * $originalMax;
		}
	}
1250469
function hide() {
    if (isVisible()) {
        var hideFinishCb = function () {
            WinJS.Utilities.addClass(splashElement, 'hidden');
            splashElement.style.opacity = 1;
            enableUserInteraction();
            exitFullScreen();
        }

        // Color reversion before fading is over looks better:
        revertTitleBarColor();

        // https://issues.apache.org/jira/browse/CB-11751
        // This can occur when we directly replace whole document.body f.e. in a router.
        // Note that you should disable the splashscreen in this case or update a container element instead.
        if (document.getElementById(splashElement.id) == null) {
            hideFinishCb();
            return;
        }

        if (fadeSplashScreen) {
            fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb);
        } else {
            hideFinishCb();
        }
    }
}
1250374
def initialState(self, state):
        

        if self._initialState is not _NO_STATE:
            raise ValueError(
                "initial state already set to {}".format(self._initialState))

        self._initialState = state
786615
static function showInvisibleNodes()
    {
        static $cachedResult;

        if ( !isset( $cachedResult ) )
        {
            $ini = eZINI::instance( 'site.ini' );
            $cachedResult = $ini->hasVariable( 'SiteAccessSettings', 'ShowHiddenNodes' ) ?
                            $ini->variable( 'SiteAccessSettings', 'ShowHiddenNodes' ) == 'true' :
                            true;
        }

        return $cachedResult;
    }
1227658
public int setState(boolean bState, boolean bDisplayOption, int iMoveMode)
    {
        int iFieldValue = (int)this.getValue();
        if (!m_bTrueIfMatch)
            bState = !bState; // Do opposite operation
        if (bState)
            iFieldValue |= (1 << m_iBitNumber);     // Set the bit
        else
            iFieldValue &= ~(1 << m_iBitNumber);    // Clear the bit
        return this.setValue(iFieldValue, bDisplayOption, iMoveMode);
    }
724527
public function toggleOptions($options, $state = null)
    {
        if ($state === null) {
            $state = ($this->options & $options) !== $options;
        }

        return $this->setOptions(
            $state ?
            $this->options | $options :
            $this->options & ~$options
        );
    }
1006199
public function asVisibleString(): Primitive\VisibleString
    {
        if (!$this->_element instanceof Primitive\VisibleString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_VISIBLE_STRING));
        }
        return $this->_element;
    }
255130
function (oControl, bVisible) {
			var bOldVisible = this.getVisible(oControl);

			var vReturnValue = JsControlTreeModifier.setVisible.apply(this, arguments);

			/* If the visibility changed, record the reversal as undo operation */
			if (bOldVisible !== this.getVisible(oControl)){
				this._saveUndoOperation("setVisible", [oControl, bOldVisible]);
			}

			return vReturnValue;
		}
857798
def reversed(self):
		'''
			
		'''
		alphabet = self.alphabet

		# Start from a composite "state-set" consisting of all final states.
		# If there are no final states, this set is empty and we'll find that
		# no other states get generated.
		initial = frozenset(self.finals)

		# Find every possible way to reach the current state-set
		# using this symbol.
		def follow(current, symbol):
			next = frozenset([
				prev
				for prev in self.map
				for state in current
				if symbol in self.map[prev] and self.map[prev][symbol] == state
			])
			if len(next) == 0:
				raise OblivionError
			return next

		# A state-set is final if the initial state is in it.
		def final(state):
			return self.initial in state

		# Man, crawl() is the best!
		return crawl(alphabet, initial, final, follow)
187537
public function foldRight(callable $function, $initial = null)
    {
        if ($this->isEmpty()) {
            return $initial;
        }

        return array_reduce(array_reverse($this->data, true), $function, $initial);
    }
839906
public int setState(boolean state, boolean bDisplayOption, int iMoveMode)
    {       // Must be overidden
        m_bSetData = true;  // Make sure getNextConverter is called correctly (if it is called).
        int iErrorCode = super.setState(state, bDisplayOption, iMoveMode);
        m_bSetData = false;
        return iErrorCode;
    }
94304
public function getVisibility()
    {
        if (($this->modifiers & Modifiers::MODIFIER_PRIVATE) !== 0) {
            return Modifiers::VISIBILITY_PRIVATE;
        } elseif (($this->modifiers & Modifiers::MODIFIER_PROTECTED) !== 0) {
            return Modifiers::VISIBILITY_PROTECTED;
        } else {
            return Modifiers::VISIBILITY_PUBLIC;
        }
    }
1084213
private WButton newVisibilityToggleForTab(final int idx) {
		WButton toggleButton = new WButton("Toggle visibility of tab " + (idx + 1));

		toggleButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				boolean tabVisible = tabset.isTabVisible(idx);
				tabset.setTabVisible(idx, !tabVisible);
			}
		});

		return toggleButton;
	}
1194112
public static function getVisibility(Node\Stmt\Property $property): int
    {
        if ($property->isPrivate()) {
            return VisibilityInterface::PRIVATE;
        }
        if ($property->isProtected()) {
            return VisibilityInterface::PROTECTED;
        }
        return VisibilityInterface::PUBLIC;
    }
747444
function visibilityFilter(state = SHOW_ALL, action = {}) {
    const {type, filter} = action;
    switch (type) {
        case SET_VISIBILITY_FILTER:
            return filter;
        default:
            return state;
    }
}