This method is used to get a mask dynamically

@param pIndex
start index of the mask
@param pLength
size of mask
@return the mask in byte
334344
public byte getMask(final int pIndex, final int pLength) {
		byte ret = (byte) DEFAULT_VALUE;
		// Add X 0 to the left
		ret = (byte) (ret << pIndex);
		ret = (byte) ((ret & DEFAULT_VALUE) >> pIndex);
		// Add X 0 to the right
		int dec = BYTE_SIZE - (pLength + pIndex);
		if (dec > 0) {
			ret = (byte) (ret >> dec);
			ret = (byte) (ret << dec);
		}
		return ret;
	}
399009
def kpl_set_on_mask(self, address, group, mask):
        """"""
        addr = Address(address)
        device = self.plm.devices[addr.id]
        device.states[group].set_on_mask(mask)
614860
public static String mask(final String mask, final String value)
    {
        return maskFormat(mask).format(value);
    }
1283328
def _update(self, mask):
        """"""
        if self.reporting:
            for pin in self.pins:
                if pin.mode is INPUT:
                    pin_nr = pin.pin_number - self.port_number * 8
                    pin.value = (mask & (1 << pin_nr)) > 0
917534
private static byte getCombinationMask(Set<XmLepResourceSubType> scriptTypes,
                                           LepMethod lepMethod,
                                           UrlLepResourceKey compositeResourceKey) {
        byte combinationMask = 0;
        for (XmLepResourceSubType scriptType : scriptTypes) {
            switch (scriptType) {
                case BEFORE:
                    combinationMask |= BEFORE_MASK;
                    break;

                case AROUND:
                    combinationMask |= AROUND_MASK;
                    break;

                case TENANT:
                    combinationMask |= TENANT_MASK;
                    break;

                case DEFAULT:
                    combinationMask |= DEFAULT_MASK;
                    break;

                case AFTER:
                    combinationMask |= AFTER_MASK;
                    break;

                default:
                    throw new IllegalArgumentException("Unsupported script type: " + scriptType
                                                           + " for resource key: " + compositeResourceKey
                                                           + ", all script types: " + scriptTypes);
            }
        }

        if (lepMethod.getTarget() != null) {
            combinationMask |= JAVA_CODE_MASK;
        }

        return combinationMask;

    }
400731
def subsequent_mask(size: int, device: str = 'cpu') -> torch.Tensor:
    """"""
    mask = torch.tril(torch.ones(size, size, device=device, dtype=torch.int32)).unsqueeze(0)
    return mask
974500
public static RectL getBounds(final RectL pIn,
                                  final long pCenterX, final long pCenterY, final double pDegrees,
                                  final RectL pReuse) {
        final RectL out = pReuse != null ? pReuse : new RectL();
        if (pDegrees == 0) { // optimization
            out.top = pIn.top;
            out.left = pIn.left;
            out.bottom = pIn.bottom;
            out.right = pIn.right;
            return out;
        }
        final double radians = pDegrees * Math.PI / 180.;
        final double cos = Math.cos(radians);
        final double sin = Math.sin(radians);
        long inputX;
        long inputY;
        long outputX;
        long outputY;
        inputX = pIn.left; // corner 1
        inputY = pIn.top;
        outputX = getRotatedX(inputX, inputY, pCenterX, pCenterY, cos, sin);
        outputY = getRotatedY(inputX, inputY, pCenterX, pCenterY, cos, sin);
        out.top = out.bottom = outputY;
        out.left = out.right = outputX;
        inputX = pIn.right; // corner 2
        inputY = pIn.top;
        outputX = getRotatedX(inputX, inputY, pCenterX, pCenterY, cos, sin);
        outputY = getRotatedY(inputX, inputY, pCenterX, pCenterY, cos, sin);
        if (out.top > outputY) {
            out.top = outputY;
        }
        if (out.bottom < outputY) {
            out.bottom = outputY;
        }
        if (out.left > outputX) {
            out.left = outputX;
        }
        if (out.right < outputX) {
            out.right = outputX;
        }
        inputX = pIn.right; // corner 3
        inputY = pIn.bottom;
        outputX = getRotatedX(inputX, inputY, pCenterX, pCenterY, cos, sin);
        outputY = getRotatedY(inputX, inputY, pCenterX, pCenterY, cos, sin);
        if (out.top > outputY) {
            out.top = outputY;
        }
        if (out.bottom < outputY) {
            out.bottom = outputY;
        }
        if (out.left > outputX) {
            out.left = outputX;
        }
        if (out.right < outputX) {
            out.right = outputX;
        }
        inputX = pIn.left; // corner 4
        inputY = pIn.bottom;
        outputX = getRotatedX(inputX, inputY, pCenterX, pCenterY, cos, sin);
        outputY = getRotatedY(inputX, inputY, pCenterX, pCenterY, cos, sin);
        if (out.top > outputY) {
            out.top = outputY;
        }
        if (out.bottom < outputY) {
            out.bottom = outputY;
        }
        if (out.left > outputX) {
            out.left = outputX;
        }
        if (out.right < outputX) {
            out.right = outputX;
        }
        return out;
    }
600381
public static String unmask(final String mask, final String value) throws ParseException
    {
        return maskFormat(mask).parse(value);
    }
