omp parallel for private(j,i)
325435
def convolution(A):
    m = A.shape[0]
    n = A.shape[1]
    B = numpy.zeros((m,n))

    c11 = 2.0
    c21 = 5.0
    c31 = -8.0
    c12 = -3.0
    c22 = 6.0
    c32 = -9.0
    c13 = 4.0
    c23 = 7.0
    c33 = 10.0
    ""
    for i in xrange(1, m - 1):
        for j in xrange(1, n - 1):
          B[i,j] = c11 * A[i - 1,j - 1] + c12 * A[i + 0,j - 1] + c13 * A[i + 1,j - 1]\
          + c21 * A[i - 1,j + 0] + c22 * A[i + 0,j + 0] + c23 * A[i + 1,j + 0]\
          + c31 * A[i - 1,j + 1] + c32 * A[i + 0,j + 1] + c33 * A[i + 1,j + 1]
    return B
219637
def multiprocessing_ppmap_worker(in_queue, out_queue, func, fixed_arg):
    
    while True:
        i, var_arg = in_queue.get()
        if i is None:
            break
        out_queue.put((i, func(i, fixed_arg, var_arg)))
242171
public static <K, V> void forEachKeyValue(
            Map<K, V> map,
            Procedure2<? super K, ? super V> procedure,
            int minForkSize,
            int taskCount)
    {
        if (map.size() > minForkSize)
        {
            Procedure<Pair<K, V>> pairProcedure = new PairProcedure<K, V>(procedure);
            ParallelIterate.forEach(MapIterate.toListOfPairs(map), new PassThruProcedureFactory<Procedure<Pair<K, V>>>(pairProcedure), new PassThruCombiner<Procedure<Pair<K, V>>>(), minForkSize, taskCount);
        }
        else
        {
            MapIterate.forEachKeyValue(map, procedure);
        }
    }
145619
function parallel (promiseFunctions, limit = Infinity, silenceErrors = false) {
  const contraMethod = (tasks, callback) => concurrent(tasks, limit, callback)
  return generatePromise(promiseFunctions, contraMethod, silenceErrors)
}
776689
@GuardedBy("lock")
    protected int computeIndex(long seqno) {
        int diff=(int)(seqno - offset);
        if(diff < 0)
            return diff;
        return diff & (elements_per_row - 1); // same as mod, but (apparently, I'm told) more efficient
    }
295951
def p_jrjp(p):
    
    if p[1] in ('JR', 'DJNZ'):
        op = 'N'
        p[2] = Expr.makenode(Container('-', p.lineno(1)), p[2], Expr.makenode(Container(MEMORY.org + 2, p.lineno(1))))
    else:
        op = 'NN'

    p[0] = Asm(p.lineno(1), p[1] + ' ' + op, p[2])
539380
def parallel(func, arr:Collection, max_workers:int=None):
    ""
    max_workers = ifnone(max_workers, defaults.cpus)
    if max_workers<2: results = [func(o,i) for i,o in progress_bar(enumerate(arr), total=len(arr))]
    else:
        with ProcessPoolExecutor(max_workers=max_workers) as ex:
            futures = [ex.submit(func,o,i) for i,o in enumerate(arr)]
            results = []
            for f in progress_bar(concurrent.futures.as_completed(futures), total=len(arr)): results.append(f.result())
    if any([o is not None for o in results]): return results
92186
def parallel_fn(f):
    

    def simple_parallel(func, sequence, **args):
        """ f takes an element of sequence as input and the keyword args in **args"""
        if 'processes' in args:
            processes = args.get('processes')
            del args['processes']
        else:
            processes = multiprocessing.cpu_count()

        pool = multiprocessing.Pool(processes)  # depends on available cores

        result = pool.map_async(universal_worker, pool_args(func, sequence, args))
        pool.close()
        pool.join()
        cleaned = [x for x in result.get() if x is not None]  # getting results
        cleaned = asarray(cleaned)
        return cleaned
    return partial(simple_parallel, f)
701697
private /*@ helper @*/ void multAddMe(int iv, int addend) {
        long v = iv & LONG_MASK;
        // unroll 0th iteration, doing addition.
        long p = v * (data[0] & LONG_MASK) + (addend & LONG_MASK);
        data[0] = (int) p;
        p >>>= 32;
        for (int i = 1; i < nWords; i++) {
            p += v * (data[i] & LONG_MASK);
            data[i] = (int) p;
            p >>>= 32;
        }
        if (p != 0L) {
            data[nWords++] = (int) p; // will fail noisily if illegal!
        }
    }
