Internal method to handle NA filling of take
766742
def _assert_take_fillable(self, values, indices, allow_fill=True,
                              fill_value=None, na_value=None):
        
        # only fill if we are passing a non-None fill_value
        if allow_fill and fill_value is not None:
            if (indices < -1).any():
                msg = ('When allow_fill=True and fill_value is not None, '
                       'all indices must be >= -1')
                raise ValueError(msg)
            taken = [lab.take(indices) for lab in self.codes]
            mask = indices == -1
            if mask.any():
                masked = []
                for new_label in taken:
                    label_values = new_label.values()
                    label_values[mask] = na_value
                    masked.append(np.asarray(label_values))
                taken = masked
        else:
            taken = [lab.take(indices) for lab in self.codes]
        return taken
164469
def take_nd(self, indexer, axis, new_mgr_locs=None, fill_tuple=None):
        

        # algos.take_nd dispatches for DatetimeTZBlock, CategoricalBlock
        # so need to preserve types
        # sparse is treated like an ndarray, but needs .get_values() shaping

        values = self.values
        if self.is_sparse:
            values = self.get_values()

        if fill_tuple is None:
            fill_value = self.fill_value
            new_values = algos.take_nd(values, indexer, axis=axis,
                                       allow_fill=False, fill_value=fill_value)
        else:
            fill_value = fill_tuple[0]
            new_values = algos.take_nd(values, indexer, axis=axis,
                                       allow_fill=True, fill_value=fill_value)

        if new_mgr_locs is None:
            if axis == 0:
                slc = libinternals.indexer_as_slice(indexer)
                if slc is not None:
                    new_mgr_locs = self.mgr_locs[slc]
                else:
                    new_mgr_locs = self.mgr_locs[indexer]
            else:
                new_mgr_locs = self.mgr_locs

        if not is_dtype_equal(new_values.dtype, self.dtype):
            return self.make_block(new_values, new_mgr_locs)
        else:
            return self.make_block_same_class(new_values, new_mgr_locs)
37684
private void fill() throws IOException {
    int n;
    previousBufferSize += nChars;
    do {
      n = in.read(cb, 0, cb.length);
    } while (n == 0);
    if (n > 0) {
      nChars = n;
      nextChar = 0;
    }
  }
516349
function fill(buffer, value) {
    $.checkArgumentType(buffer, 'Buffer', 'buffer');
    $.checkArgumentType(value, 'number', 'value');
    var length = buffer.length;
    for (var i = 0; i < length; i++) {
      buffer[i] = value;
    }
    return buffer;
  }
884322
def fill(self):
        ''' '''
        self.frequency2umis = collections.defaultdict(list)

        for read in self.inbam:

            if read.is_unmapped:
                continue

            if read.is_read2:
                continue

            self.umis[self.barcode_getter(read)[0]] += 1

        self.umis_counter = collections.Counter(self.umis)
        total_umis = sum(self.umis_counter.values())
        U.info("total_umis %i" % total_umis)
        U.info("#umis %i" % len(self.umis_counter))

        self.prob = self.umis_counter.values()
        sum_prob = sum(self.prob)
        self.prob = [float(x) / sum_prob for x in self.prob]
        self.refill_random()
950962
def _stringify_na_values(na_values):
    
    result = []
    for x in na_values:
        result.append(str(x))
        result.append(x)
        try:
            v = float(x)

            # we are like 999 here
            if v == int(v):
                v = int(v)
                result.append("{value}.0".format(value=v))
                result.append(str(v))

            result.append(v)
        except (TypeError, ValueError, OverflowError):
            pass
        try:
            result.append(int(x))
        except (TypeError, ValueError, OverflowError):
            pass
    return set(result)
308435
function _fillInputText(element, value, next) {
        var onFilled = chainAndErrorCallback.call(this, null, next);
        var onClear = chainAndErrorCallback.call(this, function () {
            element.type(value || '', onFilled);
        }, onFilled);

        element.clear(onClear);
    }
922784
function occupySlice(
  targetArr: Array<?string>,
  start: number,
  end: number,
  componentKey: string
): void {
  // eslint-disable-next-line no-plusplus
  for (let ii = start; ii < end; ii++) {
    // eslint-disable-next-line no-param-reassign
    targetArr[ii] = componentKey;
  }
}
1272331
private void _fill () throws IOException
  {
    int nDstOfs = 0;
    if (m_nMarkedChar > UNMARKED)
    {
      // Marked
      final int nDelta = m_nNextCharIndex - m_nMarkedChar;
      if (nDelta >= m_nReadAheadLimit)
      {
        // Gone past read-ahead limit: Invalidate mark
        m_nMarkedChar = INVALIDATED;
        m_nReadAheadLimit = 0;
      }
      else
      {
        if (m_nReadAheadLimit <= m_aBuf.length)
        {
          // Shuffle in the current buffer
          System.arraycopy (m_aBuf, m_nMarkedChar, m_aBuf, 0, nDelta);
          m_nMarkedChar = 0;
          nDstOfs = nDelta;
        }
        else
        {
          // Reallocate buffer to accommodate read-ahead limit
          final char [] aNewBuf = new char [m_nReadAheadLimit];
          System.arraycopy (m_aBuf, m_nMarkedChar, aNewBuf, 0, nDelta);
          m_aBuf = aNewBuf;
          m_nMarkedChar = 0;
          nDstOfs = nDelta;
        }
        m_nNextCharIndex = nDelta;
        m_nChars = nDelta;
      }
    }

    int nBytesRead;
    do
    {
      nBytesRead = m_aReader.read (m_aBuf, nDstOfs, m_aBuf.length - nDstOfs);
    } while (nBytesRead == 0);
    if (nBytesRead > 0)
    {
      m_nChars = nDstOfs + nBytesRead;
      m_nNextCharIndex = nDstOfs;
    }
  }
