Merge consecutive Filter(x), Filter(y) blocks into Filter(x && y) block.
978498
def merge_consecutive_filter_clauses(ir_blocks):
    """"""
    if not ir_blocks:
        return ir_blocks

    new_ir_blocks = [ir_blocks[0]]

    for block in ir_blocks[1:]:
        last_block = new_ir_blocks[-1]
        if isinstance(last_block, Filter) and isinstance(block, Filter):
            new_ir_blocks[-1] = Filter(
                BinaryComposition(u'&&', last_block.predicate, block.predicate))
        else:
            new_ir_blocks.append(block)

    return new_ir_blocks
195713
private TreeNode<K> combine(TreeNode<K> x, TreeNode<K> y) {
        TreeNode<K> z = new TreeNode<K>();
        z.left = x;
        z.right = y;
        z.rank = x.rank + 1;
        sift(z);
        return z;
    }
533124
def dict_merged(d, _filter=None, **kw):
    """"""
    def f(s):
        if _filter:
            return _filter(s)
        return s is not None
    d = d or {}
    for k, v in iteritems(kw):
        if f(v):
            d[k] = v
    return d
1072012
function getCombination (dateFilter, resolutionFilter, dataTypeFilter) {
  var c = {
    date: getFilter(date, dateFilter),
    resolution: getFilter(resolution, resolutionFilter),
    dataType: getFilter(dataType, dataTypeFilter),
    searchParameters: getSearchParameters(dateFilter, resolutionFilter, dataTypeFilter)
  };
  c.key = [c.date.key, c.resolution.key, c.dataType.key].join('_');

  return c;
}
644353
function join(maybeArray, separator) {
  return maybeArray ? maybeArray.filter(function (x) {
    return x;
  }).join(separator || '') : '';
}
514961
function partial(area) {
    var allFilter = null;

    for (var _len2 = arguments.length, filters = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        filters[_key2 - 1] = arguments[_key2];
    }

    if (filters.length == 1 && typeof filters[0] === 'string') {
        allFilter = filter$1(filters[0]);
    } else {
        allFilter = merge$1(filters);
    }

    return function (bitmap, done) {
        var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

        allFilter(getBitmap(bitmap, area), function (newBitmap) {
            done(putBitmap(bitmap, newBitmap, area));
        }, opt);
    };
}
230438
def block_sep0(self, Y):
        
        """

        # This method is overridden because we have to change the
        # mechanism for combining the Y0 and Y1 blocks into a single
        # array (see comment in the __init__ method).
        shp = Y.shape[0:self.cri.axisC] + self.y0shp[self.cri.axisC:]
        return Y[(slice(None),)*self.cri.axisC +
                 (slice(0, self.y0I),)].reshape(shp)
216241
def copy_filter(filter)
      buffer = {exclude: {}, include: {}}

      filter[:exclude].each do |part|
        buffer[:exclude][part[0]] = part[1].dup
      end

      filter[:include].each do |part|
        buffer[:include][part[0]] = part[1].dup
      end

      return buffer
    end
1007478
public void combine(SearchFilter new_filter, int op) throws DBException
    {
        // If this is not a logical operator, throw an exception
        if ((op & LOGICAL_OPER_MASK) == 0)
        {
            throw new DBException();
            // Create a new vector consisting of just the filters
            // from the SearchFilter classes in new_filters
        }
        Vector filters = new Vector();
        filters.addElement(new_filter.getFilter());
        // Create a node for this list and return it
        m_filter = new SearchBaseNode(op, m_filter, filters);
    }
1285965
def block_cat(self, Y0, Y1):
        
        """

        return np.concatenate((Y0, Y1), axis=self.blkaxis)
874077
def filterStack(self, filters):
        
        visited, removes, orphans = filter_stack(self.graph, self, filters)

        for last_good, tail in orphans:
            self.graph.add_edge(last_good, tail, edge_data='orphan')

        for node in removes:
            self.graph.hide_node(node)

        return len(visited)-1, len(removes), len(orphans)
1188494
public static <E> Filter<E> orFilter(Filter<E> f1, Filter<E> f2) {
    return (new CombinedFilter<E>(f1, f2, false));
  }
360808
private static void mergeBlocks(List< Block > blocks) {
        for (int i = 1; i < blocks.size(); i++) {
            Block b1 = blocks.get(i - 1);
            Block b2 = blocks.get(i);
            if ((b1.mode == b2.mode) &&
                (b1.mode != EncodingMode.NUM || b1.length + b2.length <= MAX_NUMERIC_COMPACTION_BLOCK_SIZE)) {
                b1.length += b2.length;
                blocks.remove(i);
                i--;
            }
        }
    }
262531
def apply_filter(x, filter=None, axis=0):
    """"""
    x = _as_array(x)
    if x.shape[axis] == 0:
        return x
    b, a = filter
    return signal.filtfilt(b, a, x, axis=axis)
512101
def partition(predicate, iterable):
    

    t1, t2 = tee(iterable)

    return filterfalse(predicate, t1), filter(predicate, t2)
293769
def trim_filter(filter, levels=1):
    ''''''
    trimmed = [f[levels:] for f in filter]
    return [f for f in trimmed if f]
440238
void merge(DefaultWorkspaceFilter workspaceFilter) {
    for (Filter item : filters) {
      PathFilterSet filterSet = toFilterSet(item);
      boolean exists = false;
      for (PathFilterSet existingFilterSet : workspaceFilter.getFilterSets()) {
        if (filterSet.equals(existingFilterSet)) {
          exists = true;
        }
      }
      if (!exists) {
        workspaceFilter.add(filterSet);
      }
    }
  }