Reverse a (per time step) time series mask, with shape [minibatch, timeSeriesLength]
@param mask Mask to reverse along time dimension
@return Mask after reversing
975628
public static INDArray reverseTimeSeriesMask(INDArray mask){
        if(mask == null){
            return null;
        }
        if(mask.rank() == 3){
            //Should normally not be used - but handle the per-output masking case
            return reverseTimeSeries(mask);
        } else if(mask.rank() != 2){
            throw new IllegalArgumentException("Invalid mask rank: must be rank 2 or 3. Got rank " + mask.rank()
                    + " with shape " + Arrays.toString(mask.shape()));
        }

        // FIXME: int cast
        int[] idxs = new int[(int) mask.size(1)];
        int j=0;
        for( int i=idxs.length-1; i>=0; i--){
            idxs[j++] = i;
        }

        return Nd4j.pullRows(mask, 0, idxs);
    }
280986
public static String getDateFormatMask() {
        String fmt = System.getProperty("drools.dateformat");
        if (fmt == null) {
            fmt = DEFAULT_FORMAT_MASK;
        }
        return fmt;
    }
651300
def get_interleave_mask():
    

    nodemask = nodemask_t()
    bitmask = libnuma.numa_get_interleave_mask()
    libnuma.copy_bitmask_to_nodemask(bitmask, byref(nodemask))
    libnuma.numa_bitmask_free(bitmask)

    return numa_nodemask_to_set(nodemask)
478060
def mask( m )
      check_shape m
      left = MultiArray.new typecode, *( shape.first( dimension - m.dimension ) +
                                         [ m.size ] )
      index = Hornetseye::Pointer( INT ).new
      index.store INT.new( 0 )
      block = Mask.new left, self, m, index
      if block.compilable?
        GCCFunction.run block
      else
        block.demand
      end
      left[0 ... index[]].roll
    end
344548
public static <A, B> Map<A, B> reverse(Map<A, B> map) {
    List<Map.Entry<A, B>> list = Lists.newArrayList(map.entrySet());
    Collections.reverse(list);
    return listToMap(list);
  }
1154085
private INDArray getMask() {
        // If no input is provided, no mask is used and null is returned
        if (inputIdx < 0) {
            return null;
        }

        final INDArray[] inputMaskArrays = graph.getInputMaskArrays();
        return (inputMaskArrays != null ? inputMaskArrays[inputIdx] : null);
    }
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)
1044860
public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays) {
        for (int i = 0; i < features.length; i++) {
            INDArray mask = (maskArrays == null ? null : maskArrays[i]);
            revertFeatures(features[i], mask, i);
        }
    }
643882
public static MaskFormat maskFormat(final String mask)
    {
        MaskFormat maskFmt = context.get().getMaskFormat();
        maskFmt.setMask(mask);
        return maskFmt;
    }
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;
  }
44784
public static INDArray reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask) {
        if (timeSeriesMask.rank() != 2)
            throw new IllegalArgumentException("Cannot reshape mask: rank is not 2");

        if (timeSeriesMask.ordering() != 'f')
            timeSeriesMask = timeSeriesMask.dup('f');

        return timeSeriesMask.reshape('f', timeSeriesMask.length(), 1);
    }
539393
def maskAt(self, index):
        
        if isinstance(self.mask, bool):
            return self.mask
        else:
            return self.mask[index]
604594
public void setMask(byte[] mask) {
    if (mask == null) {
      throw new IllegalArgumentException("Transmitter mask cannot be null.");
    }
    if (mask.length != TRANSMITTER_ID_SIZE) {
      throw new IllegalArgumentException(String.format(
          "Transmitter mask must be %d bytes long.",
          Integer.valueOf(TRANSMITTER_ID_SIZE)));
    }
    this.mask = mask;
  }
559298
def forget_masks(self):
        """"""
        self._seqno = 1
        self._maskobjs = []
        self._treepaths = []
        self.tree_dict = Bunch.caselessDict()
        self.redo()
878180
def apply_reverse(
        t: Union[List[List[float]], np.ndarray],
        pos: Tuple[float, float, float],
        with_offsets=True) -> Tuple[float, float, float]:
    
    return apply_transform(inv(t), pos)
843110
public SparseGraph reversed() {
        SparseGraph reverse = new SparseGraph();
        for (Entry<Integer, Set<Integer>> entryFrom : edges.entrySet())
            for (Integer to : entryFrom.getValue())
                reverse.addEdge(to, entryFrom.getKey());
        return reverse;
    }
397278
private static void reverse(final byte[] arr, final int len) {
        for (int l = 0, r = 0 + len - 1; l < r; l++, r--) {
            final byte tmp = arr[l];
            arr[l] = arr[r];
            arr[r] = tmp;
        }
    }