FAIL src/vectorstores/tests/closevector_web.test.ts
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface GWxApiOpts<T, K> { | |
success?: (callbackPayload: T) => any, | |
fail?: (callbackPayload: K) => any | |
} | |
type WxApiOpts<T, K, V> = { | |
[X in keyof V]: V[X] | |
} & GWxApiOpts<T, K> | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface WxApiOpts<T, K>{ | |
[k: string]: any, | |
success?: (callbackPayload: T) => any, | |
fail?: (callbackPayload: K) => any | |
} | |
/** | |
* 本方法将类似于 wx.request 等函数转化为 Promise 调用方式 | |
* @param callbackStyleFunction 被转换的函数,该类型函数只接受一个 Object 类型参数,且必须具备 success 和 fail 回调。 | |
* @param opts 防止 success 回调叫 success 的情况,传此参数进行重载。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* not offical link state mixin, created by jolamjiang, 20160201184405 | |
* Usage: | |
* <input type="text" className="form-control" id="rule-name" valueLink={this.linkState('rule.rule_name')} /> | |
*/ | |
'use strict'; | |
var ReactLink = require('react/lib/ReactLink'); | |
function getKeyValueRecursively(obj, key) { | |
if (!obj || !key) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This program is used for face detection and save the faces it detects. | |
""" | |
import sys | |
import re | |
import cv2 | |
import cv2.cv as cv | |
import numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autoToc = (function() { | |
function getHeadingArray(container, headingStartLevel) { | |
var array = []; | |
var currentNode = document.querySelector(container + ' h' + headingStartLevel); | |
var counter = 0; | |
while (currentNode) { | |
if (currentNode.tagName.match(/^H[1-9]$/)) { | |
var id = "SECTION-" + ++counter; | |
currentNode.setAttribute('id', id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KdTree(object): | |
# the KdTree must know the domains (numerical) and ensure the | |
# consistence of domains of all the points in the tree | |
def __init__(self, domains, root=None): | |
self.domains = domains | |
self.root = root | |
if not root is None: | |
for domain in domains: | |
setattr(self, domain, getattr(root.point, domain)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given a balanced binary tree like this: | |
# 1 | |
# / \ | |
# 2 3 | |
# / \ / \ | |
# 4 5 6 7 | |
# | |
# Sample Output: | |
# 1. preorder traversal: 1 2 4 5 3 6 7 | |
# 2. inorder traversal: 4 2 5 1 6 3 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# implemented according to the psudocode from: | |
# http://en.wikipedia.org/wiki/Heapsort (2013/03/05) | |
def heapSort(unsortedList): | |
heapify(unsortedList) | |
end = len(unsortedList) - 1 | |
while end > 0: | |
unsortedList[end], unsortedList[0] = unsortedList[0], unsortedList[end] | |
end -= 1 | |
shiftDown(unsortedList, 0, end) |
NewerOlder