original_string: public function getNamespace($mbox, $personal = false)
      {
          $mbox = strval($mbox);
  
          if ($ns = $this[$mbox]) {
              return $ns;
          }
  
          foreach ($this->_ns as $val) {
              $mbox = $mbox . $val->delimiter;
              if (strlen($val->name) && (strpos($mbox, $val->name) === 0)) {
                  return $val;
              }
          }
  
          return (($ns = $this['']) && (!$personal || ($ns->type === $ns::NS_PERSONAL)))
              ? $ns
              : null;
      }
code: public function getNamespace($mbox, $personal = false)
      {
          $mbox = strval($mbox);
  
          if ($ns = $this[$mbox]) {
              return $ns;
          }
  
          foreach ($this->_ns as $val) {
              $mbox = $mbox . $val->delimiter;
              if (strlen($val->name) && (strpos($mbox, $val->name) === 0)) {
                  return $val;
              }
          }
  
          return (($ns = $this['']) && (!$personal || ($ns->type === $ns::NS_PERSONAL)))
              ? $ns
              : null;
      }
code_tokens: public function getNamespace ( $ mbox , $ personal = false ) { $ mbox = strval ( $ mbox ) ; if ( $ ns = $ this [ $ mbox ] ) { return $ ns ; } foreach ( $ this -> _ns as $ val ) { $ mbox = $ mbox . $ val -> delimiter ; if ( strlen ( $ val -> name ) && ( strpos ( $ mbox , $ val -> name ) === 0 ) ) { return $ val ; } } return ( ( $ ns = $ this [ '' ] ) && ( ! $ personal || ( $ ns -> type === $ ns :: NS_PERSONAL ) ) ) ? $ ns : null ; }
docstring: Get namespace info for a full mailbox path.
  
  @param string $mbox       The mailbox path.
  @param boolean $personal  If true, will return the empty namespace only
  if it is a personal namespace.
  
  @return mixed  The Horde_Imap_Client_Data_Namespace object for the
  mailbox path, or null if the path doesn't exist.
docstring_tokens: Get namespace info for a full mailbox path .