chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:39:55 +08:00
commit 7ee4420c10
87 changed files with 15222 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# coding:utf-8
import numpy as np
def check_data(a, b):
if not isinstance(a, np.ndarray):
a = np.array(a)
if not isinstance(b, np.ndarray):
b = np.array(b)
if type(a) != type(b):
raise ValueError("Type mismatch: %s and %s" % (type(a), type(b)))
if a.size != b.size:
raise ValueError("Arrays must be equal in length.")
return a, b
def validate_input(function):
def wrapper(a, b):
a, b = check_data(a, b)
return function(a, b)
return wrapper