Strips namespace information from the given mailbox name.

@param string $mbox  Mailbox name.

@return string  Mailbox name with namespace prefix stripped.
504649
public function stripNamespace($mbox)
    {
        $mbox = strval($mbox);
        $name = $this->name;

        return (strlen($name) && (strpos($mbox, $name) === 0))
            ? substr($mbox, strlen($name))
            : $mbox;
    }
712460
protected function _mailboxOb($mailbox = null)
    {
        $name = is_null($mailbox)
            ? strval($this->_selected)
            : strval($mailbox);

        if (!isset($this->_temp['mailbox_ob'][$name])) {
            $this->_temp['mailbox_ob'][$name] = new Horde_Imap_Client_Base_Mailbox();
        }

        return $this->_temp['mailbox_ob'][$name];
    }
1235060
public function getNamespaceForPrefix( $prefix )
	{
		if ( ! isset( $this->instance_namespaces[ $prefix ] ) ) return null;
		return $this->instance_namespaces[ $prefix ];
	}
125920
protected static function formatUsesPrefix($new, $old)
    {
        if (isset($new['namespace']) && isset($old['namespace'])) {
            return trim(array_get($old, 'namespace'), '\\') . '\\' . trim($new['namespace'], '\\');
        } elseif (isset($new['namespace'])) {
            return trim($new['namespace'], '\\');
        }
        
        return array_get($old, 'namespace');
    }
1148255
public function removeName($nameIndex)
    {
        $removed = false;
        $positions = $this->positions;
        foreach ($positions as $position) {
            $source = $position->source;
            $ni = $source->nameIndex;
            if ($ni === $nameIndex) {
                $removed = true;
                $source->nameIndex = null;
                $source->name = null;
            } elseif ($ni > $nameIndex) {
                $source->nameIndex--;
            }
        }
        return $removed;
    }
1163210
function aliasGetName($nameOrAlias) {
    if ('\\' === $nameOrAlias[0]) {
      return substr($nameOrAlias, 1);
    }
    elseif (NULL !== $this->namespaceName) {
      return $this->namespaceName . '\\' . $nameOrAlias;
    }
    else {
      return $nameOrAlias;
    }
  }
533128
public function lookupPrefix( $namespace )
	{
		foreach ( $this->namespaces as $prefix => $value )
		{
			if ( strcasecmp( $namespace, $value ) === 0 ) return $prefix;
		}

		return false;
	}
199490
def delete(self, namespacePrefix):
        """"""
        ns = db.ConfigNamespace.find_one(ConfigNamespace.namespace_prefix == namespacePrefix)
        if not ns:
            return self.make_response('No such namespace: {}'.format(namespacePrefix), HTTP.NOT_FOUND)

        db.session.delete(ns)
        db.session.commit()

        self.dbconfig.reload_data()
        auditlog(
            event='configNamespace.delete',
            actor=session['user'].username,
            data={'namespacePrefix': namespacePrefix}
        )
        return self.make_response('Namespace deleted')
49620
public static function extractNamespaceFromQualifiedName($name)
    {
        if (($pos = strrpos($name, '\\')) !== false) {
            return substr($name, 0, $pos);
        } else {
            return null;
        }
    }
1336480
protected function fetchMessagesFromNamespace($namespace)
    {
        $this->setNamespace($namespace);

        if ($this->hasMessages()) {
            $messages = $this->getMessagesFromNamespace($namespace);
            // reset namespace
            $this->setNamespace();

            return $this->buildMessage($namespace, $messages);
        }

        return '';
    }
550548
public function getNameSpace(string $name) : string
    {
        $segs = [];
        $name = str_replace("/", "\\", $name);
        $namespace = explode("\\", $name);
        array_pop($namespace);

        array_walk($namespace, function (&$value) {
            $value = $this->removeNoneAlpherNumeric($value);
        });

        return implode("\\", $namespace);
    }
442306
private function createNameAddressStrings(array $mailboxes)
    {
        $strings = [];

        foreach ($mailboxes as $email => $name) {
            $mailboxStr = $this->addressEncoder->encodeString($email);
            if (null !== $name) {
                $nameStr = $this->createDisplayNameString($name, empty($strings));
                $mailboxStr = $nameStr.' <'.$mailboxStr.'>';
            }
            $strings[] = $mailboxStr;
        }

        return $strings;
    }
283333
private function namespaceFromLegacyNamespace($namespace, $className)
    {
        $qcn = str_replace('_', '\\', $className);

        $lastBackslash = strrpos($qcn, '\\');
        if ($lastBackslash) {
            $namespace = rtrim($namespace, '\\') . '\\' . substr($qcn, 0, $lastBackslash);
        }

        return $namespace;
    }
1084646
protected static function formatUsesPrefix($new, $old)
    {
        if (isset($new['namespace'])) {
            return isset($old['namespace']) && \strpos($new['namespace'], '\\') !== 0
                ? \trim($old['namespace'], '\\').'\\'.\trim($new['namespace'], '\\')
                : \trim($new['namespace'], '\\');
        }

        return $old['namespace'] ?? null;
    }
787604
function stripNamespace (requestKey) {
  return requestKey.startsWith(LP_API_ACTION_NAMESPACE)
    ? requestKey.slice(LP_API_ACTION_NAMESPACE.length)
    : requestKey
}
1059146
public function toNamespacedString($namespace, array $aliased_classes, $this_class, $use_phpdoc_format)
    {
        $base_value = $this instanceof TNamedObject
            ? parent::toNamespacedString($namespace, $aliased_classes, $this_class, $use_phpdoc_format)
            : $this->value;

        if ($base_value === 'non-empty-array') {
            $base_value = 'array';
        }

        if ($use_phpdoc_format) {
            if ($this instanceof TNamedObject || $this instanceof TIterable) {
                return $base_value;
            }

            $value_type = $this->type_params[1];

            if ($value_type->isMixed()) {
                return $base_value;
            }

            $value_type_string = $value_type->toNamespacedString($namespace, $aliased_classes, $this_class, true);

            if (!$value_type->isSingle()) {
                return '(' . $value_type_string . ')[]';
            }

            return $value_type_string . '[]';
        }

        $extra_types = '';

        if ($this instanceof TNamedObject && $this->extra_types) {
            $extra_types = '&' . implode(
                '&',
                array_map(
                    /**
                     * @return string
                     */
                    function (Atomic $extra_type) use ($namespace, $aliased_classes, $this_class) {
                        return $extra_type->toNamespacedString($namespace, $aliased_classes, $this_class, false);
                    },
                    $this->extra_types
                )
            );
        }

        return $base_value .
                '<' .
                implode(
                    ', ',
                    array_map(
                        /**
                         * @return string
                         */
                        function (Union $type_param) use ($namespace, $aliased_classes, $this_class) {
                            return $type_param->toNamespacedString($namespace, $aliased_classes, $this_class, false);
                        },
                        $this->type_params
                    )
                ) .
                '>' . $extra_types;
    }
455023
public function getNameSpace()
	{
		$nsAlias = Yii::getAlias(self::NAMESPACE_ALIAS_NAME,false);

		return   $nsAlias === false ? $this->namespace : $nsAlias;
	}