repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Vlad12344/RoboDKToPulsePostprocessor | [
"95b3c52a82bffe43862a1d4edcf388fa25dffca0"
] | [
"postprocessor/converter/RobodkUR2Pulse.py"
] | [
"import os\nimport math\nimport time\nimport numpy as np\n\nfrom .programParser import find_numbers, find_word\nfrom .linalg import UR_2_Pose, Pose_2_TxyzRxyz, txyzRxyz_2_pose\n\n\nclass Postprocessor():\n \"\"\"\n Generate program for Rozum Robotics robots like Pulse 75 or Pulse 90.\n\n Initial program is... | [
[
"numpy.linalg.inv",
"numpy.matmul",
"numpy.zeros",
"numpy.eye"
]
] |
zsmatlab/labelimg | [
"cb95aada0f15b86ba9f7a4b9b6e6592300554a9f"
] | [
"labelImg.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf8 -*-\nimport _init_path\nimport codecs\nimport os.path\nimport re\nimport sys\nimport subprocess\n\nfrom functools import partial\nfrom collections import defaultdict\nimport numpy as np\n\ntry:\n from PyQt5.QtGui import *\n from PyQt5.QtCore import *\n from PyQt5.... | [
[
"numpy.random.random"
]
] |
goat1010/astronomy-anomaly | [
"7061327b7e3b0a0e3db2ec68553c3553626b219e"
] | [
"src/main_gmm.py"
] | [
"import math\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import _kmeans\nfrom sklearn.metrics.pairwise import euclidean_distances\nfrom sklearn.mixture import GaussianMixture\nfrom sklearn.preprocessing import StandardScaler\n\nfrom pkg import detect_anomaly as ... | [
[
"sklearn.cluster._kmeans.KMeans",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"numpy.where",
"sklearn.mixture.GaussianMixture",
"numpy.sort",
"pandas.concat",
"numpy.unique"
]
] |
ToucanToco/toucan-data-sdk | [
"1d82b7112231b65f8a310327b6d6673d137b7378",
"1d82b7112231b65f8a310327b6d6673d137b7378"
] | [
"tests/utils/generic/test_compute_evolution.py",
"toucan_data_sdk/utils/generic/roll_up.py"
] | [
"import os\n\nimport pandas as pd\nimport pytest\n\nfrom toucan_data_sdk.utils.generic import (\n compute_evolution_by_criteria,\n compute_evolution_by_frequency,\n)\nfrom toucan_data_sdk.utils.generic.compute_evolution import DuplicateRowsError\nfrom toucan_data_sdk.utils.helpers import ParamsValueError\n\nf... | [
[
"pandas.Series"
],
[
"pandas.concat"
]
] |
ramansbach/cluster_analysis | [
"6fe0be86cebf34558b501d86905a77c6e0164b5a",
"6fe0be86cebf34558b501d86905a77c6e0164b5a"
] | [
"clustering/scripts/analyze_clusters_martini.py",
"clustering/tests/test_Martini_clustering.py"
] | [
"\"\"\"\nExample of running optical and contact cluster stuff on gromacs file\n\"\"\"\nfrom __future__ import absolute_import, division, print_function\nimport os.path as op\nimport numpy as np\nimport numpy.testing as npt\nimport pdb\nimport gsd.hoomd\nimport sys\nimport clustering as cl\nimport random\nimport sci... | [
[
"numpy.array"
],
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
michaelchanwahyan/vtk-7.0.0 | [
"770166bbe1f28a99d776b47624c6f6955b9aaaec"
] | [
"Parallel/MPI4Py/Testing/Python/TestParallelNumpy.py"
] | [
"\"\"\" Test for various numpy_interface modules. Main goal is to test\nparallel algorithms in vtk.numpy_interface.algorithms.\"\"\"\n\nfrom __future__ import print_function\n\nimport sys\ntry:\n import numpy\nexcept ImportError:\n print(\"Numpy (http://numpy.scipy.org) not found.\", end=' ')\n print(\"Thi... | [
[
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.std",
"numpy.abs",
"numpy.var"
]
] |
biobenkj/scanorama | [
"e5b302f596f93f8412891b0144f35aefb71d2495"
] | [
"bin/fly_brain.py"
] | [
"import numpy as np\n\nfrom process import load_names, merge_datasets\nfrom scanorama import process_data, find_alignments_table\nfrom time_align import time_align_correlate, time_align_visualize\n\nNAMESPACE = 'fly_brain'\n\ndata_names = [\n 'data/fly_brain/DGRP-551_0d_rep1',\n 'data/fly_brain/DGRP-551_0d_re... | [
[
"numpy.array"
]
] |
dangeles/WormFiles | [
"fbdddc1700cb9c21a6ca0fc9430f63f6e32b441b"
] | [
"useful_scripts/src/LinkerCellAnalysisScript.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 6 11:56:42 2015\n\n@author: davidangeles\n\nScript for analysis of Mihoko's linker cell data\n\"\"\"\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import stats\n\n\n#log of the fold change of ratios that will be consid... | [
[
"pandas.read_csv",
"scipy.stats.hypergeom.sf",
"numpy.logspace",
"matplotlib.pyplot.subplots"
]
] |
iejMac/torchgeo | [
"17792df26d9194443889b9cceba0b24546b190cd"
] | [
"torchgeo/datasets/agb_live_woody_density.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"Aboveground Live Woody Biomass Density dataset.\"\"\"\n\nimport glob\nimport json\nimport os\nfrom typing import Any, Callable, Dict, Optional\n\nimport matplotlib.pyplot as plt\nfrom rasterio.crs import CRS\n\n... | [
[
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots"
]
] |
borsden/pyvista | [
"dface2fbec53f9a3679bad9454d95358cb2695a4"
] | [
"pyvista/core/pointset.py"
] | [
"\"\"\"Sub-classes and wrappers for vtk.vtkPointSet.\"\"\"\nimport pathlib\nimport logging\nimport os\nimport warnings\n\nimport numpy as np\nimport vtk\nfrom vtk import (VTK_HEXAHEDRON, VTK_PYRAMID, VTK_QUAD,\n VTK_QUADRATIC_HEXAHEDRON, VTK_QUADRATIC_PYRAMID,\n VTK_QUADRATIC_QUAD, V... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.any",
"numpy.arange",
"numpy.issubdtype"
]
] |
Cyril-Grl/MuGen | [
"3f4d5b104f3f3b4dffe884e9cbf2e30625ba0d75",
"3f4d5b104f3f3b4dffe884e9cbf2e30625ba0d75"
] | [
"tests_rnn.py",
"src/Convolutional_VAE/cvae_train.py"
] | [
"# import src.VAE\n#\n# src.VAE.train()\n\n# import src.train\nimport numpy as np\n\nfrom src.data import get_drum\nfrom src.models import get_model\n\nmodel = get_model('src/rnn_10_classes.h5')\n\nfor i in range(1, 100):\n try:\n data = get_drum('datasets/quantized_rythm_dataset/0/random_' + str(i) + '.m... | [
[
"numpy.argmax"
],
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.annotate",
"numpy.reshape",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.m... |
volpatto/porousdrake | [
"ffc2cadebc0415daa86fbeab130489d095b76193"
] | [
"porousdrake/SPP/convergence/solvers.py"
] | [
"from firedrake import *\nimport numpy as np\nfrom firedrake.petsc import PETSc\nfrom firedrake import COMM_WORLD\nimport convergence.exact_solution as exact_solution\nfrom convergence.model_parameters import *\n\ntry:\n import matplotlib.pyplot as plt\n\n plt.rcParams[\"contour.corner_mask\"] = False\n pl... | [
[
"matplotlib.pyplot.close"
]
] |
goldenbili/DocReader | [
"1825452108dd0d8185132b1ee6766760932f8399"
] | [
"script/interactive_local.py"
] | [
"import sys\n\nsys.path.append('.')\n\n\nimport threading\nfrom time import localtime\nimport time\n\nimport torch\nimport torch._utils\nSTOPWORDS_ATEN = frozenset(['device','use','KE6900','ke6940','ke8950','ke8952','ke69xx','ke89xx','work','purpose','cannot','problem'])\n\ntry:\n torch._utils._rebuild_tensor_v2... | [
[
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch._utils._rebuild_tensor",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.pairwise.cosine_similarity",
"sklearn.decomposition.TruncatedSVD"
]
] |
mckaymckay/Unsupervised-learning | [
"46d627fc5b24043ebb6f2e3b4388b66be3ece7d5"
] | [
"data/image_folder.py"
] | [
" ################################################################################\n# Code from\n# https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py\n# Modified the original code so that it also loads images from the current\n# directory as well as the subdirectories\n#################... | [
[
"numpy.zeros_like",
"torch.mul",
"numpy.zeros",
"numpy.log",
"numpy.median",
"numpy.sum",
"numpy.exp",
"numpy.mean",
"torch.median",
"torch.from_numpy",
"numpy.arange",
"numpy.transpose",
"numpy.maximum",
"numpy.repeat",
"numpy.meshgrid",
"numpy.expa... |
niall-twomey/recommender_metrics | [
"a195ffbfdfb261bb973479a58123c0cc9ae2ae4c"
] | [
"recommender_metrics/calculation.py"
] | [
"from functools import partial\nfrom typing import Any\nfrom typing import Callable\nfrom typing import Dict\nfrom typing import Iterator\nfrom typing import List\nfrom typing import Optional\nfrom typing import Tuple\nfrom typing import Union\n\nimport numpy as np\nfrom sklearn.base import BaseEstimator\n\nfrom re... | [
[
"numpy.random.uniform",
"numpy.argsort"
]
] |
bowang-lab/BIONIC | [
"fb2ee913a012a99900694f7b7119ce3dba513ee6",
"fb2ee913a012a99900694f7b7119ce3dba513ee6"
] | [
"bionic/utils/sampler.py",
"bionic/tests/test_train.py"
] | [
"import torch\nfrom torch.utils.data import Sampler\nfrom torch_geometric.data import NeighborSampler\n\nfrom typing import List, Tuple, NamedTuple\nfrom torch import Tensor\n\n\nclass StatefulSampler(Sampler):\n \"\"\"A random sampler that ensures instances share the same permutation.\n\n Instances are passe... | [
[
"torch.randperm",
"torch.stack",
"torch.tensor"
],
[
"torch.manual_seed",
"pandas.read_csv",
"scipy.spatial.distance.pdist"
]
] |
maxscheurer/cclib | [
"722a8b534686465d4e3ae57b8dd285a56f197e4a"
] | [
"src/cclib/method/lpa.py"
] | [
"# -*- coding: utf-8 -*-\r\n#\r\n# Copyright (c) 2017, the cclib development team\r\n#\r\n# This file is part of cclib (http://cclib.github.io) and is distributed under\r\n# the terms of the BSD 3-Clause License.\r\n\r\n\"\"\"Löwdin population analysis.\"\"\"\r\n\r\nimport random\r\n\r\nimport numpy\r\n\r\nfrom ccl... | [
[
"numpy.dot",
"numpy.add",
"numpy.reshape",
"numpy.zeros",
"numpy.multiply",
"numpy.subtract",
"numpy.linalg.eig",
"numpy.power"
]
] |
kopok2/machine-learning-algorithms | [
"9d5eb9c17a1354e726b79e9cfae9e5638976b919"
] | [
"ClassificationAndRegression/EnsembleMethods/AdaBoost.py"
] | [
"# coding=utf-8\n\"\"\"AdaBoost multiclass classification.\"\"\"\n\nfrom sklearn import datasets, model_selection, metrics, ensemble\n\nif __name__ == \"__main__\":\n print(\"Loading data...\")\n X, y = datasets.load_iris(return_X_y=True)\n X_train, X_test, y_train, y_test = model_selection.train_test_spli... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.datasets.load_iris"
]
] |
megamindsecurity/Hands-On-Intelligent-Agents-with-OpenAI-Gym- | [
"14f6931009f4d2ff5597b9059a836c0210a45ff2"
] | [
"ch8/environment/carla_gym/envs/carla_env.py"
] | [
"\"\"\"\nOpenAI Gym compatible Driving simulation environment based on Carla.\nRequires the system environment variable CARLA_SERVER to be defined and be pointing to the\nCarlaUE4.sh file on your system. The default path is assumed to be at: ~/software/CARLA_0.8.2/CarlaUE4.sh\n\"\"\"\nfrom __future__ import absolut... | [
[
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.expand_dims",
"numpy.clip"
]
] |
hologerry/mmdetection | [
"faea0079ce6c4651e59c481ddd53f99afaada961"
] | [
"mmdet/models/roi_heads/bbox_heads/convfc_bbox_head_feat.py"
] | [
"import torch.nn as nn\nfrom mmcv.cnn import ConvModule\n\nfrom mmdet.models.builder import HEADS\nfrom .bbox_head import BBoxHead\n\n\n@HEADS.register_module()\nclass ConvFCBBoxHeadFeat(BBoxHead):\n r\"\"\"More general bbox head, with shared conv and fc layers and two optional\n separated branches.\n\n ..... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_",
"torch.nn.ReLU"
]
] |
farbod1277/imitation | [
"eba376771963ce3f13b17fe23457d7235b9afc99"
] | [
"src/imitation/analysis/mountain_car_plots.py"
] | [
"\"\"\"Heatmaps and reward plotting code for debugging MountainCar.\"\"\"\n\nimport pathlib\nimport pickle\nfrom typing import Dict, List, Optional, Sequence, Union\n\nimport gym\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom stable_baselines3.common import vec_env\n\nfrom imitation.data import rol... | [
[
"numpy.array",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.subplots"
]
] |
chrissaher/boundary-detection | [
"0600c1c09b67f0d931fe50803f0416854de5b542"
] | [
"video_right.py"
] | [
"import argparse\nimport os\nimport cv2\nfrom tqdm import tqdm\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\n\n\ndef main():\n files = [\n 'car1.mp4',\n 'car2.mp4',\n 'ped1.mp4',\n 'ped2.mp4',\n 'ped3.mp4',\n 'ped4.mp4',\n 'ped5.mp4',\n ... | [
[
"numpy.array",
"torch.load",
"torch.from_numpy"
]
] |
cnheider/chainerrl | [
"018a29132d77e5af0f92161250c72aba10c6ce29"
] | [
"chainerrl/explorers/additive_gaussian.py"
] | [
"import numpy as np\n\nfrom chainerrl import explorer\n\n\nclass AdditiveGaussian(explorer.Explorer):\n \"\"\"Additive Gaussian noise to actions.\n\n Each action must be numpy.ndarray.\n\n Args:\n scale (float or array_like of floats): Scale parameter.\n low (float, array_like of floats, or N... | [
[
"numpy.random.normal",
"numpy.clip"
]
] |
RichardScottOZ/geoapps | [
"1463ba4ec3c914abdc7403e54eca0ee2bbc3f4f4",
"1463ba4ec3c914abdc7403e54eca0ee2bbc3f4f4"
] | [
"geoapps/simpegPF/EM/Utils/AnalyticUtils.py",
"geoapps/simpegPF/EM/NSEM/Utils/testUtils.py"
] | [
"import numpy as np\nfrom .. import Mesh, Utils\nfrom scipy.special import ellipk, ellipe\nfrom scipy.constants import mu_0\nimport properties\n\norientationDict = {\n \"X\": np.r_[1.0, 0.0, 0.0],\n \"Y\": np.r_[0.0, 1.0, 0.0],\n \"Z\": np.r_[0.0, 0.0, 1.0],\n}\n\n\ndef MagneticDipoleVectorPotential(\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.empty",
"scipy.special.ellipe",
"numpy.zeros",
"numpy.ones",
"scipy.special.ellipk",
"numpy.allclose",
"numpy.multiply",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.cross",
"numpy.vstack",
... |
supersunshinefk/UMRFormer-Net | [
"bf165ca2158a158f7c194c6201af2a4fcabe8742"
] | [
"UMRFormer/inference/predict_simple.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"torch.cuda.empty_cache"
]
] |
Yuxiang1990/rising | [
"a443b754df8defed193bdcc36398ee20846267f6",
"a443b754df8defed193bdcc36398ee20846267f6"
] | [
"tests/rand/test_abstract.py",
"tests/transforms/functional/test_tensor.py"
] | [
"import unittest\n\nimport torch\n\nfrom rising.random import AbstractParameter, DiscreteParameter\n\n\nclass TestAbstract(unittest.TestCase):\n def test_none(self):\n param = DiscreteParameter([None], replacement=True)\n res = param((1,))\n self.assertIsNone(res)\n\n def test_tensor_like... | [
[
"torch.tensor"
],
[
"torch.arange"
]
] |
RobinCamarasa/MONAI | [
"8207e1e2a3555ddc3fe938e058552651900dc951"
] | [
"tests/test_rand_rotate.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"numpy.testing.assert_allclose",
"numpy.rad2deg",
"numpy.stack"
]
] |
brendanhasz/dsutils | [
"e780e904f7bf0ec5e14aa7ddb337f01f29779143"
] | [
"tests/test_optimization.py"
] | [
"\"\"\"Tests optimization\n\n\"\"\"\n\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import make_regression, make_classification\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.linear_model import Linea... | [
[
"numpy.square",
"numpy.sin",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.random.randn",
"sklearn.linear_model.Ridge",
"sklearn.linear_model.ElasticNet",
"numpy.arange",
"sklearn.datasets.make_regression",
"matplotlib.pyplot.ylabel",... |
Pialmeida/face_recognition | [
"c30a588fed794d29f256ddbbd7f718d0b6d3ea6f"
] | [
"recognise_face.py"
] | [
"import face_recognition\nimport cv2\nimport numpy as np\nimport os\nimport glob\nimport re\n\n# Get a reference to webcam #0 (the default one)\nvideo_capture = cv2.VideoCapture(0)\n\n#make array of sample pictures with encodings\nknown_face_encodings = []\nknown_face_names = []\ndirname = os.path.dirname(__file__)... | [
[
"numpy.argmin"
]
] |
pankhilmaru/ga-learner-dsmp-repo | [
"dc0cb6c2775766059cfaa369829c3e746481aa95"
] | [
"High-Rated-Games-on-Google-Store-Project/code.py"
] | [
"# --------------\n#Importing header files\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n#Code starts here\ndata = pd.read_csv(path)\n\nfig1 = plt.figure()\ndata.hist(column=\"Rating\")\nplt.title(\"Data Exploration of Rating Feature\")\n\ndata = data[data['Rating']<=5]\nfig2 = plt... | [
[
"pandas.to_datetime",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"pandas.concat",
"pandas.read_csv"
]
] |
Rosetta-Leong/pytorch_learning | [
"86cf2252dd210a5fc613a65dbb773bdf1e2b734f",
"86cf2252dd210a5fc613a65dbb773bdf1e2b734f"
] | [
"chapter6_convolutional-modern/6.7_Resnet.py",
"chapter2_linear_networks/2.1_linear_regression.py"
] | [
"# -*-coding:utf-8-*-\n# @File : 2021/8/10 下午8:29\n# @Author : Rosetta0\n# @File : 6.7_Resnet.py\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom d2l import torch as d2l\n\n# 实现残差块\nclass Residual(nn.Module):\n \n def __init__(self, input_channels, num_channels... | [
[
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.nn.Flatten"
],
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.MSELoss",
"torch.no_grad",
"tor... |
imatge-upc/refvos | [
"f90ae679224a42cf350ce596c5a09056a6773aa6"
] | [
"coco_utils.py"
] | [
"import copy\nimport torch\nimport torch.utils.data\nimport torchvision\nfrom PIL import Image\n\nimport os\n\nfrom pycocotools import mask as coco_mask\n# from pycocotools.coco import COCO\n# from pycocotools.cocoeval import COCOeval\n# import pycocotools.mask as coco_mask\n\n\nfrom transforms import Compose\n\n\n... | [
[
"torch.utils.data.Subset",
"torch.as_tensor",
"torch.stack",
"torch.zeros"
]
] |
mikewoodson/ssl-transfer | [
"97411c844553549c62ce261ef3cc0747441cae2a"
] | [
"datahandlers/isic.py"
] | [
"# This code is modified from https://github.com/facebookresearch/low-shot-shrink-hallucinate\n\nimport torch\nfrom PIL import Image\nimport numpy as np\nimport pandas as pd\nimport torchvision.transforms as transforms\nfrom torch.utils.data import Dataset, DataLoader\nfrom abc import abstractmethod\n\nfrom PIL imp... | [
[
"pandas.read_csv",
"torch.randperm",
"numpy.asarray",
"torch.utils.data.DataLoader"
]
] |
andylikescodes/mne-python | [
"732bb1f994e64e41a8e95dcc10dc98c22cac95c0"
] | [
"examples/datasets/spm_faces_dataset_sgskip.py"
] | [
"\"\"\"\n.. _ex-spm-faces:\n\n==========================================\nFrom raw data to dSPM on SPM Faces dataset\n==========================================\n\nRuns a full pipeline using MNE-Python:\n\n - artifact removal\n - averaging Epochs\n - forward model computation\n - source reconstruction u... | [
[
"matplotlib.pyplot.show"
]
] |
QUANTENSOR/QUANTIME | [
"948a9db48789c97f261ff0379ba2067cc23e93f6"
] | [
"position.py"
] | [
"import pandas as pd\r\npd.set_option('expand_frame_repr', False)\r\npd.set_option('display.max_rows', 20000)\r\n\r\n\r\nclass QTPosition:\r\n\r\n\tdef __init__(self):\r\n\t\t\"\"\"\r\n\t\t持仓信息的初始化定义\r\n\t\t\"\"\"\r\n\r\n\t\tself.df = pd.DataFrame(data=None,\r\n\t\t\t\t\t\t\t columns=['code', # 股票代码\r\n\t\t\t\t\... | [
[
"pandas.DataFrame",
"pandas.set_option"
]
] |
marianokamp/former | [
"5e81c67638b113d18e848d4097d704c20cddcd59"
] | [
"former/modules.py"
] | [
"from former import util\nfrom util import mask_\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nimport random, math\n\nclass SelfAttentionWide(nn.Module):\n def __init__(self, emb, heads=8, mask=False):\n \"\"\"\n\n :param emb:\n :param heads:\n :param mask:... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.bmm",
"torch.nn.ReLU",
"torch.nn.functional.softmax"
]
] |
made-ml-in-prod-2021/holyketzer | [
"f693f2d5fce8cced03873e2b89cbe10617996c64"
] | [
"airflow_ml_dags/images/airflow-train/train.py"
] | [
"import os\nimport pandas as pd\nimport click\nimport joblib\n\nfrom sklearn.ensemble import RandomForestRegressor\n\n\n@click.command(\"train\")\n@click.option(\"--input-dir\")\n@click.option(\"--output-dir\")\ndef train(input_dir: str, output_dir):\n data = pd.read_csv(os.path.join(input_dir, \"data.csv\"))\n ... | [
[
"sklearn.ensemble.RandomForestRegressor"
]
] |
novaya/numpy | [
"bf6859c4248d3595493d2d809bafe1bc200ad6fa"
] | [
"numpy/core/tests/test_numeric.py"
] | [
"import sys\nimport warnings\nimport itertools\nimport platform\nimport pytest\nfrom decimal import Decimal\n\nimport numpy as np\nfrom numpy.core import umath\nfrom numpy.random import rand, randint, randn\nfrom numpy.testing import (\n assert_, assert_equal, assert_raises, assert_raises_regex,\n assert_arra... | [
[
"numpy.int8",
"numpy.random.rand",
"numpy.tile",
"numpy.binary_repr",
"numpy.resize",
"numpy.tensordot",
"numpy.ndarray.sum",
"numpy.count_nonzero",
"numpy.empty",
"numpy.nonzero",
"numpy.seterrobj",
"numpy.prod",
"numpy.greater",
"numpy.clongdouble",
"n... |
monchana/ByteTrack | [
"b9a9448fa01d661a07d74aed6f900a4f5e7c1f54"
] | [
"exps/example/mot/yolox_m_mix_det.py"
] | [
"# encoding: utf-8\nimport os\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nfrom yolox.exp import Exp as MyExp\nfrom yolox.data import get_yolox_datadir\n\nclass Exp(MyExp):\n def __init__(self):\n super(Exp, self).__init__()\n self.num_classes = 1\n ... | [
[
"torch.distributed.get_world_size",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
lanl/minRL | [
"f935142479738de41bc93640edb6a3e3cb0778cc"
] | [
"exarl/utils/OUActionNoise.py"
] | [
"# This material was prepared as an account of work sponsored by an agency of the\n# United States Government. Neither the United States Government nor the United\n# States Department of Energy, nor Battelle, nor any of their employees, nor any\n# jurisdiction or organization that has cooperated in the development... | [
[
"numpy.random.normal",
"numpy.zeros_like",
"numpy.sqrt"
]
] |
syskn/transformers | [
"fafbd2574cb12b987099f69b3821814042d8f4ce"
] | [
"src/transformers/models/led/modeling_led.py"
] | [
"# coding=utf-8\n# Copyright 2021 Iz Beltagy, Matthew E. Peters, Arman Cohan and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.einsum",
"torch.isnan",
"torch.finfo",
"torch.bmm",
"torch.masked_fill",
"torch.nn.functional.pad",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.tensor",
"torch.zeros",
"torch.nn.functional.dropout",
"torch... |
irigi/nnWOD | [
"cbc3474a45a219178f9eccda20648e1cc389db12"
] | [
"attributes.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom dicepool import dpool\n\nclass Attributes(object):\n \"\"\"\n Class holding the attributes of a character\n \"\"\"\n def __init__(self, Int=1, Wit=1, Com=1, Str=1, Dex=1, Sta=1, Man=1, Pre=1, Res=1):\n self.attr = {}\n self.attr['i... | [
[
"numpy.random.choice"
]
] |
yulunwang/pennylane | [
"9830e08a3b905bf32df50c203634a9e698499b8e"
] | [
"pennylane/wires.py"
] | [
"# Copyright 2018-2020 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.random.seed",
"numpy.array"
]
] |
ntfrgl/test | [
"79ded90816f49274ab6ac91febe50e4dad7b710a"
] | [
"src/pyunicorn/climate/climate_network.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# This file is part of pyunicorn.\n# Copyright (C) 2008--2022 Jonathan F. Donges and pyunicorn authors\n# URL: <http://www.pik-potsdam.de/members/donges/software>\n# License: BSD (3-clause)\n#\n# Please acknowledge and cite the use of this software and its authors\n# ... | [
[
"numpy.array",
"numpy.empty",
"numpy.fill_diagonal",
"numpy.zeros",
"numpy.load",
"numpy.tanh"
]
] |
itsayellow/marcam | [
"b41e2f1fa9c8defc336f386e90a6e18690673e43"
] | [
"marcam/image_proc.py"
] | [
"\"\"\"Image Processing: image manipulation and image info routines\n\"\"\"\n# Copyright 2017-2018 Matthew A. Clapp\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://... | [
[
"numpy.zeros"
]
] |
iamkrvikash/PT100-AFE | [
"d8b17d9afa9dce9b015c2176c2ece2ab22af79ac"
] | [
"Python/pt100.py"
] | [
"#####################################\n## 11 bit Operation at ADC ##\n#####################################\n\n# import Libraries\nimport csv\nimport cmath\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Temperature & Resistance from PT-100 Datasheet\ntemp=[]\nres=[]\ncount=0\nfor row in csv.read... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.interp",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
ngiangre/kng1_analysis | [
"cc0535efc6ca554378357358b3ea31c25d9c2c52"
] | [
"survival_analysis_individual_marker_predictions.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pickle\nimport time\nimport random\nimport os\n\nfrom sklearn import linear_model, model_selection, ensemble\nfrom sklearn.svm import SVC\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.base import clone\nfrom sklearn import metrics\nfrom sklea... | [
[
"sklearn.model_selection.StratifiedKFold",
"numpy.random.seed",
"numpy.round",
"pandas.DataFrame",
"sklearn.utils.resample",
"sklearn.base.clone",
"sklearn.linear_model.LogisticRegression",
"numpy.arange",
"numpy.intersect1d",
"pandas.concat",
"sklearn.model_selection.t... |
KatKiker/thor | [
"ffc8ab3fbaa8af046f531e8111907a891998d14b",
"ffc8ab3fbaa8af046f531e8111907a891998d14b",
"ffc8ab3fbaa8af046f531e8111907a891998d14b"
] | [
"thor/orbits/tests/test_lambert.py",
"thor/projections/gnomonic.py",
"thor/main.py"
] | [
"import numpy as np\nfrom astropy.time import Time\nfrom astropy import units as u\n\nfrom ...constants import Constants as c\nfrom ...testing import testOrbits\nfrom ..orbits import Orbits\nfrom ..propagate import propagateOrbits\nfrom ..lambert import calcLambert\n\nMU = c.MU\nTARGETS = [\n \"Amor\",\n \"Er... | [
[
"numpy.concatenate",
"numpy.arange"
],
[
"numpy.where",
"numpy.array",
"numpy.sin",
"numpy.cos"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.savetxt",
"pandas.DataFrame",
"numpy.stack",
"pandas.concat",
"numpy.linspace",
"numpy.meshgrid"
]
] |
cooijmanstim/magenta | [
"7e7536a1950e4cb17ad52a1154091b5f1f563aad"
] | [
"magenta/models/attention_rnn/attention_rnn_create_dataset.py"
] | [
"# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"tensorflow.app.run"
]
] |
sangeet2020/ws-20-21 | [
"316d2c1495cd540ce390eced52d41c57efed1f64"
] | [
"computational-linguistics/ass-4/main.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n# @Author: Sangeet Sagar\n# @Date: 2021-01-10 16:35:59\n# @Email: sasa00001@stud.uni-saarland.de\n# @Organization: Universität des Saarlandes\n# @Last Modified time: 2021-01-14 23:19:57\n\"\"\"\nImplementation of IBM Model 1, which is used in statistical \nmachine ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.log10"
]
] |
NubeEra-Samples/MachineLearningMaterial | [
"1a511b4af874730323b843397476d64abfe6fb9f"
] | [
"04.MLAlgoAdv/02.MLAlgoAdvance.py"
] | [
"\n# Include basic configurations\nfrom pandas import read_csv\nfrom matplotlib import pyplot\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.model_selection import StratifiedKFold\n\n# compare algorithms\nfrom sklearn.linear_model import Logi... | [
[
"sklearn.discriminant_analysis.LinearDiscriminantAnalysis",
"sklearn.model_selection.StratifiedKFold",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.title",
"matplotlib.pyplot.boxplot",
"sklearn.naive_bayes.GaussianNB",
"sklearn.svm.SVC",
"sklearn.linear_model.Logist... |
hpkeeler/posts | [
"a45c951bcccca3061276b2576e2568560f4bffdd",
"a45c951bcccca3061276b2576e2568560f4bffdd"
] | [
"PoissonTriangle/PoissonTriangle.py",
"SegmentsBoxed/SegmentsBoxed.py"
] | [
"# Simulate a Poisson point process on a triangle.\r\n# Author: H. Paul Keeler, 2018.\r\n# Website: hpaulkeeler.com\r\n# Repository: github.com/hpaulkeeler/posts\r\n# For more details, see the post:\r\n# hpaulkeeler.com/simulating-a-poisson-point-process-on-a-triangle/\r\n\r\nimport numpy as np; # NumPy package fo... | [
[
"matplotlib.pyplot.xlabel",
"numpy.random.poisson",
"matplotlib.pyplot.close",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
],
[
"matplotlib.pyplot.text",
"numpy.random.rand",
"matplotlib.pyp... |
rcchun/yolact | [
"c7b4c59aec91177dbe7fe2720e77f4df3bdde8e1"
] | [
"layers/functions/detection.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom ..box_utils import decode, jaccard, index2d\nfrom Yolact_res101.utils import timer\n\nfrom Yolact_res101.data import cfg, mask_type\n\nimport numpy as np\n\n\nclass Detect(object):\n \"\"\"At test time, Detect is the final layer of SSD. Decode location preds,... | [
[
"torch.cat",
"torch.arange",
"torch.max",
"numpy.get_include",
"torch.Tensor"
]
] |
nuhame/ml-pug | [
"be9f7c55f7d6616af5303e9350cfd8092d55440b"
] | [
"mlpug/examples/chatbot/tensorflow/original_transformer_tutorial/model_data_generation.py"
] | [
"import tensorflow as tf\n\ndef create_translation_tf_encode_func(tokenizer_pt, tokenizer_en):\n\n def encode(lang1, lang2):\n lang1 = [tokenizer_pt.vocab_size] + tokenizer_pt.encode(lang1.numpy()) + [tokenizer_pt.vocab_size + 1]\n\n lang2 = [tokenizer_en.vocab_size] + tokenizer_en.encode(lang2.num... | [
[
"tensorflow.size",
"tensorflow.py_function"
]
] |
tczhao/Deep-Forest | [
"9e75acaf13a0be0a65374323966128c95845eca5",
"9e75acaf13a0be0a65374323966128c95845eca5"
] | [
"setup.py",
"deepforest/forest.py"
] | [
"import os\nimport sys\nfrom setuptools import find_packages\nfrom numpy.distutils.core import setup\n\n\n# Project Information\nDISTNAME = \"deep-forest\"\nDESCRIPTION = \"Deep Forest\"\nwith open(\"README.rst\") as f:\n LONG_DESCRIPTION = f.read()\nMAINTAINER = \"Yi-Xuan Xu\"\nMAINTAINER_EMAIL = \"xuyx@lamda.n... | [
[
"numpy.distutils.misc_util.Configuration"
],
[
"sklearn.utils.compute_sample_weight",
"numpy.copy",
"sklearn.utils.fixes._joblib_parallel_args",
"numpy.cumsum",
"numpy.full",
"numpy.argmax",
"sklearn.base.clone",
"scipy.sparse.issparse",
"numpy.array",
"sklearn.util... |
nishantkumar1292/gaze_detection | [
"2365e59b4fe07d322afe4710a32c637aa3c102df"
] | [
"gaze_detection.py"
] | [
"import cv2\nimport math\nimport numpy as np\nimport pandas as pd\nimport urllib\nimport os\nimport requests\nimport threading\nimport redis\n\nface_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')\neyes_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')\n\ndef analyse_video(video_path, fr... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
aaronzs/metrics | [
"30019851186f2e224504ec76e87cc7f5170b7166"
] | [
"torchmetrics/image/psnr.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.tensor"
]
] |
widal001/justice40-tool | [
"356e16950f5f36909681c4d7d5ed78d1ced55baf"
] | [
"data/data-pipeline/data_pipeline/etl/sources/cdc_life_expectancy/etl.py"
] | [
"from pathlib import Path\nimport pandas as pd\n\nfrom data_pipeline.etl.base import ExtractTransformLoad\nfrom data_pipeline.utils import get_module_logger, download_file_from_url\n\nlogger = get_module_logger(__name__)\n\n\nclass CDCLifeExpectancy(ExtractTransformLoad):\n def __init__(self):\n self.FILE... | [
[
"pandas.read_csv"
]
] |
ysatapathy23/TomoEncoders | [
"6f3f8c6dd088e4df968337e33a034a42d1f6c799"
] | [
"tomo_encoders/neural_nets/autoencoders.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nclass implementations for real-time 3D feature extraction\n\n\"\"\"\nimport pandas as pd\nimport os\nimport glob\nimport numpy as np\n\n\n\nfrom tomo_encoders import *\nfrom tensorflow import keras\nfrom tomo_encoders import Patches\n\nimport tensorflow as t... | [
[
"numpy.rot90",
"tensorflow.reduce_min",
"numpy.random.choice",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.BatchNormalization",
"numpy.concatenate",
"tens... |
casey-martin/SCNIC | [
"f4596e2ebaa9b265309a052aac87f57aa75df31b"
] | [
"tests/test_module_analysis.py"
] | [
"import pytest\nfrom SCNIC.module_analysis import correls_to_cor, make_modules, collapse_modules, write_modules_to_dir, cor_to_dist, \\\n write_modules_to_file, add_modules_to_metadata\nimport os\nimport glob\nfrom biom.table import Table\nimport numpy as np\nfrom scipy.spatial.dist... | [
[
"pandas.testing.assert_frame_equal",
"numpy.array",
"scipy.spatial.distance.squareform",
"pandas.MultiIndex.from_tuples",
"numpy.allclose"
]
] |
TukisTukis/linvpy | [
"471fb8b456af3bf22ced5e8fe1ec0fbbad8a08c8",
"471fb8b456af3bf22ced5e8fe1ec0fbbad8a08c8"
] | [
"tests/regularizedtau/toolboxutilities.py",
"tests/test_final.py"
] | [
"\"\"\"\n===================================================================\nUTILITIES\nThis toolbox contains many useful functions, which are not related\nto solving the inverse problem itself.\nMarta Martinez-Camara, EPFL\n===================================================================\n\"\"\"\n\n# take the ... | [
[
"numpy.array",
"numpy.dot",
"numpy.asarray",
"numpy.zeros",
"numpy.round",
"numpy.random.permutation",
"numpy.ones",
"numpy.random.randn",
"numpy.logical_and",
"numpy.nonzero",
"numpy.sign",
"numpy.abs",
"numpy.linalg.svd",
"numpy.linspace",
"numpy.diag"... |
shwetasrsh/MOREL | [
"b9daa2a72ad8a33d46c0f87d8b1c3070f61fa784"
] | [
"baselines/common/atari_wrappers.py"
] | [
"import numpy as np\nfrom collections import deque\nimport gym\nfrom gym import spaces\n\nimport cv2\ncv2.ocl.setUseOpenCL(False)\n\nclass NoopResetEnv(gym.Wrapper):\n def __init__(self, env, noop_max=30):\n \"\"\"Sample initial states by taking random number of no-ops on reset.\n No-op is assumed ... | [
[
"numpy.concatenate",
"numpy.sign",
"numpy.array",
"numpy.zeros"
]
] |
wblong/PVGeo-Copy | [
"a7f143a037c3abddcc5b8f70f84a0dee38874bfc"
] | [
"PVGeo/ubc/general.py"
] | [
"__all__ = [\n 'TopoReader',\n 'GravObsReader',\n 'GravGradReader',\n 'MagObsReader',\n 'GeologyMapper',\n]\n\n__displayname__ = 'General Tools'\n\nimport numpy as np\nimport pandas as pd\nimport vtk\nfrom vtk.numpy_interface import dataset_adapter as dsa\n\nfrom .. import _helpers, interface\nfrom .... | [
[
"numpy.deg2rad",
"pandas.read_csv"
]
] |
lindagaw/Emotion-Detection | [
"7431984fb5ab45abe3b793e314c3c15b747d2226"
] | [
"Digit_Classification/DFAENT/main.py"
] | [
"from __future__ import print_function\nimport argparse\nimport torch\nfrom solver import Solver\nimport os\n\n# Training settings\nparser = argparse.ArgumentParser(description='PyTorch MCD Implementation')\nparser.add_argument('--all_use', type=str, default='no', metavar='N',\n help='use all tra... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"torch.cuda.manual_seed"
]
] |
Frank-gh/simchain | [
"4dec42b6039730e4dcc0068209dd90200ee6b3d3"
] | [
"simchain/lbc/lyus.py"
] | [
"import numpy as np\nimport hashlib\nfrom . import utils\nfrom math import exp,sqrt\n\nclass SigningKey:\n\n def __init__(self,d,n,m,k,q,sigma,b):\n self.d,self.n,self.m,self.k,self.q,self.b = d,n,m,k,q,b\n self.sigma = sigma\n self._is_pubkey_generate = False\n\n @classmethod\n def fr... | [
[
"numpy.allclose",
"numpy.dot",
"numpy.random.rand",
"numpy.linalg.norm"
]
] |
DanielLin94144/End-to-End-jointCTC-Attention-ASR | [
"2b8900f1f397d65d0e86972f7379bb3dfeb7c4ea"
] | [
"main.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\nimport yaml\nimport torch\nimport argparse\nimport numpy as np\n\n# For reproducibility, comment these may speed up training\ntorch.backends.cudnn.deterministic = True\ntorch.backends.cudnn.benchmark = False\n\n# Arguments\nparser = argparse.ArgumentParser(description='Train... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all"
]
] |
royerloic/aydin | [
"f9c61a24030891d008c318b250da5faec69fcd7d",
"f9c61a24030891d008c318b250da5faec69fcd7d"
] | [
"aydin/analysis/blind_spot_analysis.py",
"aydin/it/demo/n2s/linear/2D_generic.py"
] | [
"from typing import Tuple, List\n\nimport numpy\nimport scipy\nfrom numpy import argmax, unravel_index\nfrom numpy.linalg import norm\nfrom scipy.ndimage import gaussian_filter\n\nfrom aydin.util.crop.rep_crop import representative_crop\n\n\ndef auto_detect_blindspots(\n image,\n batch_axes: Tuple[bool] = Non... | [
[
"numpy.max",
"numpy.array",
"numpy.ndenumerate",
"numpy.linalg.norm",
"numpy.reshape",
"scipy.fft.ifftn",
"numpy.isnan",
"scipy.ndimage.gaussian_filter",
"numpy.mean",
"numpy.argmax",
"numpy.ma.conjugate",
"scipy.fft.fftn",
"numpy.var"
],
[
"matplotlib.p... |
pranathivemuri/napari | [
"7a7f824b686a276dc6cdc8013d8f437e3c3b03e1"
] | [
"napari/_vispy/vispy_shapes_layer.py"
] | [
"import numpy as np\nfrom vispy.scene.visuals import Compound, Line, Markers, Mesh, Text\n\nfrom ..utils.events import disconnect_events\nfrom ..utils.settings import get_settings\nfrom ._text_utils import update_text\nfrom .vispy_base_layer import VispyBaseLayer\n\n\nclass VispyShapesLayer(VispyBaseLayer):\n de... | [
[
"numpy.pad",
"numpy.array",
"numpy.zeros"
]
] |
animit-kulkarni/image-captioning-tensorflow | [
"68828c593bce1746cc2cb9b53ce3ddf4a10d1e11"
] | [
"experimentation/utils.py"
] | [
"import numpy as np\nimport os\nimport json\nimport collections\nimport cv2\nimport tensorflow as tf\n\nfrom config import CONFIG\nCONFIG = CONFIG()\n#from prepare_img_features import model_config_dict\n\nmodel_config_dict = {'mobilenet_v2': {'model': tf.keras.applications.MobileNetV2,\n ... | [
[
"tensorflow.keras.applications.imagenet_utils.preprocess_input",
"numpy.random.seed",
"tensorflow.io.read_file",
"numpy.load",
"numpy.random.shuffle",
"tensorflow.image.resize",
"tensorflow.image.decode_jpeg"
]
] |
DylanTao94/PyTorch-StudioGAN | [
"880653d5d5f1fa21d428d39ca1c001548d5c2196",
"880653d5d5f1fa21d428d39ca1c001548d5c2196"
] | [
"src/models/big_resnet.py",
"src/metrics/F_beta.py"
] | [
"# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN\n# The MIT License (MIT)\n# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details\n\n# models/big_resnet.py\n\n\nfrom utils.model_ops import *\nfrom utils.misc import *\n\nimport torch\nimport torch.nn as nn\... | [
[
"torch.nn.functional.normalize",
"torch.cat",
"torch.cuda.amp.autocast",
"torch.nn.ModuleList",
"torch.nn.ELU",
"torch.nn.Tanh",
"torch.nn.functional.interpolate",
"torch.split",
"torch.nn.AvgPool2d",
"torch.nn.LeakyReLU",
"torch.nn.ReLU",
"torch.nn.GELU",
"torc... |
Anonymous160609/Agent_based_Model_GEOG5990 | [
"53dca09bd85403fb8a6e3b7b5d51fdd203e68f69"
] | [
"old_version/model_9.1.py"
] | [
"import tkinter\nimport matplotlib\nmatplotlib.use('TkAgg') \nimport random\nimport operator \nimport matplotlib.pyplot\nimport csv\nimport time\nimport agentframework\nimport importlib\nimportlib.reload(agentframework)\n\nstart = time.process_time()\n\n#read txt as 2d list via csv\nenvironment = []\ncoords = open(... | [
[
"matplotlib.use",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.pyplot.scatter"
]
] |
SimonScapan/nlp-song-recommendation | [
"181f0bdc45bdd4309f60391530cd85af7fc264d6"
] | [
"firebaseimporter.py"
] | [
"import pandas as pd\nimport requests\ndata = pd.read_pickle(\"../master_music_data.pkl\")\ndata.dropna()\ndata = data.fillna(0)\ndata.columns = map(str.lower, data.columns)\n\ncounter=0\nfor index, row in data.iterrows():\n row_dict = row.to_dict()\n response_status = requests.post(url=\"https://murat-db-20-... | [
[
"pandas.read_pickle"
]
] |
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection | [
"ff313150035935c2c81167291ed82b7f13064f05"
] | [
"src/gans/gan_loss.py"
] | [
"# This script is borrowed from https://github.com/LynnHo/DCGAN-LSGAN-WGAN-GP-DRAGAN-Pytorch \n# which is also used by Durall et al. (https://ieeexplore.ieee.org/document/9157579)\n\nimport torch\n\ndef get_gan_losses_fn():\n bce = torch.nn.BCEWithLogitsLoss()\n\n def d_loss_fn(r_logit, f_logit):\n r_l... | [
[
"torch.zeros_like",
"torch.ones_like",
"torch.nn.MSELoss",
"torch.nn.BCEWithLogitsLoss"
]
] |
CogComp/stat-analysis-experiments | [
"f4662d2c6ae4f7f549c9bb8fe8d49f3a786af4f3"
] | [
"sacrerouge/metrics/blanc.py"
] | [
"import argparse\nimport numpy as np\nimport random\nfrom overrides import overrides\nfrom typing import List, Union\n\nfrom sacrerouge.commands import MetricSetupSubcommand\nfrom sacrerouge.data import MetricsDict\nfrom sacrerouge.data.types import DocumentType, SummaryType\nfrom sacrerouge.metrics import Document... | [
[
"numpy.random.seed",
"torch.manual_seed"
]
] |
EthanHolleman/GLOE-reps | [
"196e98eb8cf5fb591ae02b5e999d3562c46b81c2"
] | [
"scripts/intersection_to_metabed.py"
] | [
"import argparse\nimport os\nimport pandas as pd\nimport multiprocessing as mp\nimport math\n\n\nDESCRIP = '''\nCreate a metabed (bed) file that describes the amount of signal in a given\npercentage of a gene body. Created for data processsing for metaplots.\nShould supply an intersected bed file containing genes (... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
]
] |
tnkarthik/stock_analysis | [
"1b91469908bc7cfe9f5ed838540f5e5c67566f37"
] | [
"src/plotting/plots.py"
] | [
"import sys\nimport datetime as dt\nsys.path.append(\"..\")\n\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport pandas as pd\n\nfrom plotly.graph_objs import Scatter, Table\nfrom src.stock import stock\n\ndef trace(x, y, name, mode, line_color, fill = None, fillcolor = None):\n trace = \\\n ... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.polyfit"
]
] |
SciKit-Surgery/scikit-surgeryimage | [
"a51d2ff5a612a0918ae22000239c95c472ff4edf"
] | [
"tests/acquire/stereo_video/test_stereo_video.py"
] | [
"# coding=utf-8\n\nimport numpy as np\nimport cv2\nimport pytest\nimport sksurgeryimage.acquire.stereo_video as sv\nfrom sksurgeryimage.utilities.utilities import are_similar\n\n\ndef test_create_video_from_png():\n original = cv2.imread('tests/data/processing/test-16x8-rgb.png')\n output_name = 'tests/output... | [
[
"numpy.testing.assert_array_equal",
"numpy.ones"
]
] |
DKandrew/pytorch-lightning | [
"1f8ff7c48c1b173928f5dcd652a81d1c4a7ab273"
] | [
"tests/base/models.py"
] | [
"from collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nfrom tests.base.datasets import TrialMNIST, AverageDataset, MNIST\n\ntry:\n from test_tube import HyperOptArgumentParser\nexcept ImportError... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.Sigmoid",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.functional.mse_loss",
"torch.nn.functional.cross_entropy",
"torch.nn.BatchNorm1d",
"numpy.prod",
"torch.tanh",
"torch.randn... |
DimitraKaitalidou/Python | [
"e1117ebf50b93630a1e1e16f03fd032db0a9e81c"
] | [
"DeepCLL/TSNEOnActivations.py"
] | [
"# Copyright 2020, Dimitra S. Kaitalidou, All rights reserved\n\nfrom time import time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport create_gif as gif\n\nfrom xlrd import open_workbook\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom sklearn import manifold\nplt.rcParams[\"font.family\"] = \"Times New ... | [
[
"numpy.zeros",
"matplotlib.pyplot.title",
"numpy.load",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.axis"
]
] |
ishine/neuralfp | [
"a9327b82b7160e63d8bb07c6f17cdeb90e29e271"
] | [
"neuralfp/modules/transformations.py"
] | [
"from audiomentations import Compose,Shift,PitchShift,TimeStretch,AddImpulseResponse,FrequencyMask,TimeMask,ClippingDistortion,AddBackgroundNoise,Gain\nimport numpy as np\nimport os\nimport random\nimport librosa\n\nclass TransformNeuralfp:\n \n def __init__(self, ir_dir, noise_dir, sample_rate):\n sel... | [
[
"numpy.multiply",
"numpy.fft.fft",
"numpy.abs"
]
] |
sathiscode/trumania | [
"bcf21c4f9e1ff0fe03fd9cbe2dc367f0df033fbc"
] | [
"tests/unit_tests/test_populations.py"
] | [
"import path\nimport pandas as pd\nimport os\nimport pytest\n\nfrom trumania.core.random_generators import SequencialGenerator\nfrom trumania.core.population import Population\n\ndummy_population = Population(circus=None,\n size=10,\n ids_gen=SequencialGener... | [
[
"pandas.DataFrame"
]
] |
myann/deeplearning-chf | [
"1427cd8579a18ada6c8d1c99736143eac32ff38f"
] | [
"nn_sparse.py"
] | [
"import pickle as pk\nimport numpy as np\nimport tensorflow as tf\nimport argparse\n\nfrom keras.layers import Input, Dense\nfrom keras.models import Model\n\nfrom gensim.corpora import Dictionary\n\nif __name__ == '__main__':\n\n # Read command-line arguments\n parser = argparse.ArgumentParser(description='G... | [
[
"numpy.reshape",
"numpy.zeros"
]
] |
ischubert/ryenv | [
"e60758f90935bdd9ed6ec3defa1298bf89cb368b"
] | [
"ryenv/ryenv.py"
] | [
"\"\"\"\nCollection of environment classes that are based on rai-python\n\"\"\"\nimport sys\nimport os\nimport time\nimport tqdm\nimport numpy as np\nimport matplotlib.pyplot as plt\nsys.path.append(os.getenv(\"HOME\") + '/git/rai-python/rai/rai/ry')\n\nif os.getenv(\"HOME\") + '/git/rai-python/rai/rai/ry' in sys.p... | [
[
"numpy.array",
"numpy.clip",
"matplotlib.pyplot.xlim",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.sin",
"numpy.random.rand",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"numpy.sum",
"numpy.split",
"numpy.isnan",
"numpy.ab... |
Jittor/Jittor | [
"bc945bae94bded917214b0afe12be6bf5b919dbe",
"bc945bae94bded917214b0afe12be6bf5b919dbe",
"bc945bae94bded917214b0afe12be6bf5b919dbe"
] | [
"python/jittor/test/test_reindex_reduce_op.py",
"python/jittor/test/test_unary_op.py",
"python/jittor/test/test_arg_reduce_op.py"
] | [
"# ***************************************************************\n# Copyright (c) 2022 Jittor. All Rights Reserved. \n# Maintainers: Dun Liang <randonlang@gmail.com>. \n# This file is subject to the terms and conditions defined in\n# file 'LICENSE.txt', which is part of this source code package.\n# **************... | [
[
"numpy.zeros",
"numpy.minimum",
"numpy.float64",
"numpy.allclose",
"numpy.maximum"
],
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.isnan",
"numpy.exp",
"numpy.allclose",
"scipy.special.erfinv",
"numpy.arange",
"numpy.linspace"
],
[
"numpy... |
char-lie/feasible_directions | [
"a23d45294efbbc3ff9736eb86395eb64e7d107bc"
] | [
"src/HimmelblauFunction.py"
] | [
"import numpy\n\nfrom AbstractFunction import AbstractFunction\nfrom SimpleConstraints import SimpleConstraints\n\nclass HimmelblauFunction(AbstractFunction):\n\n def __init__(self, start_point=[0, 0]):\n self.start_point = start_point\n self.constraints = SimpleConstraints([-6, -6], [6, 6])\n\n def get_sta... | [
[
"numpy.meshgrid",
"numpy.arange"
]
] |
alexandrebarachant/WMFT_JBHI | [
"47da8b27504bd9e851c21537d29e623796d928a7"
] | [
"utils.py"
] | [
"\"\"\"\nUtils functions.\n\"\"\"\n\nimport numpy as np\nfrom glob import glob\nimport re\nimport pandas as pd\nimport seaborn as sns\nfrom pylab import plt\n\nfrom pyriemann.utils.covariance import _lwf\nfrom numpy import ones, kron, mean, eye, hstack, dot, tile\nfrom scipy.linalg import pinv\n\nfrom sklearn.metri... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.metrics.confusion_matrix",
"numpy.dot",
"numpy.asarray",
"pandas.DataFrame",
"numpy.set_printoptions",
"numpy.ones",
"numpy.mean",
"numpy.eye",
"numpy.argmax",
"numpy.argsort",
"numpy.fromfile",
"numpy.hstack"
]... |
janifer112x/incubator-tvm | [
"98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6",
"98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6",
"98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6"
] | [
"python/tvm/topi/testing/adaptive_pool_python.py",
"tests/python/unittest/test_target_codegen_extern.py",
"apps/topi_recipe/conv/depthwise_conv2d_test.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.ceil",
"numpy.zeros",
"numpy.floor"
],
[
"numpy.random.uniform",
"numpy.zeros"
],
[
"numpy.random.uniform",
"numpy.maximum"
]
] |
vedantdave77/project.sentiment-analytic-sagemaker-deployment | [
"0132c7c1b06f6f253dc77162f5672cb0fc934406"
] | [
"train/train.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n print(\"Loading model...\")\n\n # First, load the paramete... | [
[
"torch.save",
"torch.from_numpy",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.BCELoss",
"torch.utils.data.TensorDataset"
]
] |
gergia/demo2program | [
"0cf36ab128a955d8cac9047ce2c5f5286279a44f"
] | [
"karel_env/tool/eval_execution.py"
] | [
"\"\"\"\nEval Execution\n\nExecute output programs and then check execution accuracy and syntax accuracy.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n\nimport argparse\nimport collections\nimport h5py\nimport os\nimport numpy as np\nfrom... | [
[
"numpy.all",
"numpy.array",
"numpy.stack"
]
] |
Azharuddin14/ga-learner-dsmp-repo | [
"d4e3166caa9e937f7324fe1b72615e1808e8170b"
] | [
"Topic-modelling-with-news-headlines/code.py"
] | [
"# --------------\n# import libraries\nimport numpy as np\nimport pandas as pd\nimport re\n\n# Load data\ndata = pd.read_csv(path, parse_dates=[0], infer_datetime_format=True)\n\n# Sort headlines by date of publish\ndata.sort_values('publish_date', inplace=True)\n\n# Retain only alphabets\ndata['headline_text'].app... | [
[
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"sklearn.feature_extraction.text.CountVectorizer",
"matplotlib.pyplot.ylabel",
"sklearn.decomposition.TruncatedSVD",
"pandas.... |
taishi-i/toiro | [
"9d37c39ca8b144646c4a977a3d49c28784db5404"
] | [
"toiro/classifiers/classifier_svm.py"
] | [
"import time\nimport pickle\n\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import f1_score\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import classification_report\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\n\nfrom toiro import tokenizers\nfrom toiro import clas... | [
[
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.f1_score",
"sklearn.svm.LinearSVC"
]
] |
kichel98/pi-darts | [
"f22caa048214dd2a09392d736dd5a2bf52023ae6"
] | [
"rpi/src/triangulation.py"
] | [
"import math\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\n\nimport numpy as np\nfrom camera import CameraConfig\n\n\n@dataclass\nclass TriangulationConfig(object):\n \"\"\"\n Class designed to produce config triangulation object.\n\n Arguments:\n down_cam_conf... | [
[
"numpy.roots"
]
] |
wilsonmdrs/machine_learning | [
"ba36f7f9c99c4d9f2d662828fb299074fd4e33d4"
] | [
"modules/extracao_de_caracteristicas.py"
] | [
"# Pillow para manipulação de imagem\nfrom PIL import Image\n## import Matplotlib\nimport matplotlib.pyplot as pp\n\n\nclass Extract:\n\n def __init__(self):\n pass\n\n @staticmethod\n def extract_feature(img, show):\n\n # características de extração\n\n character_one_feature_one = 0 #... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
kairosfuture/umap | [
"8b03c48709d132bceb714635604ac782258d3456"
] | [
"umap/tests/test_composite_models.py"
] | [
"from umap import UMAP\nfrom sklearn.datasets import make_blobs\nfrom nose.tools import assert_greater_equal\nfrom nose import SkipTest\nimport pytest\nimport numpy as np\n\ntry:\n # works for sklearn>=0.22\n from sklearn.manifold import trustworthiness\nexcept ImportError:\n # this is to comply with requi... | [
[
"sklearn.manifold.t_sne.trustworthiness"
]
] |
LokeshBonta/MIVisionX | [
"980d4254b8a1b50e09cc19d41f3cbf362f8a93db"
] | [
"rali/python/rali.py"
] | [
"# Copyright (c) 2018 - 2020 Advanced Micro Devices, Inc. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation th... | [
[
"numpy.ascontiguousarray",
"numpy.frombuffer"
]
] |
ProRail-DataLab/openspoor | [
"548c7ffc12a5a97459bafe5327aa9b0d0546537c"
] | [
"openspoor/mapservices/find_mapservice.py"
] | [
"import requests\nimport pandas as pd\nimport re\n\n\nclass FeatureServerOverview:\n \"\"\"\n Class used to find all the available featureservers in mapservices.\n This can be used to navigate the API through python, allowing some more efficient searching.\n \"\"\"\n def __init__(self):\n self... | [
[
"pandas.DataFrame"
]
] |
pdeperth/adaptation-of-non-stationary-texture-expansion | [
"b0dddac07af8ce82e316f6d8b635bc5a3b2f3816"
] | [
"input_GAN/main.py"
] | [
"from __future__ import print_function\nimport argparse\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nimport torchvision.datasets as dset\nimport torchvision.transforms as transforms\nimport ... | [
[
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load"
]
] |
trelau/pyNURBS | [
"5dfd082fe368c1140ce485dc64b049b32c267d1f"
] | [
"pynurbs/geometry/methods/parameterize.py"
] | [
"from __future__ import division\n\nfrom numpy import zeros, float64, diff, sum, array\nfrom numpy.linalg import norm\n\nfrom pynurbs.geometry.point import Point\n\n\ndef uniform(pnts, a=0., b=1.):\n \"\"\"\n Generate a uniform parameters.\n\n :param pnts: 1D set of ordered points.\n :etype pnts: Points... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.diff"
]
] |
cparks1000000/region_and_boundary | [
"4181b688ba4b4ed010566293a477ce6f9683f7e6"
] | [
"lib/model.py"
] | [
"from typing import Union, List, Tuple, Callable\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\n\nimport numpy as np\n\ndef get_gaussian_kernel(k=3, mu=0, sigma=3, normalize=True):\n # compute 1 dimension gaussian\n gaussian_1D = np.linspace(-1, 1, k)\n # compute a grid distance from cen... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"numpy.sum",
"torch.nn.BatchNorm2d",
"numpy.exp",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"numpy.linspace",
"numpy.meshgrid"
]
] |
suetAndTie/alpha234 | [
"8ae211c309726740c4486a0f2143cd1149d343d4"
] | [
"games/gobang/GobangGame.py"
] | [
"from __future__ import print_function\nimport sys\n\nfrom Game import Game\nfrom .GobangLogic import Board\nimport numpy as np\n\n\nclass GobangGame(Game):\n def __init__(self, n=15, nir=5):\n self.n = n\n self.n_in_row = nir\n\n def getInitBoard(self):\n # return initial board (numpy bo... | [
[
"numpy.rot90",
"numpy.array",
"numpy.reshape",
"numpy.copy",
"numpy.fliplr"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.