@param $mask

@return $this
@throws MaskNotFoundException
353164
public function setDefaultAttachmentMask($mask) {
        if(class_exists($mask)) {
            $this->default_attachment_mask = $mask;

            return $this;
        }

        throw new MaskNotFoundException("Unknown mask provided: ".$mask);
    }
614860
public static String mask(final String mask, final String value)
    {
        return maskFormat(mask).format(value);
    }
1005963
public function getTokens($mask = Token::T_ANY)
    {
        if (!array_key_exists($mask, $this->maskStore)) {
            $this->maskStore[$mask] = array_filter($this->tokens, function ($type) use ($mask) {
                return $type & $mask;
            });
        }

        return $this->maskStore[$mask];
    }
445117
public function setCharacterMaskConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CharacterMaskConfig::class);
        $this->writeOneof(3, $var);

        return $this;
    }
778243
private function resolveMask($masks, $object)
    {
        $integerMask = 0;

        if (is_integer($masks)) {
            $integerMask = $masks;
        } elseif (is_string($masks)) {
            $permission = $this->permissionMap->getMasks($masks, $object);
            $integerMask = $this->resolveMask($permission, $object);
        } elseif (is_array($masks)) {
            foreach ($masks as $mask) {
                $integerMask += $this->resolveMask($mask, $object);
            }
        } else {
            throw new \RuntimeException('Not a valid mask type');
        }

        return $integerMask;
    }
296292
public function revoke($flag)
    {
        if (is_string($flag) && defined('static::' . strtoupper($flag))) {
            $flag = constant('static::' . strtoupper($flag));
        }

        $this->mask &= ~$flag;

        return $this;
    }
23185
public function grant($flag)
    {
        if (is_string($flag) && defined('static::' . strtoupper($flag))) {
            $flag = constant('static::' . strtoupper($flag));
        }

        $this->mask |= $flag;

        return $this;
    }
1297553
function() {
      // unmask all targets
      for (var i = this.targets.length - 1; i >= 0; i--)
        if (this.targets[i])
          this.targets[i].unmask()
      this.targets = []

      // remove mask from parent
      this.parent().removeElement(this)

      return this
    }
344346
def _set_mask(self, mask):
        
        self.mask = mask.copy()
        if self.h5 is not None:
            if 'mask' in self.h5:
                self.h5.pop('mask')
            self.h5.create_dataset('mask', mask.shape, dtype=self.mask.dtype, data=mask, compression="gzip", shuffle=True)
721469
public function format($mask, Entry $entry)
    {
        return $this->formatter->format($mask, function ($key) use ($entry) {
            if ($key === 'id') {
                return $entry->getID();
            }
            
            $attribute = $entry->getAttribute($key);
            if ($attribute) {
                return $attribute;
            }

            $association = $entry->getAssociation($key);
            if (is_object($association)) {
                return $association->getSelectedEntry()->getLabel();
            }
        });
    }
251371
public function write($mask = '%s')
    {
        $str='';
        foreach ($this->cleanStack($this->get()) as $entry) {
            $str .= (strlen($str)>0 ? $this->separator : '').$entry;
        }
        $title_str = Html::writeHtmlTag('title', strip_tags($str));
        return sprintf($mask, $title_str);
    }
1113948
protected function setMask($icon, $style='fas')
    {
        if (is_string($icon) === false) {
            throw new \InvalidArgumentException(
                'The mask icon label must be a string.'
            );
        }
        if (is_string($style) === false) {
            throw new \InvalidArgumentException(
                'The mask style label must be a string.'
            );
        }
        if (!in_array($style, $this->STYLES)) {
            throw new \InvalidArgumentException(
                'Invalid mask style.'
            );
        }

        $this->mask = $style." fa-".$icon;

        return $this;
    }
98851
public void removeMask(long[] mask) {
    int dest = BitsUtil.nextSetBit(mask, 0);
    if(dest < 0) {
      return;
    }
    int src = BitsUtil.nextSetBit(mask, dest);
    while(src < numEntries) {
      if(!BitsUtil.get(mask, src)) {
        entries[dest] = entries[src];
        dest++;
      }
      src++;
    }
    int rm = src - dest;
    while(dest < numEntries) {
      entries[dest] = null;
      dest++;
    }
    numEntries -= rm;
  }
317980
public function resolve(PermissionCollection $permissions, $mask)
    {
        $resolvedPermissions = array();

        foreach ($permissions->all() as $permission) {
            if ($permission->getBit() & $mask) {
                $resolvedPermissions[] = $permission;
                $mask = $mask ^ $permission->getBit();
            }
        }

        if ($mask) {
            $bits = decbin($mask);
            throw new InvalidArgumentException("Permission for bits $bits not found.");
        }

        return $resolvedPermissions;
    }
339428
public void addGuarded(Guarded newGuarded, int mask) {
        this.guardedEntries.put(newGuarded, new Integer(mask));
        newGuarded.setEnabled(stateMatchesMask(getFormModelState(), mask));
    }
662334
protected function setMaskFromConfig($config) {
        $default_config  = config("imap.masks");

        if(isset($config['masks'])){
            if(isset($config['masks']['message'])) {
                if(class_exists($config['masks']['message'])) {
                    $this->default_message_mask = $config['masks']['message'];
                }else{
                    throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']);
                }
            }else{
                if(class_exists($default_config['message'])) {
                    $this->default_message_mask = $default_config['message'];
                }else{
                    throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
                }
            }
            if(isset($config['masks']['attachment'])) {
                if(class_exists($config['masks']['attachment'])) {
                    $this->default_message_mask = $config['masks']['attachment'];
                }else{
                    throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']);
                }
            }else{
                if(class_exists($default_config['attachment'])) {
                    $this->default_message_mask = $default_config['attachment'];
                }else{
                    throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
                }
            }
        }else{
            if(class_exists($default_config['message'])) {
                $this->default_message_mask = $default_config['message'];
            }else{
                throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
            }

            if(class_exists($default_config['attachment'])) {
                $this->default_message_mask = $default_config['attachment'];
            }else{
                throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
            }
        }

    }
1032280
public function setMethod($method)
    {
        if ($method < 1 || $method > self::METHOD_ALL) {
            throw new BadMethodException("Invalid method mask {$method}");
        }
        $this->method = $method;
    }