1174216
def _maybe_nest_bare_single(items_by_key, parallel):
    
    if (parallel == "multi-parallel" and
          (sum([1 for x in items_by_key.values() if not _is_nested_item(x)]) >=
           sum([1 for x in items_by_key.values() if _is_nested_item(x)]))):
        out = {}
        for k, v in items_by_key.items():
            out[k] = [v]
        return out
    else:
        return items_by_key
692942
private int mulsub(int[] q, int[] a, int x, int len, int offset) {
        long xLong = x & LONG_MASK;
        long carry = 0;
        offset += len;

        for (int j=len-1; j >= 0; j--) {
            long product = (a[j] & LONG_MASK) * xLong + carry;
            long difference = q[offset] - product;
            q[offset--] = (int)difference;
            carry = (product >>> 32)
                     + (((difference & LONG_MASK) >
                         (((~(int)product) & LONG_MASK))) ? 1:0);
        }
        return (int)carry;
    }
395734
def _map_or_starmap(function, iterable, args, kwargs, map_or_starmap):
    
    arg_newarg = (("parallel", "pm_parallel"), ("chunksize", "pm_chunksize"),
                  ("pool", "pm_pool"), ("processes", "pm_processes"),
                  ("parmap_progress", "pm_pbar"))
    kwargs = _deprecated_kwargs(kwargs, arg_newarg)
    chunksize = kwargs.pop("pm_chunksize", None)
    progress = kwargs.pop("pm_pbar", False)
    progress = progress and HAVE_TQDM
    parallel, pool, close_pool = _create_pool(kwargs)
    # Map:
    if parallel:
        func_star = _get_helper_func(map_or_starmap)
        try:
            if progress and close_pool:
                try:
                    num_tasks = len(iterable)
                    # get a chunksize (as multiprocessing does):
                    chunksize = _get_default_chunksize(chunksize,
                                                       pool, num_tasks)
                    # use map_async to get progress information
                    result = pool.map_async(func_star,
                                            izip(repeat(function),
                                                 iterable,
                                                 repeat(list(args)),
                                                 repeat(kwargs)),
                                            chunksize)
                finally:
                    pool.close()
                # Progress bar:
                try:
                    _do_pbar(result, num_tasks, chunksize)
                finally:
                    output = result.get()
            else:
                result = pool.map_async(func_star,
                                        izip(repeat(function),
                                             iterable,
                                             repeat(list(args)),
                                             repeat(kwargs)),
                                        chunksize)
                output = result.get()
        finally:
            if close_pool:
                if not progress:
                    pool.close()
                pool.join()
    else:
        output = _serial_map_or_starmap(function, iterable, args, kwargs,
                                        progress, map_or_starmap)
    return output
1249694
def with_fixed_mpi_omp(self, mpi_procs, omp_threads):
        
        manager = self.manager if hasattr(self, "manager") else self.flow.manager
        self.manager = manager.new_with_fixed_mpi_omp(mpi_procs, omp_threads)
669136
private List<Double> getTopN(INDArray vec, int N) {
        BasicModelUtils.ArrayComparator comparator = new BasicModelUtils.ArrayComparator();
        PriorityQueue<Double[]> queue = new PriorityQueue<>(vec.rows(), comparator);

        for (int j = 0; j < vec.length(); j++) {
            final Double[] pair = new Double[] {vec.getDouble(j), (double) j};
            if (queue.size() < N) {
                queue.add(pair);
            } else {
                Double[] head = queue.peek();
                if (comparator.compare(pair, head) > 0) {
                    queue.poll();
                    queue.add(pair);
                }
            }
        }

        List<Double> lowToHighSimLst = new ArrayList<>();

        while (!queue.isEmpty()) {
            double ind = queue.poll()[1];
            lowToHighSimLst.add(ind);
        }
        return Lists.reverse(lowToHighSimLst);
    }
376070
def p_jr(p):
    
    p[4] = Expr.makenode(Container('-', p.lineno(3)), p[4], Expr.makenode(Container(MEMORY.org + 2, p.lineno(1))))
    p[0] = Asm(p.lineno(1), 'JR %s,N' % p[2], p[4])
746440
public static <I, O> JMConcurrentProcessor<I, O> buildWithThreadPool(
            Function<I, O> transformerFunction) {
        return buildWithThreadPool(OS.getAvailableProcessors(),
                transformerFunction);
    }
438410
public void eachNonZeroInColumn(int j, VectorProcedure procedure) {
        VectorIterator it = nonZeroIteratorOfColumn(j);

        while (it.hasNext()) {
            double x = it.next();
            int i = it.index();
            procedure.apply(i, x);
        }
    }