1069779
function maskString(srcStr, mask, start, length) {
      var str = String(srcStr), ptn = /[^\u4e00-\u9fa5]/mg, ptn_ = /[\u4e00-\u9fa5]/mg;
      if (isNum(mask)) {
        length = start, start = mask, mask = '*';
      } else if (!isStr(mask)) {
        mask = '*';
      }
      var maskStr = str.substr(start, length).replace(ptn, mask).replace(ptn_, mask + mask);
      return str.substr(0, start) + maskStr + (isUdf(length) ? '' : str.substr(start + length));
    }
947175
public String encrypt(final String pText) throws GeneralSecurityException {
        byte[] clearBytes = pText.getBytes(Charset.forName("UTF-8"));
        byte[] salt = getSalt(SALT_SIZE);

        Cipher cipher = createCipher(salt, Cipher.ENCRYPT_MODE);
        byte[] encryptedBytes = cipher.doFinal(clearBytes);
        int len = encryptedBytes.length;

        byte padLen = (byte) (CHUNK_SIZE - (SALT_SIZE + len + 1) % CHUNK_SIZE);
        int totalLen = SALT_SIZE + len + padLen + 1;

        byte[] allEncryptedBytes = getSalt(totalLen);
        System.arraycopy(salt, 0, allEncryptedBytes, 0, SALT_SIZE);
        allEncryptedBytes[SALT_SIZE] = padLen;
        System.arraycopy(encryptedBytes, 0, allEncryptedBytes, SALT_SIZE + 1, len);

        return Base64Util.encode(allEncryptedBytes);
    }
1014577
public long getNextLongSigned(final int pLength) {
		if (pLength > Long.SIZE) {
			throw new IllegalArgumentException("Long overflow with length > 64");
		}
		long decimal = getNextLong(pLength);
		long signMask = 1 << pLength - 1;

		if ( (decimal & signMask) != 0) {
			return - (signMask - (signMask ^ decimal));
		}
		return decimal;
	}
416546
def MakeTargetMask(target, pad=0):
  """"""
  target_mask = (target != pad)[ :, np.newaxis, :]
  target_dtype = target_mask.dtype
  causal_mask = onp.tril(onp.ones((1, target.shape[-1], target.shape[-1]),
                                  dtype=target_dtype), k=0)
  target_mask = target_mask & causal_mask
  return np.expand_dims(target_mask, axis=1)
1175539
public void setNextByte(final byte[] pValue, final int pLength, final boolean pPadBefore) {
		int totalSize = (int) Math.ceil(pLength / BYTE_SIZE_F);
		ByteBuffer buffer = ByteBuffer.allocate(totalSize);
		int size = Math.max(totalSize - pValue.length, 0);
		if (pPadBefore) {
			for (int i = 0; i < size; i++) {
				buffer.put((byte) 0);
			}
		}
		buffer.put(pValue, 0, Math.min(totalSize, pValue.length));
		if (!pPadBefore) {
			for (int i = 0; i < size; i++) {
				buffer.put((byte) 0);
			}
		}
		byte tab[] = buffer.array();
		if (currentBitIndex % BYTE_SIZE != 0) {
			int index = 0;
			int max = currentBitIndex + pLength;
			while (currentBitIndex < max) {
				int mod = currentBitIndex % BYTE_SIZE;
				int modTab = index % BYTE_SIZE;
				int length = Math.min(max - currentBitIndex, Math.min(BYTE_SIZE - mod, BYTE_SIZE - modTab));
				byte val = (byte) (tab[index / BYTE_SIZE] & getMask(modTab, length));
				if (mod == 0) {
					val = (byte) (val << Math.min(modTab, BYTE_SIZE - length));
				} else {
					val = (byte) ((val & DEFAULT_VALUE) >> mod);
				}
				byteTab[currentBitIndex / BYTE_SIZE] |= val;
				currentBitIndex += length;
				index += length;
			}

		} else {
			System.arraycopy(tab, 0, byteTab, currentBitIndex / BYTE_SIZE, tab.length);
			currentBitIndex += pLength;
		}
	}
987573
def i2m(self, pkt, i):
        """""""  # noqa: E501
        mask, ip = i
        ip = pton_ntop.inet_pton(socket.AF_INET6, ip)
        return struct.pack(">B", mask) + ip[:self.mask2iplen(mask)]
339446
protected int getMaskValue(int number,int layout)
	{
//		int pos=maskLen*layout;
//		int pos=posCache[layout];
//		int mask=config.mask;
		return (number & (config.mask<<posCache[layout]))>>>posCache[layout];
	}
930705
def get_mask(cls, azim):
        

        if cls.mask is None:
            raise ValueError("No mask defined for the station {}".format(cls.name))

        azim %= 2 * np.pi

        if azim in cls.mask[0, :]:
            return cls.mask[1, np.where(azim == cls.mask[0, :])[0][0]]

        for next_i, mask_azim in enumerate(cls.mask[0, :]):
            if mask_azim > azim:
                break
        else:
            next_i = 0

        x0, y0 = cls.mask[:, next_i - 1]
        x1, y1 = cls.mask[:, next_i]

        if next_i - 1 == -1:
            x0 = 0

        return y0 + (y1 - y0) * (azim - x0) / (x1 - x0)
723354
public function getMaskedPan($binding_index)
    {
        $binding = $this->getBinding();
        return array_key_exists('maskedPan', $binding[$binding_index]) ? $binding[$binding_index]['maskedPan'] : null;
    }