669074
def _nan_minmax_object(func, fill_value, value, axis=None, **kwargs):
    
    valid_count = count(value, axis=axis)
    filled_value = fillna(value, fill_value)
    data = getattr(np, func)(filled_value, axis=axis, **kwargs)
    if not hasattr(data, 'dtype'):  # scalar case
        data = dtypes.fill_value(value.dtype) if valid_count == 0 else data
        return np.array(data, dtype=value.dtype)
    return where_method(data, valid_count != 0)
745611
def fill(args):
    
    p = OptionParser(fill.__doc__)
    p.add_option("--stretch", default=3, type="int",
                 help="MAX_STRETCH to pass to FillFragments [default: %default]")
    p.set_cpus()

    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    fastb, = args
    assert fastb == "frag_reads_corr.fastb"

    pcfile = "frag_reads_corr.k28.pc.info"
    nthreads = " NUM_THREADS={0}".format(opts.cpus)
    maxstretch = " MAX_STRETCH={0}".format(opts.stretch)
    if need_update(fastb, pcfile):
        cmd = "PathReads READS_IN=frag_reads_corr"
        cmd += nthreads
        sh(cmd)

    filledfastb = "filled_reads.fastb"
    if need_update(pcfile, filledfastb):
        cmd = "FillFragments PAIRS_OUT=frag_reads_corr_cpd"
        cmd += " PRECORRECT_LIBSTATS=True"
        cmd += maxstretch
        cmd += nthreads
        sh(cmd)

    filledfasta = "filled_reads.fasta"
    if need_update(filledfastb, filledfasta):
        cmd = "Fastb2Fasta IN=filled_reads.fastb OUT=filled_reads.fasta"
        sh(cmd)
761369
private void fillBlock(int block, /*UChar32*/ int start, /*UChar32*/ int limit,
              int value, int initialValue, boolean overwrite) {
        int i;
        int pLimit = block+limit;
        if(overwrite) {
            for (i=block+start; i<pLimit; i++) {
                data[i] = value;
            }
        } else {
            for (i=block+start; i<pLimit; i++) {
                if(data[i]==initialValue) {
                    data[i]=value;
                }
            }
        }
    }
1032632
def fillNoneValues(column):
    
    if column.dtype == object:
        column.fillna('', inplace=True)
    return column
875853
def take_nd(self, indexer, axis=0, new_mgr_locs=None, fill_tuple=None):
        
        if fill_tuple is None:
            fill_value = None
        else:
            fill_value = fill_tuple[0]

        # axis doesn't matter; we are really a single-dim object
        # but are passed the axis depending on the calling routing
        # if its REALLY axis 0, then this will be a reindex and not a take
        new_values = self.values.take(indexer, fill_value=fill_value,
                                      allow_fill=True)

        if self.ndim == 1 and new_mgr_locs is None:
            new_mgr_locs = [0]
        else:
            if new_mgr_locs is None:
                new_mgr_locs = self.mgr_locs

        return self.make_block_same_class(new_values, new_mgr_locs)
1015651
def _fill(self, values):
        """"""
        zero = self.view.y(min(max(self.zero, self._box.ymin), self._box.ymax))

        # Check to see if the data has been padded with "none's"
        # Fill doesn't work correctly otherwise
        end = len(values) - 1
        while end > 0:
            x, y = values[end]
            if self.missing_value_fill_truncation == "either":
                if x is not None and y is not None:
                    break
            elif self.missing_value_fill_truncation == "x":
                if x is not None:
                    break
            elif self.missing_value_fill_truncation == "y":
                if y is not None:
                    break
            else:
                raise ValueError(
                    "Invalid value ({}) for config key "
                    "'missing_value_fill_truncation';"
                    " Use 'x', 'y' or 'either'".format(
                        self.missing_value_fill_truncation
                    )
                )
            end -= 1

        return ([(values[0][0], zero)] + values + [(values[end][0], zero)])
1004602
def get_fill_value(dataset):
    """"""
    if np.issubdtype(dataset.dtype, np.integer):
        return dataset.attrs.get('_FillValue', np.nan)
    return np.nan
1359473
def _fill_untouched(idx, ret, fill_value):
    """"""
    untouched = np.ones_like(ret, dtype=bool)
    untouched[idx] = False
    ret[untouched] = fill_value