Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
| // https://godbolt.org/z/b9s5cxPao | |
| #include <generator> | |
| #include <utility> | |
| auto generator_baseline() -> int { | |
| static THREAD_LOCAL auto i = 0; | |
| return i++; | |
| } |
| import math | |
| from typing import Union, NamedTuple | |
| import numpy as np | |
| from scipy.ndimage import affine_transform | |
| class AffineTransform(NamedTuple): | |
| matrix: np.ndarray | |
| offset: np.ndarray |
Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
| """Example TensorFlow code for Self-Attention mechanism. | |
| Refs: | |
| Attention Is All You Need | |
| Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin | |
| https://arxiv.org/abs/1706.03762 | |
| Transformer: A Novel Neural Network Architecture for Language Understanding | |
| https://research.googleblog.com/2017/08/transformer-novel-neural-network.html |
| __author__ = 'dkarchmer' | |
| ''' | |
| This script emulates a stand-alone Python based client. It relies on Boto3 to access AWS, but | |
| requires your Django server to have an API for your user to access Cognito based credentials | |
| Because of Cognito, the client (this script) will only get temporary AWS credentials associated | |
| to your user and only your user, and based on whatever you configure your AIM Policy to be. | |
| Most Cognito examples demonstrate how to use Cognito for Mobile Apps, so this scripts demonstrate | |
| how to create a stand-alone Python script but operating similarly to these apps. |
| --use like eval(HRANDKEY, 2, key_for_set_with_keys, key_for_hash_with_keys) | |
| local randkey = redis.call('srandmember', KEYS[1]) | |
| local val = redis.call('hget', KEYS[2], randkey) | |
| return val |
| #!/bin/bash | |
| # Created by Håvard Fossli <[email protected]> in 2013 | |
| # This is free and unencumbered software released into the public domain. | |
| # For more information, please refer to <http://unlicense.org/> | |
| # | |
| # Description | |
| # A bash script for fetching all branches and tags of a git project as snapshots into separate folders | |
| # | |
| # Keywords |
| #include <Python.h> | |
| //Normally #include "arrayobject.h" should be sufficient. I need to fix my includes. | |
| #include "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h" | |
| /* | |
| * Convolution method. | |
| */ | |
| static PyObject* convolve(PyObject* self, PyObject* args) | |
| { | |
| PyArrayObject *vec1, *vec2, *conv; //The python object proxies |
| import sys | |
| import numpy | |
| from nltk.cluster import KMeansClusterer, GAAClusterer, euclidean_distance | |
| import nltk.corpus | |
| from nltk import decorators | |
| import nltk.stem | |
| stemmer_func = nltk.stem.EnglishStemmer().stem | |
| stopwords = set(nltk.corpus.stopwords.words('english')) |