repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
fxia22/kdnet.pytorch | [
"dacb7163d971bcfe67731502d6f733122281a600"
] | [
"datasets.py"
] | [
"from __future__ import print_function\nimport torch.utils.data as data\nfrom PIL import Image\nimport os\nimport os.path\nimport errno\nimport torch\nimport json\nimport codecs\nimport numpy as np\nimport progressbar\nimport sys\nimport torchvision.transforms as transforms\nimport argparse\nimport json\n\n\nclass ... | [
[
"numpy.expand_dims",
"numpy.mean",
"numpy.random.rand",
"numpy.array",
"numpy.sum",
"numpy.loadtxt"
]
] |
elmontana/EPA-Inspection-Prioritization | [
"65d8129e215d90a0d22e81d39f3bd90b182ae27a"
] | [
"src/train/train.py"
] | [
"import importlib\nimport itertools\nimport numpy as np\nimport os\nimport pickle\nimport tqdm\n\nfrom itertools import repeat\nfrom multiprocessing import Pool\nfrom pathlib import Path\n\nfrom ..models.wrappers import SKLearnWrapper\nfrom ..utils.data_utils import get_data\n\n\n\ndef create_model(model_class_name... | [
[
"numpy.logical_or"
]
] |
mjjimenez/kdd_air_quality_forecasting | [
"c7b678c2d30555c8ddb778381631a25e88d81fdd"
] | [
"src/features/add_datepart.py"
] | [
"# -*- coding: utf-8 -*-\nimport click\nimport logging\nfrom pathlib import Path\nfrom dotenv import find_dotenv, load_dotenv\nimport pandas as pd\nimport numpy as np\nimport re\n\n# From fast.ai 0.7\ndef add_datepart(df, fldname, drop=True, time=False):\n \"Helper function that adds columns relevant to a date.\... | [
[
"numpy.issubdtype",
"pandas.to_datetime",
"pandas.read_feather"
]
] |
eeedayu/faster-rcnn-pytorch | [
"5fe662ef75fd2a3fdfb63bf4ecad2c2a0b20f252"
] | [
"nets/resnet50.py"
] | [
"import math\r\n\r\nimport torch.nn as nn\r\nfrom torchvision.models.utils import load_state_dict_from_url\r\n\r\n\r\nclass Bottleneck(nn.Module):\r\n expansion = 4\r\n def __init__(self, inplanes, planes, stride=1, downsample=None):\r\n super(Bottleneck, self).__init__()\r\n self.conv1 = nn.Con... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
LamChob/Global-Memory-Tracing | [
"a6749af3aaec9ca6d1e1b1bcd71c1db097909804"
] | [
"memtrace-pass/post-processing/histogram.py"
] | [
"import os\nimport sys\nimport struct\nimport pprint\nimport matplotlib.pyplot as plt\nimport pickle\nimport math\nimport time\nimport numpy as np\nfrom TraceInc import AutoDict\n\n\ndef timer():\n now = time.time()\n return now\n\ndef create_bins(tmap):\n histogram =[]\n for sk in tmap.values():\n ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel"
]
] |
interxuxing/deepnet | [
"f4e4ff207923e01552c96038a1e2c29eb5d16160"
] | [
"deepnet/examples/multimodal_dbn/collect_dbn_reps.py"
] | [
"\"\"\"Collects Multimodal-DBN representations.\nThis script combines representations created for all inputs, whether missing\ntext or not in one place to be used for classification/retrieval.\n\"\"\"\nimport numpy as np\nimport sys\nimport os\nfrom deepnet import deepnet_pb2\nfrom deepnet import util\nimport glob\... | [
[
"numpy.concatenate",
"numpy.load",
"numpy.zeros",
"numpy.save"
]
] |
taylorfturner/great_expectations | [
"e4964894fb97b933cac713ef1f1a78e33d362ff3"
] | [
"tests/checkpoint/test_simple_checkpoint.py"
] | [
"import os\nfrom typing import Union\n\nimport pandas as pd\nimport pytest\n\nimport great_expectations.exceptions as ge_exceptions\nfrom great_expectations import DataContext\nfrom great_expectations.checkpoint import SimpleCheckpointConfigurator\nfrom great_expectations.checkpoint.checkpoint import (\n Checkpo... | [
[
"pandas.DataFrame"
]
] |
Ida-Ida/hecktor-2020 | [
"d03b9f546a19db5e5514da9d5a6cdfd40abba729"
] | [
"src/layers.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass BasicConv3d(nn.Module):\n def __init__(self, in_channels, out_channels, **kwargs):\n super(BasicConv3d, self).__init__()\n self.conv = nn.Conv3d(in_channels, out_channels, bias=False, **kwargs)\n self.norm =... | [
[
"torch.nn.Conv3d",
"torch.nn.functional.relu",
"torch.nn.InstanceNorm3d",
"torch.nn.functional.interpolate"
]
] |
helene-t/SciDataTool | [
"4374ee2c1a55421af614aac00ba5ac7cf3db1144"
] | [
"SciDataTool/Functions/symmetries.py"
] | [
"# -*- coding: utf-8 -*-\nfrom numpy import tile, concatenate, negative, ones\n\n\ndef rebuild_symmetries(values, axis_index, symmetries):\n \"\"\"Reconstructs the field of a Data object taking symmetries into account\n Parameters\n ----------\n values: ndarray\n ndarray of a field\n axis_inde... | [
[
"numpy.concatenate",
"numpy.negative",
"numpy.tile"
]
] |
Elnura/MultiplePedestrianDetection_CNN | [
"736a15e011699560bd07a060e1c5a08174004c63"
] | [
"detection/yolov4/detection/algorithm_yolov4_tiny.py"
] | [
"#! /usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nRun a YOLO_v3 style detection model on test images.\r\n\"\"\"\r\n\r\nimport colorsys\r\nimport os\r\nfrom os.path import join, dirname, realpath\r\nimport numpy as np\r\nfrom keras import backend as K\r\nfrom keras.models import load_model\r\nfrom kera... | [
[
"numpy.random.shuffle",
"numpy.array",
"numpy.expand_dims",
"numpy.random.seed"
]
] |
TUTElectromechanics/spline-fit-py | [
"38139f46b935a1d086ab397adbbf29decb7fb99f"
] | [
"util/plot.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"Utility functions for plotting.\n\nCreated on Fri Mar 24 14:27:16 2017\n\n@author: jje\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport mpl_toolkits.mplot3d.axes3d\n\ndef plot_wireframe( data, legend_label=\"_nolabel_\", figno=None ):\n \"\"\"Make and lab... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.figure"
]
] |
HongleiXie/MLFromScratch | [
"0e51f4b7566fcc4387bb7d940239bdbf9739b842"
] | [
"MLP.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nimport matplotlib.pyplot as plt\n\n\"\"\"\nImplement the MLP from scratch, used to solve for the fashion-mnist classification problem\n\"\"\"\n\ndef load_data_fashion_mnist(batch_size):\n\n mnist_train, mnist_test = keras.datasets.fashion_mnist.load_data()\... | [
[
"tensorflow.keras.datasets.fashion_mnist.load_data",
"tensorflow.matmul",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.reshape",
"tensorflow.cast",
"matplotlib.pyplot.subplots",
"tensorflow.expand_dims",
"tensorflow.GradientTape",
"tensorflow.losses.sparse_categ... |
boringlee24/sevir_challenges | [
"be5e42795246f791932ada2c7a92e18df0b5d8b7"
] | [
"experiments/train.py"
] | [
"import sys\nsys.path.append('..') # Add src to path\nimport os\nos.environ[\"HDF5_USE_FILE_LOCKING\"]='FALSE'\nimport datetime\nimport h5py\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom src.display import get_cmap\nfrom src.utils import make_log_dir\n# com... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.use",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"tensorflow.keras.callbacks.TensorBoard"
]
] |
unanan/setk | [
"e1248c6d40806c3fff251f3971a585c6ec09d949"
] | [
"scripts/sptk/libs/ns.py"
] | [
"#!/usr/bin/env python\n\n# wujian@2020\n\nimport numpy as np\nimport scipy.signal as ss\nimport scipy.integrate as si\n\n\nclass MCRA(object):\n \"\"\"\n OM-LSA (Optimally Modified Log-Spectral Amplitude Estimator) with MCRA\n Reference:\n 1) Cohen I, Berdugo B. Speech enhancement for non-stationar... | [
[
"numpy.convolve",
"numpy.maximum",
"numpy.abs",
"scipy.signal.get_window",
"numpy.minimum",
"numpy.min",
"numpy.stack",
"numpy.ones",
"numpy.vectorize",
"numpy.mean",
"numpy.log10",
"numpy.exp",
"numpy.logical_and",
"numpy.zeros"
]
] |
GLaDOS-root/chatviz | [
"439802be808320476c2db98c31935c8de87e86bf"
] | [
"src/data_parser.py"
] | [
"import helperfunctions\nimport importer\nimport numpy as np\nimport re \nimport pandas as pd\n#segregate raw .txt file into a nested dict structure with JSON-like referencing\ndef parse_chat(chat):\n arr = []\n for lines in chat.readlines():\n if(re.search(\"([0-9]{1,}\\/[0-9]{1,}\\/[0-9]{1,}\\, [0-9]... | [
[
"numpy.asarray",
"pandas.DataFrame"
]
] |
SDGraph/Hacktoberfest2k21 | [
"8f8aead15afa10ea12e1b23ece515a10a882de28"
] | [
"Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/ML/1_linear_reg/linearReg.py"
] | [
"# Data Preprocessing Template\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Data.csv')\n\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, 3].values\n\n# Splitting the dataset into the Training set and T... | [
[
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
Diffblue-benchmarks/WeBankFinTech-FATE | [
"7f4a3e7ca50f24e49090e6c117bfabd1785603f2"
] | [
"federatedml/logistic_regression/hetero_logistic_regression/hetero_lr_guest.py"
] | [
"#\n# Copyright 2019 The FATE Authors. 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 r... | [
[
"numpy.square"
]
] |
hongfz16/HCMoCo | [
"140968c66b72034ee2dff610a69be464d8e5866b"
] | [
"A2J/hrnet/official_hrnet.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Ke Sun (sunk@mail.ustc.edu.cn)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\nfr... | [
[
"torch.nn.Sequential",
"torch.load",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.ReLU"
]
] |
IndyMPO/IndyGeoprocessingTools | [
"968f9befc37252e065e8d8085c0d10f17a871152"
] | [
"AccessibilityCalculator/AccessibilityCalculator.py"
] | [
"#This script copyright 2017 Indianapolis Metropolitan Planning Organization\nimport arcpy\nimport numpy as np\n\n#Read in parameters\nauto_skim_file = arcpy.GetParameterAsText(0)\ntransit_skim_file = arcpy.GetParameterAsText(1)\nauto_time_threshold = arcpy.GetParameter(2)\nauto_function_decay = arcpy.GetParameter(... | [
[
"numpy.empty_like",
"numpy.power",
"numpy.genfromtxt"
]
] |
JCSDA/MAOOAM | [
"aadb43bc6ca2245ab79b9f8278e598ca975c94a4"
] | [
"nuopc/test/plot_evol.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nndim = 36\n\n# Read in data\n\n#(a) add single coupled model (black)\ninfile='../SingleModelProto/evol_field.dat'\nwith open(infile, 'r') as f:\n x0 = f.read().splitlines()\n\nS0 = np.zeros((len(x0),ndim))\nfor i,s0 in enumerate(x0):\n s0_ = s0.split()\n s ... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
uber/orb | [
"b329326b8fd9382310645927846315714386de50"
] | [
"orbit/utils/kernels.py"
] | [
"import numpy as np\n\n\ndef reduce_by_max(x, n=2):\n out = x.copy()\n out[np.argsort(x)[:-n]] = 0\n return out\n\n\n# Gaussian-Kernel\n# https://en.wikipedia.org/wiki/Kernel_smoother\ndef gauss_kernel(x, x_i, rho=0.1, alpha=1.0, n_reduce=-1, point_to_flatten=1):\n \"\"\"\n Parameters\n ----------... | [
[
"numpy.apply_along_axis",
"numpy.where",
"numpy.exp",
"numpy.argsort",
"numpy.logical_and",
"numpy.zeros",
"numpy.sum"
]
] |
yiqian-wang/eyepy | [
"0523e8cea78c23a9c1bcf2d5b47a8f0fb59712e5"
] | [
"eyepy/core/eyedata.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom eyepy import config\nfrom skimage.transform._geometric import GeometricTransform\n\n\nclass EyeData:\n def __init__(\n self,\n volume: \"EyeVolume\",\n localizer: \"EyeEnface\",\n transformation: GeometricTransform,\n ):\n ... | [
[
"numpy.sum"
]
] |
lipucky/nlp-gym | [
"d6d0175f038a777f0ed07586053e89fa9b1b6d2d"
] | [
"nlp_gym/envs/multi_label/featurizer.py"
] | [
"import re\nimport string\nfrom typing import List, Union\n\nimport flair\nimport torch\nfrom flair.data import Sentence\nfrom flair.embeddings import (BytePairEmbeddings, DocumentPoolEmbeddings,\n Embeddings, WordEmbeddings)\nfrom nltk import SnowballStemmer\nfrom nltk.corpus import st... | [
[
"torch.device",
"torch.cat"
]
] |
PrajaktaSathe/HacktoberFest2020 | [
"e84fc7a513afe3dd75c7c28db1866d7f5e6a8147"
] | [
"Machine_Learning/KNN.py"
] | [
"import math\r\n\r\n\r\ndef EDistance(Instace1, Instance2, length):\r\n Distance = 0\r\n for i in range(length):\r\n Distance += pow((Instace1[i] - Instance2[i]), 2)\r\n return math.sqrt(Distance)\r\n\r\n\r\ndef getNeighbour(trainingfeature, trainingLabel, testInstance, k):\r\n if k > len(trainin... | [
[
"sklearn.datasets.load_iris",
"sklearn.model_selection.train_test_split"
]
] |
anthony-walker/me499 | [
"1ec5761a822956b4e18f83b3e0cda93715b74b3e"
] | [
"cacheing/fibonacci.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\" This script illustrates the following concepts:\n Caching - how to save calculations in a variable to speed up computation\n Timing comparisons - how to use time() to figure out how long\n a computation took\n Try-except to catch parameter errors and to dete... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
zloben69/DBGLOGReader | [
"62d3fd2090f86be5aaa49856911941246ea4818f"
] | [
"DBGLOGReader.py"
] | [
"import struct, binascii, os, time\nimport pandas as pd\n# import numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nFloat = os.getcwd() + '/log/2018 01 22 0000 (Float).DAT'\n\ndef Get_tag_names():\n Tagname = Float[0:-11]+'(Tagname).DAT'\n try:\n with open(Tagname, 'r') as fi:\n fi.read(10)... | [
[
"matplotlib.pyplot.show",
"pandas.Timestamp"
]
] |
lyndonchan/wsss-analysis | [
"75d534894a1c9e033c43346d63de27d83c95cd1e"
] | [
"scripts/extract_eval.py"
] | [
"import os\nimport pandas as pd\nimport numpy as np\n\nSETS = ['ADP-morph_tuning_VGG16', 'ADP-morph_tuning_X1.7', 'ADP-morph_segtest_VGG16', 'ADP-morph_segtest_X1.7',\n 'ADP-func_tuning_VGG16', 'ADP-func_tuning_X1.7', 'ADP-func_segtest_VGG16', 'ADP-func_segtest_X1.7',\n 'VOC2012_VGG16', 'VOC2012_M7',\... | [
[
"pandas.set_option",
"pandas.read_excel",
"pandas.DataFrame"
]
] |
drgriffis/ctakes-utils | [
"d5da557ee68918fc33326a029f37a24d39acb10a"
] | [
"python/ctakes/format/common.py"
] | [
"'''\nShared methods for cTAKES output file format processing.\n\nNot included in from ctakes.format import *\n'''\n\nimport re\nimport codecs\nimport numpy as np\nfrom bs4 import BeautifulSoup\nfrom ..exceptions import *\nfrom ..annotations import *\n\ndef getAttributeValue(line, attr_name):\n '''Return the val... | [
[
"numpy.argmin"
]
] |
HiEST/AI4DL | [
"620d78dc0dafca1fa0bd77e2a138149de54076c9"
] | [
"package/AI4DL/crbm_tools.py"
] | [
"\nfrom timeit import default_timer as timer\nimport numpy as np\nfrom numpy import outer as np_outer\nimport time\nimport matplotlib.pyplot as plt\nimport numexpr as ne\nfrom numexpr import evaluate \nimport sys\nimport os\nimport random\nimport inspect\nimport json\nimport pickle\n\nclass CRBM:\n \n def __i... | [
[
"numpy.dot",
"numpy.random.random",
"numpy.random.seed",
"numpy.linalg.norm",
"numpy.random.normal",
"numpy.mean",
"numpy.zeros"
]
] |
code6levels/Adaptive-Spatial-Feature-Pooling | [
"200e10ae5fd99a1a13d7525beedc10912fdb2397"
] | [
"Adaptive-Spatial-Feature-Pooling/train_2.py"
] | [
"\r\nimport torch\r\nimport torch.optim as optim\r\nfrom network import PB_atrous,PB_resnet\r\nfrom tool.dataset import VOC_Dataset\r\nimport argparse\r\nfrom torchvision import transforms\r\nfrom torch.utils.data import DataLoader\r\nimport torch.nn as nn\r\nfrom sklearn.metrics import average_precision_score\r\ni... | [
[
"torch.sigmoid",
"torch.ones",
"torch.cat",
"torch.nn.MultiLabelSoftMarginLoss",
"torch.utils.data.DataLoader",
"torch.nn.functional.relu",
"torch.set_grad_enabled",
"sklearn.metrics.average_precision_score",
"torch.nn.functional.interpolate",
"torch.nn.DataParallel"
]
] |
cambel/ur_openai_gym | [
"bed90641e24b06fdb36df35eb64418dc15e96292"
] | [
"ur_rl/scripts/tf2rl_sac.py"
] | [
"#!/usr/bin/env python\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' #tensorflow logging disabled\nfrom shutil import copyfile\nimport rospy\nimport timeit\nimport argparse\nfrom gym.envs.registration import register\n\nfrom tf2rl.algos.sac import SAC\nfrom tf2rl.experiments.cb_trainer import Trainer\n\nimpo... | [
[
"numpy.set_printoptions"
]
] |
gongpx20069/mmRadar_for_HAR_VS | [
"ad40cf88f1fa425333108b6394a7379945300a6e"
] | [
"HAR/codes_v4/train.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport os\r\nfrom MyDataset import MyDataset\r\nfrom torch.utils.data import Dataset, DataLoader\r\n\r\nfrom PointGNN_boost import HAR_PointGNN\r\n\r\ndevice = torch.device(\"cuda:2\" if torch.cuda.is_available() else \"cpu\")\r\n\r\n\r\ndef test_acc(model, dataset, batch_s... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.load",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.StepLR"
]
] |
elifesciences-publications/Simpson_Barton_Nanopore_1 | [
"1b509454a9e25a8c81be5092f8e525ca00e7b5a5"
] | [
"pipeline/basecalling_pipeline/scripts/DRS_details/DRS_splitCanonicalSpliceReads.py"
] | [
"#!/usr/bin/env python\n'''\n--------------------------------------------\nONTdrstools.DRS_splitCanonicalSpliceReads.py\n--------------------------------------------\n\nThis script parses an aligned set of ONT DRS data and examines the splicing \ncharacteristics of the dataset. The parses the alignment of each read... | [
[
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"numpy.invert",
"matplotlib.pyplot.ylim",
"matplotlib.use",
"matplotlib.pyplot.savefig",
"matplotl... |
TomAugspurger/dota | [
"38f4021370bb41a94d3edfd8e844e0ed43f4c9a8"
] | [
"dota/helpers.py"
] | [
"# -*- coding: utf-8 -*-\nimport re\nimport pathlib\nfrom itertools import chain\ntry:\n from io import StringIO\nexcept ImportError:\n from StringIO import StringIO\n\nimport numpy as np\nimport pandas as pd\n\nimport dota.api as a\n\n\ndef cached_games(directory, regex=r\"[\\w\\/]*?(\\d+)\\.json\"):\n \"... | [
[
"pandas.isnull",
"numpy.zeros",
"pandas.DataFrame"
]
] |
psc-g/Psc2 | [
"6676fc67263c9268ff65784d583cb838cfd42c28"
] | [
"Psc2/modes/mlsplainer.py"
] | [
"\"\"\"A MLSplainer mode for hijacking human notes with machine learning ones.\"\"\"\n\nimport os\nimport OSC\nimport tensorflow as tf\nimport threading\n\nimport magenta\nfrom magenta.models.melody_rnn import melody_rnn_model\nfrom magenta.models.melody_rnn import melody_rnn_generate\nfrom magenta.models.melody_rn... | [
[
"tensorflow.logging.set_verbosity"
]
] |
zhkmxx9302013/SoftwarePilot | [
"826098465b800085774946c20a7a283f369f1d21"
] | [
"externalModels/Cracks/CrackDetect/dataset.py"
] | [
"import numpy as np\r\nimport os\r\nimport pickle\r\n########################################################################\r\ndef cache(cache_path, fn, *args, **kwargs):\r\n \"\"\"\r\n Cache-wrapper for a function or class. If the cache-file exists\r\n then the data is reloaded and returned, otherwise t... | [
[
"numpy.asarray",
"numpy.max",
"numpy.eye"
]
] |
lcx1997213/sbp | [
"cfd8f4e1f971065344e8d03b764e18f36fb71c7f"
] | [
"SBP_ANN_RBM/gui.py"
] | [
"from Tkinter import *\nfrom model import Network\nimport numpy as np\nfrom PIL import Image, ImageTk\nimport sys\nfrom threading import Thread\nimport time\n\nclass GUI(Tk):\n\n def __init__(self,name):\n\n Tk.__init__(self, None)\n\n self.title('Equilibrium Propagation')\n self.net = Netwo... | [
[
"numpy.float32"
]
] |
dzubke/speech-lite | [
"65f83ac2b7551650820f079ce5152741f2a6fdb8"
] | [
"convert_model/export.py"
] | [
"import torch\nimport argparse\nimport pickle\nimport matplotlib\n\ndef preproc_pickle():\n with open('/Users/dustin/CS/consulting/firstlayerai/phoneme_classification/src/awni_speech/speech/examples/librispeech/models/ctc_models/20200121/20200127/best_preproc.pyc', 'rb') as fid:\n preproc = pickle.load(fi... | [
[
"torch.device"
]
] |
mmaguero/classic-text-classification | [
"ddc1c9dbc9b8fb6e255572e7aeac6d94e022c548"
] | [
"training.py"
] | [
"import sys\nimport pandas as pd\npd.options.display.max_columns = 30\nimport numpy as np\nfrom time import time\n#\nimport warnings \nwarnings.filterwarnings('ignore')\n#\nimport nltk\nfrom nltk.corpus import stopwords\nstop_words = set(stopwords.words('english'))\n#\nfrom sklearn.feature_extraction.text import Co... | [
[
"sklearn.linear_model.LogisticRegression",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.ConfusionMatrixDisplay",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.metrics.confusion_matrix",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.utils.parallel_backend",
"skle... |
key06/AShareData | [
"2112fe1cbd2d5f963f31f8c4b5e40e368ac063e0"
] | [
"AShareData/data_source/TDXData.py"
] | [
"import datetime as dt\nfrom collections import OrderedDict\n\nimport pandas as pd\nfrom pytdx.hq import TdxHq_API\nfrom tqdm import tqdm\n\nfrom .DataSource import DataSource\nfrom .. import utils\nfrom ..config import get_global_config\nfrom ..DBInterface import DBInterface\nfrom ..Tickers import StockTickers\n\n... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
dirkmcpherson/gym-novel-gridworlds | [
"5cd04fdf65e20cee51a9a6ed8eead662aad39259"
] | [
"tests/keyboard_interface.py"
] | [
"import os\nimport time\n\nimport gym\nimport gym_novel_gridworlds\nfrom gym_novel_gridworlds.constant import env_key\nfrom gym_novel_gridworlds.wrappers import SaveTrajectories, LimitActions\nfrom gym_novel_gridworlds.observation_wrappers import LidarInFront, AgentMap\nfrom gym_novel_gridworlds.novelty_wrappers im... | [
[
"numpy.where"
]
] |
hjorvardr/RL_Library | [
"26eb576f7a8e33bf9c21ced5b8a5ce08dfc9abd9"
] | [
"CartPole/dqn_cart_pole.py"
] | [
"import os\nimport time\nimport gym\nimport keras.optimizers \nfrom keras import backend as K\nfrom keras.layers import Dense\nimport numpy as np\nimport tensorflow as tf\nfrom tqdm import tqdm\nfrom dqn_lib import DQNAgent\n\nos.environ['PYTHONHASHSEED'] = '0'\nseed = 73\nnp.random.seed(seed)\ntf.set_random_seed(s... | [
[
"tensorflow.set_random_seed",
"numpy.array",
"numpy.reshape",
"numpy.random.seed"
]
] |
fastboardAI/linguisticFeatureExtractor | [
"6cb2b6e7133e0f42acde1ce6e0344ffcbb578a7a"
] | [
"build/lib/fling/tfidfModule.py"
] | [
"from imp import reload\nfrom nltk.corpus import stopwords\nfrom collections import Counter\nimport pandas as pd\nimport numpy as np\nimport matplotlib as mpl\nimport nltk,re,pprint\nimport sys,glob,os\nimport operator, string, argparse, math\n\n# class to read and preprocess data\nclass dataProcessor:\n def __i... | [
[
"pandas.set_option",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
radiasoft/rsopt | [
"6d4d123dd61e30c7f562b2f5a28c3ccbbcddbde3"
] | [
"rsopt/libe_tools/generator_functions/sobal.py"
] | [
"import numpy as np\n\n\ndef uniform_random_sample(H, persis_info, gen_specs, _):\n \"\"\"\n Generates ``gen_specs['user']['gen_batch_size']`` points uniformly over the domain\n defined by ``gen_specs['user']['ub']`` and ``gen_specs['user']['lb']``.\n\n .. seealso::\n `test_uniform_sampling.py <h... | [
[
"numpy.zeros"
]
] |
gitjeff05/quality-control | [
"873e2bb8a2655d80e0f0a7a38fbd834b562a5726"
] | [
"app/data/data_source.py"
] | [
"#\n# Manages all the data needed for checks:\n#\n# 1. The DEV worksheet in Google sheets\n# 2. The historical data pulled from the API\n# 3. The current data pulled from the API (redundant w/the historical data)\n#\n# This module is responsible for type conversion and renaming the fields for consistency.\... | [
[
"pandas.json_normalize",
"pandas.concat",
"pandas.read_csv",
"pandas.to_datetime"
]
] |
Arnie0426/NVTabular | [
"76e63d9df7b90433d552606e9cf87bd61d7eee3b"
] | [
"tests/unit/test_io.py"
] | [
"#\n# Copyright (c) 2021, NVIDIA CORPORATION.\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 applicabl... | [
[
"pandas.DataFrame.from_records",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.choice"
]
] |
kruda/DetectAndTrack | [
"d66734498a4331cd6fde87d8269499b8577a2842"
] | [
"lib/core/mpii_eval_engine.py"
] | [
"##############################################################\n# Copyright (c) 2018-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n########################################################... | [
[
"numpy.random.seed"
]
] |
QuantitativeBiology/crispy | [
"c7d5592555e845de0c61077be90ebe5125cca570"
] | [
"crispy/DimensionReduction.py"
] | [
"#!/usr/bin/env python\n# Copyright (C) 2019 Emanuel Goncalves\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.manifold import TSNE\nfrom crispy.CrispyPlot import CrispyPlot\nfrom sklearn.decomposition import PCA, FactorAnalysis\n\n\ndef pc_labels(n):\n return [f\"PC{i}\... | [
[
"pandas.Series",
"numpy.arange",
"matplotlib.pyplot.subplots",
"sklearn.manifold.TSNE",
"sklearn.decomposition.FactorAnalysis",
"sklearn.decomposition.PCA"
]
] |
angusll/scancer_pip | [
"0c490505f5bb7bccc316676e686ca9fcecf46d40"
] | [
"kubeflow/components/evaluate/src/evaluate.py"
] | [
"import tensorflow as tf\nimport os\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport numpy as np\nimport pandas as pd\nimport skimage.io\nimport skimage.transform\nimport logging\nimport argparse\nimport json\n\n\ndef IoU_Score(y_true,y_pred):\n \n y_true = tf.cast(y_true,tf.int32) # must be int32 or ... | [
[
"pandas.concat",
"pandas.read_csv",
"tensorflow.io.decode_png",
"tensorflow.reduce_sum",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.io.gfile.glob",
"pandas.DataFrame",
"tensorflow.image.resize",
"tensorflow.keras.b... |
thunlp/RSN | [
"a6754faded4645cd90b64fdfe7468fbc65006c8f"
] | [
"RSN/train_RSN.py"
] | [
"import tensorflow as tf\n\nimport numpy as np\nimport json\nimport sys\nimport os\nimport argparse\n\nsys.path.append(os.path.abspath('../lib/'))\nfrom dataloader.dataloader import dataloader\nfrom model.siamodel import RSN\nfrom module.clusters import *\nfrom evaluation.evaluation import ClusterEvaluation\nfrom k... | [
[
"tensorflow.ConfigProto",
"numpy.arange",
"tensorflow.Session"
]
] |
thanhtrunghuynh93/holisticEmbeddingsNA | [
"d1bb58e879a9fb868729ea13c198e46c9c5f45c9"
] | [
"utils/random_clone_add.py"
] | [
"from __future__ import print_function, division\nimport numpy as np\nimport random\nimport json\nimport sys\nimport os\nimport argparse\nfrom shutil import copyfile\n\nimport networkx as nx\nfrom networkx.readwrite import json_graph\nimport pdb\n\ndef add_and_remove_edges(G, p_new_connection, num_add=10):\n '''... | [
[
"numpy.random.seed"
]
] |
rushic24/dm-haiku | [
"8ee1a2125587831783ae7ae1e74baacec23ae56d"
] | [
"haiku/_src/lift_test.py"
] | [
"# Copyright 2020 DeepMind Technologies Limited. 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# Unle... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
mujizi/e2e_coref | [
"8f27b76067c01093f62f9de4c9acb5577ebd0ed1"
] | [
"analysis_score.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\n\nimport tensorflow as tf\nimport coref_model_sentence_span as cm\nimport util\n\nif __name__ == \"__main__\":\n os.environ[\"GPU\"] = \"0\"\n config = util.initiali... | [
[
"tensorflow.Session"
]
] |
GiggleLiu/scipy | [
"b6eb8ada4e574f334d4d108cb877e91d2cc0ebcc"
] | [
"scipy/optimize/_lsq/least_squares.py"
] | [
"\"\"\"Generic interface for least-square minimization.\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nfrom warnings import warn\n\nimport numpy as np\nfrom numpy.linalg import norm\n\nfrom scipy.sparse import issparse, csr_matrix\nfrom scipy.sparse.linalg import LinearOperator\nfrom sci... | [
[
"numpy.dot",
"numpy.resize",
"scipy.optimize._numdiff.group_columns",
"numpy.arctan",
"numpy.asarray",
"numpy.all",
"numpy.zeros_like",
"numpy.any",
"numpy.iscomplexobj",
"scipy.optimize.OptimizeResult",
"scipy.sparse.issparse",
"numpy.atleast_1d",
"numpy.log1p"... |
laanlabs/train_detector | [
"8ac09073bdb1e8526805672434eb1a4db2932f2f"
] | [
"modified_yamnet.py"
] | [
"\n\"\"\"\nSlightly modified yamnet keras Model that outputs \nthe dense feature vectors along with the class predictions\n\nOriginally: \nTF_MODELS_REPO/models/research/audioset/yamnet/yamnet.py\n\n\"\"\"\n\nimport sys\n\nyamnet_base = './models/research/audioset/yamnet/'\nsys.path.append(yamnet_base)\n\nimport os... | [
[
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.squeeze",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Input"
]
] |
rivernuthead/DoD_analysis | [
"b06219d4026e89a9b9f1e8939010a63612750c80"
] | [
"DoD_analysis_v1-7.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Apr 15 09:44:30 2021\n\n@author: erri\n\"\"\"\nimport os\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import optimize as opt\n# from matplotlib.colors import ListedColormap, BoundaryNorm\n\nstart = time.time() ... | [
[
"numpy.polyfit",
"numpy.sqrt",
"numpy.round",
"numpy.max",
"numpy.mean",
"numpy.nanmean",
"numpy.nanstd",
"numpy.exp",
"scipy.optimize.curve_fit",
"numpy.where",
"numpy.pad",
"numpy.stack",
"numpy.ln",
"numpy.copy",
"numpy.nansum",
"numpy.count_nonze... |
nickduran/pliers | [
"9b10b27e70c3fbb7647eb1c70e031f55d824f3f6"
] | [
"pliers/tests/extractors/api/test_clarifai_extractors.py"
] | [
"from os.path import join\n\nimport numpy as np\nimport pytest\n\nfrom ...utils import get_test_data_path\nfrom pliers import config\nfrom pliers.extractors import (ClarifaiAPIImageExtractor,\n ClarifaiAPIVideoExtractor)\nfrom pliers.extractors.base import merge_results\nfrom pliers.st... | [
[
"numpy.isnan",
"numpy.isclose"
]
] |
bansan85/ocr-book-tests | [
"00594aa5e637e5a96d91d52449e669214985c708"
] | [
"test_images.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom diptych.angle import Angle\nfrom diptych.cv2ext import charge_image\nfrom diptych.fsext import get_absolute_from_current_path\nfrom diptych.print_interface import ConstString\nfrom tests.mock_separate_page import MockDisableSeparatePage\n\nnp.seterr(all=\"raise\")\ntc ... | [
[
"numpy.seterr"
]
] |
frank-wei/torchdynamo | [
"26c4c1b593bebf4246e566749dade38254b59ffb"
] | [
"torchdynamo/allowed_functions.py"
] | [
"import builtins\nimport collections\nimport copy\nimport functools\nimport itertools\nimport math\nimport operator\nimport types\nimport warnings\nfrom functools import lru_cache\n\nimport numpy\nimport torch\n\nfrom . import config\n\n\n@lru_cache(None)\ndef _disallowed_function_ids():\n remove = [\n Tr... | [
[
"torch.distributions.Distribution.set_default_validate_args"
]
] |
ApproxEng/approxeng.picamera | [
"775a30b4700858695a19b9179a9f730c220f4d06"
] | [
"src/python/approxeng/picamera/__init__.py"
] | [
"import numpy as np\nimport cv2\n\n\ndef find_lines(image, threshold=100, scan_region_height=50, scan_region_position=0, scan_region_width_pad=0,\n min_detection_area=100, invert=False, blur_kernel_size=21):\n \"\"\"\n Scan a numpy image to find things that look like dark lines on a pale backgro... | [
[
"numpy.size"
]
] |
marcin-sel/PADPy_PD1 | [
"adb8d9e17594c72ec7d65900627d5d3c9fe4ba4a"
] | [
"PD1_Plumber.py"
] | [
"import pygame, copy, sys\r\nimport numpy as np\r\n\r\n######################################################################################################\r\n###################################### Ustawienia początkowe zmiennych################################\r\n#################################################... | [
[
"numpy.logical_xor",
"numpy.array",
"numpy.any"
]
] |
edelaye/tvm | [
"3d6c1df8c4e50f7e0268b936495439b085c0a631"
] | [
"benchmark/tensorrt/run_tvm.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.random.uniform",
"numpy.random.seed"
]
] |
zhaocq-nlp/NJUNMT-tf | [
"f1440726b3c007bcf19126fc4dee43a91dccc718"
] | [
"njunmt/data/text_inputter.py"
] | [
"# Copyright 2017 Natural Language Processing Group, Nanjing University, zhaocq.nlp@gmail.com.\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/licen... | [
[
"numpy.sum"
]
] |
bsun0802/Zero-Learning-Fast-Medical-Image-Fusion | [
"b3325f09b3d81c3262bb7fc546739e07f3a459aa"
] | [
"code/main.py"
] | [
"import sys\nimport pkg_resources\nimport argparse\nfrom pathlib import Path\nfrom subprocess import check_call\n\nimport torch\nfrom torchvision.models.vgg import vgg19\n\nfrom skimage.measure import shannon_entropy\nfrom pytorch_msssim import SSIM, MS_SSIM\n\nfrom utils import *\nfrom metrics import *\n\n\ndef pa... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
GDSC-UIT/RealTime-Emotion-Recognizer | [
"2d12f651dbd02b9bccc9990a43189e8274fbea46"
] | [
"build_model/data_preprocess.py"
] | [
"from sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\nfrom tensorflow.keras import utils\nimport pandas as pd\nimport numpy as np\nfrom constants import img_depth, img_height, img_width\n\ndf = pd.read_csv('dataset/fer2013.csv')\n\nemotion_label = {0:'anger', 1:'disg... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.stack",
"sklearn.preprocessing.LabelEncoder",
"tensorflow.keras.utils.to_categorical"
]
] |
percycat/Tutorial | [
"d01fbb974c3a85436ea68ec277ca55cd553dd61f"
] | [
"MachineLearning/Regression/demo_LMS.py"
] | [
"\"\"\"\n===========\nOrdinary Least Square Demo\n===========\n\nUsing the slider widget to control visual properties of your plot.\n\nIn this example, a slider is used to choose the variance of the distribution that\nthe noise belongs to.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotli... | [
[
"matplotlib.pyplot.scatter",
"matplotlib.widgets.Button",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"matplotlib.widgets.Slider",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
... |
enjoy82/pytorch-ssd | [
"bc5449244a2ad98c81f49e0c187f7f8597185cba"
] | [
"run_ssd_demo.py"
] | [
"import cv2\nimport numpy as np\nimport time\nfrom utils_for_openvino.mb3lite_predictor import create_mobilenetv3_small_ssd_lite_predictor\n \n# モジュール読み込み \nimport sys\nsys.path.append('/opt/intel/openvino/python/python3.5/armv7l')\nfrom openvino.inference_engine import IENetwork, IEPlugin\n\nwindowwidth = 320\nwin... | [
[
"numpy.all"
]
] |
martinfleis/contextily | [
"fc00861c9756821f62de27bb06ef6771abc517d6"
] | [
"tests/test_ctx.py"
] | [
"import matplotlib\n\nmatplotlib.use(\"agg\") # To prevent plots from using display\nimport contextily as ctx\nimport os\nimport numpy as np\nimport mercantile as mt\nimport rasterio as rio\nfrom contextily.tile import _calculate_zoom\nfrom numpy.testing import assert_array_almost_equal\nimport pytest\n\nTOL = 7\n... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.testing.assert_array_almost_equal"
]
] |
PeterouZh/Omni-GAN-PyTorch | [
"564a586fed6ce51ef73933d8815d94ce077c4e5c"
] | [
"BigGAN_PyTorch_1_lib/utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n''' Utilities file\nThis file contains utility functions for bookkeeping, logging, and data loading.\nMethods which directly affect training should either go in layers, the model,\nor train_fns.py.\n'''\n\nfrom __future__ import print_function\nimport sys\nimport o... | [
[
"torch.randint",
"torch.zeros",
"torch.randperm",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.no_grad",
"numpy.random.randint",
"torch.norm",
"torch.randn",
"torch.eye",
"torch.arange",
"torch.linspace",
"torch.stack",
"numpy.argsort",
"numpy.rand... |
olmosUC3M/Introduction-to-Data-Science-and-Machine-Learning | [
"33a908011a5673dcbc6136dfc1eae868ef32e6b4"
] | [
"Notebooks/Session 5 Gradient Descent/Ridge_functions.py"
] | [
"import numpy as np\n\n\n# A function that normalizes data with pre-scecified mean and std. \ndef normalize(X,mu=0,std=1,flag_train=True):\n if(flag_train):\n mu = np.mean(X,0)\n std = np.std(X,0)\n \n X -= mu\n X /= std\n \n return X,mu,std\n\n# A function to add the all-ones column... | [
[
"numpy.linalg.inv",
"numpy.eye",
"numpy.ones",
"numpy.concatenate",
"numpy.round",
"numpy.std",
"numpy.random.permutation",
"numpy.mean",
"numpy.zeros",
"numpy.sum"
]
] |
intisarnaheen/Face-Recognition-API | [
"9ae0deba69eef50cd552f8700b9ee75021b65db8"
] | [
"src/automation.py"
] | [
"\n\nimport cv2\nimport sys\nimport os\nimport traceback\nfrom PIL import Image\nfrom glob import glob\nfrom scipy.ndimage import rotate\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport cv2\n\nimport numpy as np\n#%matplotlib inline\nimport matplotlib.image as mpimg\n\nCASCADE=\"/hom... | [
[
"numpy.random.uniform",
"scipy.ndimage.rotate",
"numpy.float32"
]
] |
lobpcg/scipy | [
"8627df31ab07d66b438c7e5d5880e3f4d435f248"
] | [
"scipy/stats/_multivariate.py"
] | [
"#\n# Author: Joris Vankerschaver 2013\n#\nimport math\nimport numpy as np\nfrom numpy import asarray_chkfinite, asarray\nimport scipy.linalg\nfrom scipy._lib import doccer\nfrom scipy.special import gammaln, psi, multigammaln, xlogy, entr, betaln\nfrom scipy._lib._util import check_random_state\nfrom scipy.linalg.... | [
[
"numpy.diag",
"numpy.dot",
"numpy.sqrt",
"numpy.einsum",
"numpy.asarray",
"numpy.issubdtype",
"numpy.vstack",
"numpy.max",
"scipy._lib.doccer.docformat",
"numpy.any",
"numpy.zeros_like",
"numpy.moveaxis",
"numpy.linalg.LinAlgError",
"numpy.exp",
"numpy.s... |
Steakkk/bioptim-1 | [
"ccced00a581d9bf469631cc8a186c055f2e567e1"
] | [
"examples/getting_started/custom_bounds.py"
] | [
"import numpy as np\nimport biorbd\n\nfrom bioptim import (\n Node,\n OptimalControlProgram,\n Dynamics,\n DynamicsFcn,\n Objective,\n ObjectiveFcn,\n ConstraintList,\n ConstraintFcn,\n Bounds,\n InitialGuess,\n ShowResult,\n InterpolationType,\n)\n\n\ndef custom_x_bounds_min(cur... | [
[
"numpy.array",
"numpy.random.random"
]
] |
Loopdiloop/IntpartSummerSchool2019 | [
"d3439e782472a7b66c8faaf3df31d0411722b405"
] | [
"talys_exercises/ex5/converted/gsf_empirical_to_file.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport sys\nsys.path.append(\"../../../talys_import_nld_gsf\")\nfrom convert_talys import gen_nld_table, sigma2, log_interp1d\n\n# commonly used const. strength_factor, convert in mb^(-1) MeV^(-2)\nstrength_factor = 8.6737E-08\n\n\ndef SLO(E, E0, Gamma0, sigma0)... | [
[
"numpy.linspace",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.loadtxt"
]
] |
zoonn1788/TensorflowLiteDemo | [
"dee02e2a8216232dee25a7d9587dc7039c6e8c37"
] | [
"tensorflow/python/kernel_tests/tensor_array_ops_test.py"
] | [
"# Copyright 2015 The TensorFlow Authors. 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 requ... | [
[
"tensorflow.core.protobuf.config_pb2.RunMetadata",
"tensorflow.python.framework.tensor_shape.TensorShape",
"numpy.asarray",
"tensorflow.python.ops.control_flow_ops.while_loop",
"tensorflow.core.protobuf.config_pb2.RunOptions",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.... |
4kssoft/unilm | [
"bc98ced9414bfba9ba453a8368caedae6f9d578b"
] | [
"unilm-v1/src/pytorch_pretrained_bert/optimization.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. 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/l... | [
[
"torch.nn.utils.clip_grad_norm_",
"torch.zeros_like",
"torch.cos"
]
] |
spotify-companion/CLI | [
"29934cc715922263652235d0a9a4f0d8f57ecec5"
] | [
"data_analysis.py"
] | [
"from click import style\r\nimport requests\r\nimport pandas as pd\r\nimport spotipy\r\nimport spotipy.util as util\r\nfrom sklearn.cluster import KMeans\r\nfrom sklearn import preprocessing\r\nimport matplotlib.pyplot as plt\r\nimport spotify_client as spotify\r\nimport os\r\nfrom datetime import datetime\r\nimpor... | [
[
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.figure"
]
] |
castacks/tartan_drive | [
"c731ca65381f4a169a7ce7bcc02e8b1e68c407f4"
] | [
"rosbag_to_dataset/rosbag_to_dataset/visualization/traj_and_image_viz.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom matplotlib.animation import FuncAnimation\n\ndef make_plot(traj, odom_topic='/odom', image_topics=['/multisense/left/image_rect_color', '/multisense/depth'], t=0, fig=None, axs=None):\n \"\"\"\n Side-by side plot showing the traj and action sequence... | [
[
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.moveaxis",
"numpy.load",
"matplotlib.pyplot.show"
]
] |
paulorauber/rlnn | [
"49f6b380921690a2c4b1d10db5c2c3055f161f7a"
] | [
"examples/tmaze.py"
] | [
"from sklearn.utils import check_random_state\n\n\nclass TMaze:\n def __init__(self, length=4, random_state=None):\n if length < 0:\n raise Exception('Invalid corridor length')\n\n self.length = length\n self.n_actions = 4\n self.random_state = check_random_state(random_sta... | [
[
"sklearn.utils.check_random_state"
]
] |
aliyun/3D-Local-CNN-for-Gait-Recognition | [
"ebff3fd395c5e864ebd881a1ff06aa8b36682929"
] | [
"solvers/c3d.py"
] | [
"#! /usr/bin/env python\nimport os\nimport pdb\nimport time\nimport yaml\nimport json\nimport pickle\nimport random\nimport shutil\nimport argparse\nimport numpy as np\nfrom collections import defaultdict\n\n# torch\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom utils import AverageMe... | [
[
"torch.load",
"torch.save"
]
] |
edaaydinea/CSMM102X-ML | [
"d1701a0638538e3332f1fae442f9de14349768c8"
] | [
"Week 6 - Classification/hw2_classification.py"
] | [
"from __future__ import division\r\nimport numpy as np\r\nimport sys\r\n\r\nX_train = np.genfromtxt(sys.argv[1], delimiter=\",\")\r\ny_train = np.genfromtxt(sys.argv[2])\r\nX_test = np.genfromtxt(sys.argv[3], delimiter=\",\")\r\n\r\nX_train = np.genfromtxt(\"X_train.csv\", delimiter=\",\")\r\ny_train = np.genfromtx... | [
[
"numpy.unique",
"numpy.uint8",
"numpy.matmul",
"numpy.genfromtxt",
"numpy.linalg.det",
"numpy.linalg.pinv",
"numpy.savetxt"
]
] |
mgvalverde/prince | [
"e5a705befbd122df33a0fefc4b26d63c96cf0552"
] | [
"prince/ca.py"
] | [
"\"\"\"Correspondence Analysis (CA)\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom scipy import sparse\nfrom sklearn import base\nfrom sklearn import utils\n\nfrom . import plot\nfrom . import util\nfrom . import svd\n\n\nclass CA(base.BaseEstimator, base.TransformerMixin):\n\... | [
[
"numpy.square",
"sklearn.utils.validation.check_is_fitted",
"numpy.einsum",
"sklearn.utils.check_array",
"scipy.sparse.diags",
"matplotlib.pyplot.subplots",
"numpy.copy",
"numpy.outer",
"numpy.sum"
]
] |
keerthan2/NYSE_Prediction | [
"b91a6c5bf1ef3431d0f7482cc77ac81e3dde664e"
] | [
"nyse.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nimport os\r\nimport matplotlib.pyplot as plt\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nfrom torch.utils.data import DataLoader, random_split, TensorDataset\r\nfrom torch.autograd import Variable\r\n\r\nfrom utils import train, test, ... | [
[
"pandas.read_csv",
"torch.Tensor",
"torch.manual_seed",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"matplotlib.pyplot.show",
"torch.nn.MSELoss",
"matplotlib.pyplot.figure"
]
] |
lauri-codes/matminer | [
"d19e0c921dda9c8eba78c07aeadbecaeadc51b23"
] | [
"matminer/featurizers/composition.py"
] | [
"from __future__ import division\n\nimport collections\nimport itertools\nimport os\nfrom functools import reduce, lru_cache\nfrom warnings import warn\n\nimport numpy as np\nimport pandas as pd\nfrom pymatgen import Element, MPRester\nfrom pymatgen.core.composition import Composition\nfrom pymatgen.core.molecular_... | [
[
"numpy.dot",
"numpy.multiply.reduce",
"numpy.log",
"numpy.abs",
"numpy.power",
"numpy.max",
"sklearn.neighbors.unsupervised.NearestNeighbors",
"numpy.mean",
"numpy.exp",
"numpy.array",
"numpy.divide"
]
] |
azedarach/matrix-factorization-case-studies | [
"b689c8af677c378bad75f68e56671a5c6f6589ec"
] | [
"tests/test_simplex_projection.py"
] | [
"\"\"\"\nProvides unit tests for simplex projections.\n\"\"\"\n\n# License: MIT\n\n\nimport numpy as np\n\nfrom convex_dim_red.simplex_projection import (simplex_project_rows,\n simplex_project_vector)\n\ndef test_correct_projection_for_1D_vector():\n \"\"\"Test sing... | [
[
"numpy.allclose",
"numpy.abs",
"numpy.ones",
"numpy.all",
"numpy.random.uniform",
"numpy.array"
]
] |
ksuderman/GalaxyMods | [
"c450a6e67d6ffed6bc0d3950d6c7fc20171bb1d4"
] | [
"tools/learning/ml_performance.py"
] | [
"import argparse\nimport pandas as pd\nimport plotly\nimport pickle\nimport plotly.graph_objs as go\nfrom sklearn.metrics import confusion_matrix, precision_recall_fscore_support,classification_report\nfrom sklearn.preprocessing import label_binarize\n\n\ndef main(infile_input, infile_output, outfile):\n \"\"\"\... | [
[
"pandas.read_csv",
"sklearn.metrics.classification_report",
"sklearn.metrics.confusion_matrix"
]
] |
snek5000/snek5000-cbox | [
"5e61897b762dde3858a08987bac26d6ace804556"
] | [
"doc/examples/run_side_simple.py"
] | [
"\"\"\"\nTo define environmental variable (in the terminal or in your .bashrc)\nuse something like: export FLUIDSIM_PATH=\"/fsnet/project/meige/2020/20CONVECTION/numerical/\"\n\n\"\"\"\n\nimport numpy as np\n\nfrom snek5000_cbox.solver import Simul\n\nparams = Simul.create_default_params()\n\naspect_ratio = params.... | [
[
"numpy.linspace"
]
] |
OSSome01/SLAM-Lecture | [
"c053eaa6fbe49b152af78dad5ff3f7626c9e88da"
] | [
"Unit_B/slam_04_c_estimate_transform_question.py"
] | [
"# For each cylinder in the scan, find its cartesian coordinates,\r\n# in the world coordinate system.\r\n# Find the closest pairs of cylinders from the scanner and cylinders\r\n# from the reference, and the optimal transformation which aligns them.\r\n# Then, output the scanned cylinders, using this transform.\r\n... | [
[
"numpy.sqrt"
]
] |
NREL/wp3-precon | [
"c1c163007d16986d04bc34deefbf1c1e1c754aa8"
] | [
"test/unit/test_power_curve_toolkit.py"
] | [
"import unittest\n\nimport numpy as np\nimport pandas as pd\nfrom numpy import testing as nptest\n\nfrom operational_analysis.toolkits import power_curve\nfrom operational_analysis.toolkits.power_curve.parametric_forms import (\n logistic5param,\n logistic5param_capped,\n)\n\n\nnoise = 0.1\n\n\nclass TestPowe... | [
[
"numpy.random.random",
"pandas.Series",
"numpy.random.seed",
"numpy.arange",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.zeros"
]
] |
Chessmag/pymatgen | [
"61a4bb7a1792e1ea2379abd45b3c40efb816fd64"
] | [
"pymatgen/core/structure.py"
] | [
"# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module provides classes used to define a non-periodic molecule and a\nperiodic structure.\n\"\"\"\n\nimport math\nimport os\nimport json\nimport collections\nimport itertools\nfrom abc imp... | [
[
"numpy.dot",
"pandas.DataFrame",
"numpy.round",
"numpy.all",
"numpy.max",
"numpy.zeros_like",
"numpy.fill_diagonal",
"numpy.any",
"numpy.cross",
"numpy.random.randn",
"scipy.spatial.distance.squareform",
"numpy.where",
"numpy.divide",
"numpy.allclose",
"... |
tareeqav/frustum-pointnets | [
"07a0385172067db4c3a792141f7171ab62143d4d"
] | [
"sunrgbd/sunrgbd_data/utils.py"
] | [
"''' Provides Python helper function to read My SUNRGBD dataset.\n\nAuthor: Charles R. Qi\nDate: October, 2017\n'''\nimport numpy as np\nimport cv2\nimport os\n\nclass SUNObject3d(object):\n def __init__(self, line):\n data = line.split(' ')\n data[1:] = [float(x) for x in data[1:]]\n self.c... | [
[
"numpy.hstack",
"numpy.random.random",
"numpy.reshape",
"numpy.vstack",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.copy",
"numpy.zeros_like",
"numpy.transpose",
"numpy.array",
"numpy.zeros",
"numpy.loadtxt"
]
] |
Christoph9402/CVND_Image_Captioning | [
"47b24fee7e30e3ab216b5c42ae7ffb7f449f19e8"
] | [
"model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.models as models\n\n#----------------------------------------------------------------------------------------------------------\n# ENCODER\nclass EncoderCNN(nn.Module):\n def __init__(self, embed_size):\n ... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.Embedding",
"torch.nn.LSTM"
]
] |
nimisis/DeDOL | [
"d7d8b1f0ce8c548c05cf993717ed5368d9340a23"
] | [
"DeDOL.py"
] | [
"import numpy as np\r\nimport argparse\r\nimport sys\r\nimport tensorflow as tf\r\nimport os\r\nfrom threading import Thread\r\nimport time\r\n\r\nfrom patroller_cnn import Patroller_CNN\r\nfrom patroller_rule import Patroller_Rule as Patroller_h\r\nfrom poacher_cnn import Poacher\r\nfrom poacher_rule import Poache... | [
[
"numpy.save",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"numpy.array",
"numpy.zeros"
]
] |
nmmp1234/desitarget | [
"71051d9a8816101dc69ddfc28a52d8c50803a0a0"
] | [
"py/desitarget/tychomatch.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# -*- coding: utf-8 -*-\n\"\"\"\n=====================\ndesitarget.tychomatch\n=====================\n\nUseful Tycho catalog matching and manipulation routines.\n\"\"\"\nimport os\nimport numpy as np\nimport fitsio\nimport requests\nimport pickle\nfr... | [
[
"numpy.atleast_1d",
"numpy.array",
"numpy.zeros"
]
] |
shaunwbell/EcoFOCI_AcrobatProcessing | [
"4a8c2514d09c98779b473bfd25067e73dbf94956"
] | [
"gridtime_resample.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\n Background:\n --------\n gridtime_resample.py\n \n \n Purpose:\n --------\n Resample and fill timegaps\n\n History:\n --------\n\n\"\"\"\n\nimport argparse\nimport pandas as pd\n\n\n\"\"\"---\"\"\"\n\nparser = argparse.ArgumentParser(description='CTD plots')\nparser.add_argument('... | [
[
"pandas.read_csv",
"pandas.DatetimeIndex"
]
] |
mrcabo/Grasping_Detection_System | [
"18cf23258a1c9342bc9ce57137ac399768bb1fed"
] | [
"code/similarities.py"
] | [
"from scipy.spatial.distance import jaccard\nimport numpy as np\nimport pandas as pd\n\n\n# Computing Jaccard Distance of two 5D-Rectangles\n\n# Issues to deal with:\n# Normalizing values?\n# Input format correct?\n# Weighting of the different dimensions?\n\n\ndef jaccard_distance(datFr, name, pred):\n \"\"\"\n ... | [
[
"numpy.maximum",
"numpy.minimum"
]
] |
esimionato/sgg | [
"037e8732a7a77496636ed2f49ea859afa424c5a4"
] | [
"dataloaders/blob.py"
] | [
"\"\"\"\nData blob, hopefully to make collating less painful and MGPU training possible\n\"\"\"\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nimport os\nfrom config import TORCH12\n\nif TORCH12:\n cuda_args = {'non_blocking': True}\nelse:\n # pytorch 0.3\n cuda_args = {'async': Tr... | [
[
"numpy.concatenate",
"numpy.ones",
"numpy.stack",
"torch.stack"
]
] |
tarunkathuria1/project121 | [
"ee2e5dd40f790c7608cc5a22747be041b9441a33"
] | [
"blackScreen.py"
] | [
"import cv2\nfrom matplotlib import image\nimport numpy as np\n\nvideo = cv2.VideoCapture(0)\nimage = cv2.imread(\"me.jpeg\")\n\nwhile True:\n\n ret,frame = video.read()\n print(frame)\n frame = cv2.resize(frame,(640,480))\n image = cv2.resize(frame,(640,480))\n\n u_black = np.array([104,153,70])\n ... | [
[
"numpy.array",
"numpy.where"
]
] |
Dartas-F/SCNN_Pytorch | [
"cbcf35e96e4e4d8de7d884c3debcfd5ff441e86a"
] | [
"new_train.py"
] | [
"\"\"\"\nsource: https://stanford.edu/~shervine/blog/pytorch-how-to-generate-data-parallel\n\n\"\"\"\nimport os\nimport time\nimport cv2\nimport numpy as np\nimport shutil\nimport sys\nfrom numpy.core.fromnumeric import argmax\n\nimport torch\nimport torch.optim as optim\nimport torchvision\nfrom dataset.BDD100k im... | [
[
"numpy.set_printoptions",
"torch.utils.data.DataLoader",
"torch.set_grad_enabled",
"torch.save",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available",
"torch.device",
"torch.argmax"
]
] |
sergeant-wizard/pytorch-pfn-extras | [
"221c07aedb9d88e4b96b55da49f6c104f631e01a"
] | [
"tests/pytorch_pfn_extras_tests/onnx/test_export_testcase.py"
] | [
"import io\nimport os\nimport json\n\nimport numpy as np\nimport onnx\nimport onnx.numpy_helper\nimport pytest\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.onnx.symbolic_helper import _default_onnx_opset_version\n\nfrom pytorch_pfn_extras.onnx import export\nfrom pytorch_pfn_ext... | [
[
"torch.ones",
"torch.nn.functional.log_softmax",
"torch.zeros",
"torch.autograd.backward",
"torch.nn.GRU",
"torch.nn.Conv2d",
"numpy.full",
"torch.nn.Linear",
"torch.cuda.is_available",
"numpy.testing.assert_allclose",
"torch.nn.functional.max_pool2d"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.