repo_name stringclasses 6
values | hexsha stringclasses 6
values | file_path stringclasses 6
values | code stringclasses 6
values | apis sequence | extract_api stringclasses 6
values |
|---|---|---|---|---|---|
adcrn/knest | a274dc9ddb642cc30f837e225f000bf33430eb43 | utils/compare.py | # UCF Senior Design 2017-18
# Group 38
from PIL import Image
import cv2
import imagehash
import math
import numpy as np
DIFF_THRES = 20
LIMIT = 2
RESIZE = 1000
def calc_hash(img):
"""
Calculate the wavelet hash of the image
img: (ndarray) image file
"""
# resize image if height > 1000
im... | [
"numpy.shape"
] | [(22, 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {}), False, 'from PIL import Image\n'), (68, 'numpy.shape', 'np.shape', (['img'], {}), True, 'import numpy as np\n'), (69, 'numpy.shape', 'np.shape', (['img'], {}), True, 'import numpy as np\n'), (76, 'math.floor', 'math.floor', (['(height / scale)'], {}), False... |
dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | eslearn/utils/lc_featureSelection_variance.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 24 14:38:20 2018
dimension reduction with VarianceThreshold using sklearn.
Feature selector that removes all low-variance features.
@author: lenovo
"""
from sklearn.feature_selection import VarianceThreshold
import numpy as np
#
np.random.seed(1)
X = np.random.randn(100, 1... | [
"numpy.zeros",
"numpy.random.seed",
"numpy.random.randn",
"sklearn.feature_selection.VarianceThreshold"
] | [(11, 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), True, 'import numpy as np\n'), (12, 'numpy.random.randn', 'np.random.randn', (['(100)', '(10)'], {}), True, 'import numpy as np\n'), (25, 'sklearn.feature_selection.VarianceThreshold', 'VarianceThreshold', ([], {}), False, 'from sklearn.feature_selection impor... |
silent567/examples | e9de12549125ecd93a4924f6b8e2bbf66d7635d9 | mnist/my_multi_tune3.py | #!/usr/bin/env python
# coding=utf-8
from my_multi_main3 import main
import numpy as np
import argparse
import time
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
help='input batch size for training (defa... | [
"numpy.arange",
"numpy.savetxt"
] | [(9, 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), False, 'import argparse\n'), (66, 'my_multi_main3.main', 'main', (['args'], {}), False, 'from my_multi_main3 import main\n'), (67, 'numpy.savetxt', 'np.savetxt', (['record_name', 'record'], {'delimiter': '""... |
neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | codes/data/image_corruptor.py | import functools
import random
from math import cos, pi
import cv2
import kornia
import numpy as np
import torch
from kornia.augmentation import ColorJitter
from data.util import read_img
from PIL import Image
from io import BytesIO
# Get a rough visualization of the above distribution. (Y-axis is meaningless, just... | [
"numpy.mean",
"numpy.ones",
"numpy.clip",
"torch.from_numpy",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum"
] | [(47, 'utils.util.opt_get', 'opt_get', (['opt', "['cosine_bias']", '(True)'], {}), False, 'from utils.util import opt_get\n'), (33, 'kornia.augmentation.ColorJitter', 'ColorJitter', (['setting', 'setting', 'setting', 'setting'], {}), False, 'from kornia.augmentation import ColorJitter\n'), (55, 'random.Random', 'random... |
pclucas14/continuum | 09034db1371e9646ca660fd4d4df73e61bf77067 | tests/test_background_swap.py | import os
from torch.utils.data import DataLoader
from continuum.datasets import CIFAR10, InMemoryDataset
from continuum.datasets import MNIST
import torchvision
from continuum.scenarios import TransformationIncremental
import pytest
import numpy as np
from continuum.transforms.bg_swap import BackgroundSwap
DATA_PAT... | [
"numpy.array_equal",
"numpy.ones",
"torch.utils.data.DataLoader",
"numpy.random.normal",
"numpy.random.rand"
] | [(13, 'os.environ.get', 'os.environ.get', (['"""CONTINUUM_DATA_PATH"""'], {}), False, 'import os\n'), (24, 'numpy.random.rand', 'np.random.rand', (['(2)'], {}), True, 'import numpy as np\n'), (26, 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(0.5)', 'scale': '(0.1)', 'size': '[5, 5]'}), True, 'import numpy ... |
g-nightingale/tox_examples | d7714375c764580b4b8af9db61332ced4e851def | packaging/squarer/ml_squarer.py | import numpy as np
def train_ml_squarer() -> None:
print("Training!")
def square() -> int:
"""Square a number...maybe"""
return np.random.randint(1, 100)
if __name__ == '__main__':
train_ml_squarer() | [
"numpy.random.randint"
] | [(10, 'numpy.random.randint', 'np.random.randint', (['(1)', '(100)'], {}), True, 'import numpy as np\n')] |
README.md exists but content is empty.
- Downloads last month
- 3