repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
psdobreff/openmc
[ "fe12fb1e96253cf9f0e65fbdc021bf65bb8918bc" ]
[ "openmc/mgxs/mdgxs.py" ]
[ "from collections import OrderedDict\nimport copy\nimport itertools\nfrom numbers import Integral\nimport os\n\nimport numpy as np\n\nimport openmc\nimport openmc.checkvalue as cv\nfrom openmc.mgxs import MGXS\nfrom .mgxs import _DOMAIN_TO_FILTER\n\n\n# Supported cross section types\nMDGXS_TYPES = (\n 'delayed-n...
[ [ "numpy.nan_to_num", "numpy.reshape", "numpy.tile", "numpy.swapaxes", "numpy.arange", "numpy.linspace", "numpy.unique" ] ]
yburansac/MachineLearning
[ "0749d1bdc529279ffeea7cc7301eee34b1e03c70" ]
[ "learning_curves.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import learning_curve\n\n# This file was adapted from Scikit example but a new function was added to plot 2 learning curves in one graph\n\n\ndef plot_learning_curve(estimator, title, X, y, cv=None,\n n_jobs=No...
[ [ "numpy.mean", "matplotlib.pyplot.subplots", "numpy.std", "numpy.linspace", "sklearn.model_selection.learning_curve" ] ]
SangRyul/2020_cau_pl
[ "f7c701fd7b1eb536ffbbd4f13ad927b32345f4a1" ]
[ "interpreter.py" ]
[ "\n# 프로그래밍 언어론 04분반 PL Team Project\n# Lisp Interpreter 구현 프로젝트\n\n# 참여자:\n# 창의ICT공과대학 컴퓨터공학부(컴퓨터공학전공) 20165020 김상렬\n# 창의ICT공과대학 소프트웨어학부 20181154 선민승\n# 소프트웨어대학 소프트웨어학부 20190143 고은서\n\n# 파일 정보:\n# 프로그램 명: interpreter.py\n# 역할: interpreter\n# 생성 날짜: 2020.11.10\n\nimport math\nimport itertools\nimport operator as op\...
[ [ "numpy.array" ] ]
zachbateman/evogression
[ "ee5329aed06c8e9d0f6343fa47990a1afeb20b27" ]
[ "tests/surface_3d_regression_evolution_test.py" ]
[ "import unittest\nimport sys\nsys.path.insert(1, '..')\nimport evogression\nfrom test_data import surface_3d_data\nfrom pprint import pprint as pp\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import axes3d\n\nimport random\nrandom.seed(10) # for reproducing the same plot\n\n\nclas...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.title", "matplotlib.pyplot.figure" ] ]
srivarshan-s/RNN-Novel-creation
[ "0cdc179fa8ac82fc3c9d72cb85f37833fc8442cb" ]
[ "model.py" ]
[ "import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport tensorflow as tf\n\nfrom generate_data import vocab, ids_from_chars\n\n\n# Length of the vocabulary in chars\nvocab_size = len(vocab)\n\n# The embedding dimension\nembedding_dim = 256\n\n# Number of RNN units\nrnn_units = 1024\n\n# Define the model\nclass...
[ [ "tensorflow.random.categorical", "tensorflow.keras.layers.Dense", "tensorflow.sparse.to_dense", "tensorflow.keras.layers.Embedding", "tensorflow.strings.unicode_split", "tensorflow.squeeze", "tensorflow.keras.layers.GRU" ] ]
sonalimahajan12/Automation-scripts
[ "9bcf8c71bc103ff6a3392a4528220781446b5b7a" ]
[ "attendance_automator/main.py" ]
[ "import cv2\nimport numpy as np\nimport face_recognition\nimport os\nfrom datetime import datetime\n\npath = 'images'\nimages = []\npersonName = []\nmyList = os.listdir(path)\n\nprint(myList)\n\nfor cu_img in myList:\n current_Img = cv2.imread(f'{path} / {cu_img}')\n images.append(current_Img)\n personName...
[ [ "numpy.argmin" ] ]
varshanth/FakeNewsChallenge-FNC1
[ "57cc26c62f73953bf49a2be7e35426c28c055991" ]
[ "models/custom_cnn_model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass ConditionedCNNClassifier(nn.Module):\n def __init__(self, net_cfg, embed_cfg):\n super().__init__()\n self.net_cfg = net_cfg\n self.embed_cfg = embed_cfg\n print('----------- Model Config---------------')\n...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.max_pool1d", "torch.nn.Embedding" ] ]
Federer1976/tushare
[ "1640f2beb200fa99e10dbba0fd19d0b7138f034e" ]
[ "tushare/fund/nav.py" ]
[ "# -*- coding:utf-8 -*-\n\n\"\"\"\n获取基金净值数据接口 \nCreated on 2016/04/03\n@author: leo\n@group : lazytech\n@contact: lazytech@sina.cn\n\"\"\"\n\nfrom __future__ import division\nimport time\nimport json\nimport re\nimport pandas as pd\nimport numpy as np\nfrom tushare.fund import cons as ct\nfrom tushare.util import d...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_json", "pandas.concat" ] ]
ablot/acq4
[ "ba7cd340d9d0282640adb501d3788f8c0837e4c4" ]
[ "acq4/drivers/nidaq/mock.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys, time, os\nimport numpy as np\nimport acq4.util.clibrary as clibrary\nimport ctypes\nmodDir = os.path.dirname(__file__)\nheaderFiles = [os.path.join(modDir, \"NIDAQmx.h\")]\ncacheFile = os.path.join(modDir, 'NIDAQmx_headers_%s.cache' % sys.platform) \n\nDEFS = clibrary.CParser...
[ [ "numpy.linspace", "numpy.zeros" ] ]
balintf/claude
[ "a3ebf0605ca26c4aadd0273f6b70813bdf931c9c" ]
[ "claude_top_level_library.py" ]
[ "# claude_top_level_library\n\nimport claude_low_level_library as low_level\nimport numpy as np\n\n# laplacian of scalar field a\ndef laplacian(a):\n\toutput = np.zeros_like(a)\n\tif output.ndim == 2:\n\t\tfor i in np.arange(1,nlat-1):\n\t\t\tfor j in range(nlon):\n\t\t\t\toutput[i,j] = (scalar_gradient_x_2D(a,i,(j...
[ [ "numpy.zeros_like", "numpy.arange", "numpy.zeros" ] ]
jhchang-lanl/Draco
[ "b8e3bcd38ab739615c1df506268d70bf99929efa" ]
[ "src/compton_tools/python/ultra_reader.py" ]
[ "#!/usr/bin/env python\n# --------------------------------------*-python-*------------------------------------------------ #\n# file src/compton_tools/python/ultra_reader.py\n# author Andrew Till <till@lanl.gov>\n# date 14 May 2020\n# brief This script has functions that parse an ULTRA file with Compton\n# ...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.ones", "numpy.mean", "numpy.diff", "numpy.logical_and", "numpy.geomspace", "numpy.power", "numpy.sqrt", "numpy.cumsum", "numpy.abs", "numpy.linspace", "numpy.var", "numpy.maximum" ] ]
darianyang/ff15ipq-lig
[ "22a2ff612a9f323d6e6cdaa7ec1381df4066a885" ]
[ "charges/3.1.check_converge.py" ]
[ "\"\"\"\nCheck to see if a single small molecule set of charges is convereged after\na round of IPolQ charge derivation.\n\nThis only works for a single restype in the library and resp output files.\n\nParameters\n----------\nlibrary : str\n sys.argv[1], the library file (OFF format) containing previous charges....
[ [ "numpy.divide", "numpy.loadtxt", "numpy.subtract", "numpy.abs", "numpy.average" ] ]
serre-lab/pred_gn
[ "437034687a561e72bf013dc295454da239748044", "437034687a561e72bf013dc295454da239748044" ]
[ "build/lib/slowfast/models/video_model_builder.py", "slowfast/utils/ava_evaluation/np_box_mask_list_ops.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Video models.\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nimport slowfast.utils.weight_init_helper as init_helper\n\nfrom . import head_helper, resnet_helper, stem_helper\nfrom .build import MODEL_REGISTRY\...
[ [ "torch.cat", "torch.nn.MaxPool3d", "torch.nn.ReLU", "torch.nn.Conv3d", "torch.nn.BatchNorm3d" ], [ "numpy.full", "numpy.array", "numpy.reshape", "numpy.nonzero", "numpy.logical_and", "numpy.where", "numpy.amax", "numpy.arange", "numpy.greater", "nump...
joetache4/project-euler
[ "82f9e25b414929d9f62d94905906ba2f57db7935" ]
[ "149_SearchingForAMaximum-SumSubsequence.py" ]
[ "\"\"\"\nLooking at the table below, it is easy to verify that the maximum possible sum of adjacent numbers in any direction (horizontal, vertical, diagonal or anti-diagonal) is 16 (= 8 + 7 + 1).\n−2\t5\t3\t2\n9\t−6\t5\t1\n3\t2\t7\t3\n−1\t8\t−4\t 8\n\nNow, let us repeat the search, but on a much larger scale:\n\nF...
[ [ "numpy.array", "numpy.maximum" ] ]
entityoneuk/lusid-python-tools
[ "ee13d92673d01cfc9f7c427ed053e7a1e8d64973" ]
[ "lusidtools/cocoon/instruments.py" ]
[ "import lusid\nimport lusid.models as models\nfrom lusid.api import InstrumentsApi, SearchApi\nimport numpy as np\nimport time\nfrom lusidtools.cocoon.utilities import checkargs\nimport pandas as pd\nimport logging\nimport re\nfrom lusidtools.cocoon.async_tools import run_in_executor\nimport asyncio\nfrom typing im...
[ [ "pandas.isnull", "pandas.isna", "numpy.dtype" ] ]
mayunpeng/Theano
[ "c74da33de3768e231ffa0d92d9d11667a2a5aedb" ]
[ "theano/tensor/nnet/conv.py" ]
[ "from __future__ import print_function\n\"\"\"\nContains an Op for convolving input images with a set of filters. This was\ndeveloped especially for Convolutional Neural Networks.\n\nFor related ops, including downsampling and subsampling, see\ntensor.signal and tensor.signal.downsample.\n\nSee especially conv2d()....
[ [ "numpy.asarray", "numpy.zeros", "scipy.signal.signaltools._valfrommode", "scipy.signal.sigtools._convolve2d", "scipy.signal.signaltools._bvalfromboundary" ] ]
proboscis/omni-cv-rules
[ "0a3d4763c0c50bc32974a16531b3d0a1d396c05a" ]
[ "omni_cv_rules/nrm_quiver.py" ]
[ "import io\nimport itertools\nfrom functools import partial\nfrom typing import List, Any\n\nimport matplotlib\nimport numpy as np\nfrom loguru import logger\nfrom matplotlib import pyplot as plt\n\nfrom omni_converter.solver.rules import RuleEdge\n\n\ndef to_nrm_quiver_auto(nrm: \"AutoData\", auto_func) -> \"AutoD...
[ [ "matplotlib.pyplot.savefig", "numpy.copy", "matplotlib.pyplot.subplots", "numpy.linspace", "matplotlib.pyplot.imread" ] ]
testingautomated-usi/repli-stvr2022-uncertainty
[ "c4ef27721e9d3e2b44d328cc99b0e2616b99ef12" ]
[ "emp_uncertainty/dropout_rate/cifar_dropout.py" ]
[ "import os\n\nimport numpy as np\nimport tensorflow as tf\nimport uncertainty_wizard as uwiz\n\nfrom emp_uncertainty.case_studies.case_study import BASE_MODEL_SAVE_FOLDER, BASE_OUTPUTS_SAVE_FOLDER\nfrom emp_uncertainty.case_studies.plain_classifiers import cifar10\nfrom emp_uncertainty.dropout_rate.utils import rat...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.keras.layers.Flatten", "numpy.save", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.models.Sequential", "tensorflow.ke...
nuck555/ImageProcessing100Wen
[ "9e0d361f6eb61c9f23ac3e14e36a384b994c5511" ]
[ "Question_11_20/answers_py/answer_18.py" ]
[ "import cv2\nimport numpy as np\n\n# Gray scale\ndef BGR2GRAY(img):\n\tb = img[:, :, 0].copy()\n\tg = img[:, :, 1].copy()\n\tr = img[:, :, 2].copy()\n\n\t# Gray scale\n\tout = 0.2126 * r + 0.7152 * g + 0.0722 * b\n\tout = out.astype(np.uint8)\n\n\treturn out\n\n# emboss filter\ndef emboss_filter(img, K_size=3):\n\t...
[ [ "numpy.sum", "numpy.zeros", "numpy.clip" ] ]
lucagrementieri/model-manifold
[ "41042a4c4f7cf702ca6c57fdd20d698c7ed46a52" ]
[ "mnist_training.py" ]
[ "import argparse\nimport random\nimport sys\nfrom pathlib import Path\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.optim.optimizer import Optimizer\nfrom torch.utils.data import DataLoader\nfrom torchvision...
[ [ "torch.cat", "torch.stack", "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.tensor", "torch.nn.functional.nll_loss" ] ]
manera/legacypipe
[ "64dfe164fe1def50f5ad53784edd9a63321b0d45", "64dfe164fe1def50f5ad53784edd9a63321b0d45" ]
[ "py/legacyanalysis/fix-wise-bad-psfdepth.py", "py/legacypipe/runbrick_plots.py" ]
[ "import pylab as plt\nimport numpy as np\nfrom astrometry.util.fits import *\nfrom glob import glob\nimport os\nimport subprocess\nimport fitsio\nimport hashlib\n\nbase = '/global/cfs/cdirs/cosmo/work/legacysurvey/dr9m/south/'\noutdir = 'fix-wise-psfdepth'\npat = base + 'tractor/*/tractor-*.fits'\nprint('Searching ...
[ [ "numpy.isfinite" ], [ "numpy.max", "numpy.zeros", "numpy.median", "numpy.percentile", "numpy.min", "numpy.sqrt", "numpy.maximum" ] ]
smalik169/recursive-convolutional-autoencoder
[ "ef91cfe94b71680b4c614b024fec23b8a09f825b" ]
[ "data.py" ]
[ "from __future__ import print_function\n\nimport codecs\nimport os\nimport pprint\nimport time\nfrom collections import defaultdict\nfrom itertools import chain\n\nimport numpy as np\nfrom nltk.tokenize import word_tokenize\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd imp...
[ [ "numpy.pad", "numpy.random.rand", "numpy.asarray", "numpy.random.RandomState", "numpy.random.permutation", "numpy.ones", "numpy.random.shuffle", "torch.from_numpy", "numpy.split", "numpy.fromfile", "numpy.logspace", "numpy.log2" ] ]
Michaeljurado24/nengo-loihi
[ "47a18efcda3324f74493d014b431cfd0e5b9fbe2", "47a18efcda3324f74493d014b431cfd0e5b9fbe2" ]
[ "nengo_loihi/conv.py", "nengo_loihi/hardware/interface.py" ]
[ "import itertools\n\nimport numpy as np\nfrom nengo.exceptions import ValidationError\nfrom nengo.transforms import ChannelShape, Convolution\n\nfrom nengo_loihi.compat import is_transform_type\n\n\nclass ImageSlice:\n \"\"\"Represents a slice of a larger image across rows/columns/channels.\n\n Parameters\n ...
[ [ "numpy.prod", "numpy.arange", "numpy.zeros", "numpy.transpose" ], [ "numpy.concatenate", "numpy.left_shift", "numpy.unpackbits", "numpy.diff", "numpy.random.randint", "numpy.frombuffer", "numpy.all", "numpy.hstack", "numpy.column_stack" ] ]
AstrocyteResearch/financial-planner
[ "23d817e9221e308c48b35753bd4ce505cfb1944d" ]
[ "financial_planner/calculators/life_insurance/life_insurance.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n'''\nDescription : calculator for how much life insurance is needed\n\n@author : Jincheng Dan \nemail : jcdan@bu.edu\n'''\n\nimport numpy as np\nimport pandas as pd\n\n\n\nfrom financial_planner.entities.term_structure import term_structure\n\n\n\n# get interest rate of US...
[ [ "numpy.repeat", "numpy.array", "numpy.cumprod" ] ]
AnitaPetzler/BayesGauss
[ "52bb098351363988a660d465df3b93cceec22bb7" ]
[ "BGD.py" ]
[ "from emcee.utils import MPIPool\nfrom mpfit import mpfit\nfrom statistics import mean\nimport copy\nimport corner\n# import datetime\nimport emcee\nimport itertools\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pickle\nimport random\nimport statistics\nimport sys\nimport subp...
[ [ "numpy.median", "numpy.exp", "numpy.concatenate", "numpy.log", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.transpose", "numpy.logaddexp", "numpy.append", "numpy.array", "numpy.delete", "numpy.zeros", "matplotlib.pyplot.title", "numpy.random.randn", ...
Ankur3107/scalingQA
[ "f648e34a9e4d7d4dbc2549a3c8767b6a25e3c447" ]
[ "scalingqa/reranker/training/train_reranker.py" ]
[ "import argparse\nimport logging\nimport os\nimport sys\nimport socket\nimport json\nimport pickle\nimport torch\n\nfrom datetime import datetime\nfrom transformers import AutoConfig, AutoTokenizer, AutoModel\nfrom torch.utils.data import DataLoader, RandomSampler\n\nfrom .framework import RerankerFramework\nfrom ....
[ [ "torch.utils.data.RandomSampler", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.BCEWithLogitsLoss", "torch.nn.CrossEntropyLoss" ] ]
vinigomes/cep-lat-long
[ "6a9d954d958f95f4a7688cec5c1308b3c936284f" ]
[ "app.py" ]
[ "from io import StringIO, BytesIO\n\nimport pandas as pd\nfrom flask import Flask, render_template, request\nfrom flask import send_file\n\nimport services\n\napp = Flask(__name__)\n\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n\n@app.route('/upload', methods=['POST'])\ndef upload()...
[ [ "pandas.read_csv" ] ]
GuillaumeDesforges/enpc-malap-project
[ "6c3092073ab3d6dc56b32c480910335c50eba7b3", "6c3092073ab3d6dc56b32c480910335c50eba7b3" ]
[ "engine/estimators/logistic_regression.py", "engine/utils/projections.py" ]
[ "from typing import Callable\nimport numpy as np\nfrom engine.estimators.base_estimator import BaseEstimator\nfrom engine.optimizers.base_optimizer import BaseOptimizer\nfrom engine.optimizers.sgd_logistic import LogisticSGD\nfrom engine.utils import projections\n\n\nclass LogisticRegression(BaseEstimator):\n de...
[ [ "numpy.dot", "numpy.zeros" ], [ "numpy.linalg.norm", "numpy.reshape", "numpy.tile", "numpy.exp", "numpy.random.shuffle", "numpy.stack", "numpy.arange", "numpy.repeat" ] ]
jinyuanliu23/DCRNN_PyTorch
[ "16c1856d2c1649e36abc07d5306d1ec758737554" ]
[ "model/pytorch/dcrnn_supervisor.py" ]
[ "import os\nimport time\n\nimport numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom lib import utils\nfrom model.pytorch.dcrnn_model import GARNNModel\nfrom model.pytorch.loss import masked_mae_loss\nfrom model.pytorch.loss import masked_rems_loss\nfrom model.pytorch.loss import m...
[ [ "numpy.concatenate", "torch.save", "torch.no_grad", "numpy.mean", "torch.optim.lr_scheduler.MultiStepLR", "torch.from_numpy", "torch.cuda.is_available", "torch.load", "torch.utils.tensorboard.SummaryWriter" ] ]
houchenst/beacon
[ "bb169446f8ed30dad84fb9da15fd336dbdf5a39c" ]
[ "beacon/loaders/CameraDataset.py" ]
[ "import torch.utils.data\nimport torchvision.transforms as transforms\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os, sys, math, argparse, zipfile, glob, cv2, random\n\nFileDirPath = os.path.dirname(os.path.realpath(__file__))\nsys.path.append(os.path.join(FileDirPath, '..'))\nsys.path.append(os.pa...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
fuldev/DL_project_5ibd
[ "0b7e73f462b1b95fc0d47534fcebb6c2e7c3b045" ]
[ "reinforcement_ecosystem/agents/ReinforceClassicWithMultipleTrajectoriesAgent.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nfrom typing import Any, Iterable\n\nimport numpy as np\nfrom keras import Input, Model\nfrom keras.activations import tanh, sigmoid\nfrom keras.layers import Dense, concatenate\nfrom keras.optimizers import adam\nfrom keras.utils import to_categorical\nimport ke...
[ [ "numpy.sum", "numpy.array", "numpy.random.choice" ] ]
calypso-science/Toto
[ "85e90421343bf3dcf6d730767287647b5bc189bb" ]
[ "toto/plugins/statistics/_do_comp_stats.py" ]
[ "import numpy as np\nfrom ...core.make_table import create_table\n\ndef do_comp_stats(output_name,hindcast,measured,short_name=''):\n\n gd=np.logical_and(~np.isnan(hindcast),~np.isnan(measured))\n stats=np.empty((6,3),dtype=\"object\")\n stats[0,0]='MAE'\n stats[1,0]='RMSE'\n stats[2,0]='MRAE'\n s...
[ [ "numpy.abs", "numpy.isnan", "numpy.empty", "numpy.mean" ] ]
cymqqqq/AI-research
[ "b344667adc217959abe314a3a5b08206a533222d", "b344667adc217959abe314a3a5b08206a533222d" ]
[ "Super-Resolution/RFDN.py", "rexnet/rexnet_lite.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport block as B\r\ndef make_model(args, parent=False):\r\n model = RFDN()\r\n return model\r\n\r\n\r\nclass RFDN(nn.Module):\r\n def __init__(self, in_nc=3, nf=50, num_modules=4, out_nc=3, upscale=4):\r\n super(RFDN, self).__init__()\r\n\r\n self.fe...
[ [ "torch.cat" ], [ "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU6", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.randn" ] ]
wanyingkang/pyqg
[ "ffcb48573a4a66d7c48f64c69734a567547e0962" ]
[ "pyqg/sqg_model.py" ]
[ "from __future__ import print_function\nimport numpy as np\nfrom numpy import pi\nfrom . import model\n\n\nclass SQGModel(model.Model):\n \"\"\"Surface quasigeostrophic model.\"\"\"\n\n def __init__(\n self,\n beta=0., # gradient of coriolis parameter\n Nb = 1., ...
[ [ "numpy.array", "numpy.random.rand", "numpy.asarray", "numpy.ones", "numpy.shape", "numpy.sqrt", "numpy.hstack", "numpy.gradient", "numpy.expand_dims" ] ]
Guilhem74/STI_Robotic_Competition_Software
[ "9936222b6230dfb11ec30ae02e59612129f80c67" ]
[ "Architecture/beacon.py" ]
[ "import cv2\nimport numpy as np\nimport math\nfrom picamera import PiCamera\nimport time\ncenter_cone_x = 978#978 #974\ncenter_cone_y = 655#655 #654\nRedLed = (0,8040)\nGreenLed = (8040,8040)\nBlueLed = (8040,0)\nYellowLed = (0,0)\n\n\ng_low = (32, 110, 90)\ng_high = (43, 255,255)\nb_low = (10, 200, 75)\nb_high = (...
[ [ "numpy.array", "numpy.zeros_like", "numpy.empty", "numpy.zeros", "numpy.nonzero" ] ]
ianlimle/Motion-Detector
[ "166533e1049ce5b8d5d4c47809a5d93043d2836f" ]
[ "FishCount_Event_Proto2.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 2 20:53:30 2018\n\n@author: Ian\n\"\"\"\n\n#Description:\n#This script runs a motion detector to test proof the concept of video analytics in optimizing situational awareness of key water installations\n#The aim is to contribute to a Smart Water Security Managem...
[ [ "numpy.hstack", "numpy.mean" ] ]
jason-wong-9/SportsHack2015
[ "28511ba72f68328aeeede214ac11f15dcd97b714" ]
[ "local/create_dataset.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 27 23:26:27 2015\n\n@author: Owner\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n \n#pd.set_option('display.max_rows',5000)\n \nroster = pd.read_csv(\"data/cfl_data/cfl_roster.csv\")\n \nheight = roster.iloc[0:,9]\nweight = roster.iloc[0:,10]\nlocation = ro...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
xw931018/MachineLearning
[ "c15e1cc93875329823a50fa7b0d6929438a0ddb7" ]
[ "ReinforcementLearning/RLMazeProblem.py" ]
[ "import pandas as pd\nimport numpy as np\nimport logging\nimport random\nimport matplotlib.pyplot as plt\n\n# ACTIONS = ['Left', 'Right', 'Up', 'Down']\nACTIONS = ['←', '→', '↑', '↓']\nthreshold = 0.05\n\n\ndef moveOneStep(current, action, shape): # Equivalent to a transition matrix\n current = np.copy(current)...
[ [ "numpy.array", "matplotlib.pyplot.colorbar", "numpy.ndenumerate", "numpy.array_equal", "numpy.zeros", "numpy.vectorize", "pandas.Index", "numpy.copy", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "numpy.random.uniform", "numpy.argmax", "matplotlib.py...
strong-win/Timeband
[ "179ca45ce9cb3efb686d837c8df6cdad4932e59e" ]
[ "source/utils/initiate.py" ]
[ "import torch\nimport random\nimport numpy as np\nimport pandas as pd\n\n\ndef seeding(seed=31):\n random.seed(seed)\n np.random.seed(seed)\n torch.manual_seed(seed)\n torch.cuda.manual_seed(seed)\n torch.backends.cudnn.deterministic = True\n torch.backends.cudnn.benchmark = True\n\n torch.set_...
[ [ "torch.device", "torch.cuda.manual_seed", "pandas.set_option", "numpy.random.seed", "numpy.set_printoptions", "torch.manual_seed", "torch.set_printoptions", "torch.cuda.is_available" ] ]
jaron771/Faster-RCNN
[ "8f8046502dabf5df8892efb9605b4c8442b7481d" ]
[ "lib/config/config.py" ]
[ "import os\nimport os.path as osp\n\nimport numpy as np\nimport tensorflow as tf\n\nFLAGS = tf.app.flags.FLAGS\nFLAGS2 = {}\n\n######################\n# General Parameters #\n######################\nFLAGS2[\"pixel_means\"] = np.array([[[102.9801, 115.9465, 122.7717]]])\ntf.app.flags.DEFINE_integer('rng_seed', 3, \"...
[ [ "numpy.array", "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.flags.DEFINE_string", "tensorflow.app.flags.DEFINE_boolean", "tensorflow.app.flags.DEFINE_float" ] ]
aizmeng/pyRiemann
[ "e1876de486b8ae047015a0c20284f626c4a92871" ]
[ "examples/ERP/plot_classify_MEG_mdm.py" ]
[ "\"\"\"\n====================================================================\nMulticlass MEG ERP Decoding\n====================================================================\n\nDecoding applied to MEG data in sensor space decomposed using Xdawn.\nAfter spatial filtering, covariances matrices are estimated and\nc...
[ [ "sklearn.model_selection.KFold", "matplotlib.pyplot.show", "numpy.arange", "sklearn.metrics.classification_report" ] ]
jksk/tensorflow
[ "48fb73a1c94ee2409382225428063d3496dc651e" ]
[ "tensorflow/contrib/learn/python/learn/estimators/head_test.py" ]
[ "# Copyright 2016 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.trainable_variables", "tensorflow.model_variables", "tensorflow.contrib.learn.python.learn.estimators.head._multi_class_head", "tensorflow.Session", "tensorflow.Graph", "tensorflow.global_variables", "tensorflow.contrib.learn.python.learn.estimators.head._regression_head", ...
eosulliv/menpo
[ "4c589a9c3ba103b98e6eb53bb12cbd692ccd4a9e" ]
[ "menpo/visualize/test/test_menpo3d_import.py" ]
[ "from collections import OrderedDict\nfrom mock import patch, MagicMock\nimport numpy as np\nfrom pytest import raises\nfrom scipy.sparse import csr_matrix\n\nfrom menpo.image import Image\nfrom menpo.shape import (\n TriMesh,\n TexturedTriMesh,\n ColouredTriMesh,\n PointCloud,\n LabelledPointUndirec...
[ [ "numpy.array", "scipy.sparse.csr_matrix", "numpy.ones" ] ]
Quidam74/myRepoAlgo
[ "c45905058f61e8c08643635aad6d969e4f305d3c" ]
[ "assignments/Session1/S1_algotools.py" ]
[ "##\n#\n# @author Florian BELLANGER, Fyne DC, Annecy, FRANCE\n# @brief a set of generic functions for data management\n\nimport numpy as np\nfrom random import randrange\n\n\ndef average_above_zero(table):\n \"\"\"\n make average from a table of non-null positiv value\n Arg:\n table : a list of nume...
[ [ "numpy.array", "numpy.zeros" ] ]
dgketchum/IrrMapper
[ "37b692e91e20bc0f34b1fb0116402990510a1e21" ]
[ "fully-conv-classification/shapefile_utils.py" ]
[ "import geopandas as gpd\nimport os\nfrom json import loads\nfrom numpy import zeros, asarray, array, reshape, nan, sqrt, std\nfrom copy import deepcopy\nfrom fiona import open as fopen\nfrom rasterio.mask import mask\nfrom pyproj import CRS\nfrom rasterio import open as rasopen\nfrom shapely.geometry import shape,...
[ [ "numpy.array", "numpy.asarray" ] ]
RustyPanda/tidal-features-classifier
[ "32e1aa0c074528ed04419d596c2014f78448e11b" ]
[ "tidalclassifier/pawlik/pawlik.py" ]
[ "import matplotlib\nimport pandas as pd\n\nmatplotlib.use('Agg') # Force matplotlib to not use any Xwindows backend.\nimport numpy as np\nfrom astropy.io import fits\nfrom custom_image_utils import scaled_plot\nfrom matplotlib import pyplot as plt\nimport scipy.spatial.distance\nimport skimage.transform\n\n# recrea...
[ [ "matplotlib.use", "numpy.zeros_like", "numpy.linalg.norm", "numpy.zeros", "numpy.argmin", "numpy.sum", "numpy.ones", "numpy.unravel_index", "numpy.argmax", "numpy.arange", "numpy.abs", "pandas.read_csv", "numpy.squeeze" ] ]
VaChristiaens/VIP
[ "8e8c80968c4cd1836b69e41a468a770646a4ba13" ]
[ "vip_hci/fits/fits.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nModule with various fits handling functions.\n\"\"\"\n\n\n__author__ = 'Carlos Alberto Gomez Gonzalez'\n__all__ = ['open_fits',\n 'info_fits',\n 'write_fits',\n 'verify_fits',\n 'byteswap_array']\n\n\nimport os\nimport numpy as np\nfrom astr...
[ [ "numpy.array" ] ]
srinidhim3/DataScienceBootcamp
[ "6a14aaecba16bdcb9226bb75d030d8310a26428d" ]
[ "sklearn_simple_linear_regression.py" ]
[ "# import modules\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.linear_model import LinearRegression\nsns.set()\n\n# load the data\ndata = pd.read_csv('data/Simple_linear_regression.csv')\nx = data['SAT']\ny = data['GPA']\n\n#convert to 2d array\nx_ma...
[ [ "sklearn.linear_model.LinearRegression", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
iprotasov/pfibs
[ "589724369b248971ba76da3f764f4b760b666761" ]
[ "demo/undocumented/navier-stokes/demo_ns-flat.py" ]
[ "\"\"\"Solves the lid-driven cavity Navier-Stokes equation with user defined block_structure.\nCompares block solver solution with builtin FEniCS solver.\"\"\"\n# -*- coding: utf-8 -*-\n\n## Future-proofing for Python3+\nfrom __future__ import print_function\n\n## Import preliminaries ##\nfrom dolfin import *\nfrom...
[ [ "matplotlib.use", "matplotlib.pyplot.show", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.figure" ] ]
mathczh/GANL2L
[ "fdffbcb1547cf8f3a7287a4a21d3f4871f3e4e42" ]
[ "models/cifar/cnn.py" ]
[ "import torch.nn as nn\nimport torch\nfrom ..OrthConv import *\nfrom ..SNConv import *\nfrom ..SphereConv import *\n\n__all__ = ['cnn_D','cnn_G','cnnv1_D','cnnv1_G','cnnv2_D','cnnv2_G','set_use_bias_cnn']\n\nUSE_BIAS = False\n\ndef set_use_bias_cnn(x):\n global USE_BIAS\n USE_BIAS = x\n\nclass CNN_D(nn.Module...
[ [ "torch.nn.LayerNorm", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
EytanKats/simple_converge
[ "b63cc374573d628b5c33f2502904ceca56a6f994" ]
[ "simple_converge/utils/DatasetSplitter.py" ]
[ "import sys\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom loguru import logger\r\nfrom sklearn import model_selection\r\n\r\nfrom utils import dataset_utils\r\n\r\n\r\ndefault_settings = {\r\n 'data_definition_file_path': 'dataset.csv',\r\n 'folds_num': 5,\r\n 'data_random_seed': 1509,\r\n 'train...
[ [ "numpy.random.seed", "numpy.random.permutation", "pandas.concat", "sklearn.model_selection.KFold", "numpy.array_split" ] ]
mwtoews/flopy
[ "e566845172380e3eae06981ca180923d2362ee56" ]
[ "examples/Tutorials/modflow6/tutorial03_mf6.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.5.1\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# # MODFLOW 6 Tutorial 3: Observatio...
[ [ "numpy.linspace" ] ]
mhassant/incubator-superset
[ "b205ce32b0b5ead6ba98585ba22e0f9c6d3cebdd" ]
[ "superset/viz.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...
[ [ "pandas.to_datetime", "numpy.isnan", "numpy.nanpercentile", "pandas.DataFrame", "pandas.to_numeric" ] ]
chengduoZH/models
[ "ff28150ad982cd96eb4af6ee717813c8f72f6700" ]
[ "PaddleNLP/Research/ACL2018-DAM/main.py" ]
[ "\"\"\"\nDeep Attention Matching Network\n\"\"\"\nimport sys\nimport os\nimport six\nimport numpy as np\nimport time\nimport multiprocessing\nimport paddle\nimport paddle.fluid as fluid\nimport reader as reader\nfrom util import mkdir\nimport evaluation as eva\nimport config\n\ntry:\n import cPickle as pickle #...
[ [ "numpy.array" ] ]
cristian-nitu/final-project
[ "70ca14469eb9ea2cca8fb116b3a0cdce0f32100b" ]
[ "cross_validation.py" ]
[ "\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom mpl_toolkits.mplot3d import Axes3D\nimport sklearn\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import svm\nfrom sklearn.linear_model import LinearRegression\n\nimport seaborn as sns\n\n# Loading dataset\ndf =...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
yongjingli/FairMOT
[ "c6609ba455b507693722728f1338ebb8a2785182" ]
[ "local_files/repvgg_convert.py" ]
[ "import sys\nsys.path.insert(0, '../')\nsys.path.insert(0, '../src/lib/')\nfrom models.model import create_model, load_model\n\nimport datasets.dataset.jde as datasets\nimport torch\nimport numpy as np\nimport cv2\nimport os\nimport os.path as osp\n\nfrom models.networks.pose_dla_repvgg_conv import DLASeg #.DLASeg ...
[ [ "torch.device", "torch.randn" ] ]
neuromorphs/nengo-robots
[ "8a35137b5d4304c98907c6c7e6894365dcac01d2" ]
[ "simple/simple-python.py" ]
[ "import nengo\nimport numpy as np\n\n# this is a dummy environment with a simple sensor and motor\nclass ExampleIO:\n def __init__(self):\n self.data = 0.0\n \n def sensor(self):\n return self.data + np.random.normal(0, 0.1)\n \n def motor(self, x):\n self.data += x * 0.0...
[ [ "matplotlib.pyplot.show", "numpy.random.normal" ] ]
uluturki/Mathematics-of-Epidemics-on-Networks
[ "bc45e994f2160a664c74f545704b650efb4088ac" ]
[ "docs/examples/fig7p3.py" ]
[ "import networkx as nx\nimport EoN\nfrom collections import defaultdict\nimport matplotlib.pyplot as plt\nimport scipy\nimport random\n\nN=10**6\ntau = 1.\ngamma = 1.\ncolors = ['#5AB3E6','#FF2000','#009A80','#E69A00', '#CD9AB3', '#0073B3','#F0E442']\n\nprint('setting up --- requires a large network to make clear t...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "scipy.linspace", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis" ] ]
UGentBiomath/COVID19-Model
[ "ef04f6ec78a3c3dc9217cea68ae5276d159ba0c1" ]
[ "src/covid19model/optimization/utils.py" ]
[ "import gc\nimport os\nimport sys\nimport emcee\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom multiprocessing import Pool, get_context\nfrom covid19model.visualization.optimization import traceplot\nfrom covid19model.visualization.output import _apply_tick_locator\nfrom covid19model.models.utils import...
[ [ "numpy.clip", "numpy.empty", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.exp", "numpy.save", "numpy.mean", "numpy.linalg.cond", "numpy.random.uniform", "numpy.arange", "numpy.append", "numpy.expand_dims" ] ]
Fuminides/athena
[ "78ad7ad5236dc8f12adc0401c52add3931292e69" ]
[ "athena/plugins/sample_processing_plugin.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 24 13:16:19 2020\n\n@author: Javier Fumanal Idocin (Fuminides)\n\"\"\"\nimport numpy as np\n\nfrom imblearn.over_sampling import SMOTE, ADASYN, BorderlineSMOTE\nfrom imblearn.combine import SMOTEENN, SMOTETomek\n\nimport Fancy_aggregations as fz\nfrom .. import b...
[ [ "numpy.random.normal", "numpy.zeros", "numpy.mean", "numpy.std", "numpy.random.uniform", "numpy.arange", "numpy.swapaxes", "numpy.unique" ] ]
Chrisebell24/Copulas
[ "cb6bdf51678ca175a6e4a49244d6f2060f183c85" ]
[ "tests/copulas/multivariate/test_vine.py" ]
[ "from unittest import TestCase\n\nimport numpy as np\nimport pandas as pd\n\nfrom copulas.multivariate.base import Multivariate\nfrom copulas.multivariate.tree import Tree, TreeTypes\nfrom copulas.multivariate.vine import VineCopula\nfrom copulas.univariate import KDEUnivariate\nfrom tests import compare_nested_dic...
[ [ "pandas.DataFrame", "numpy.array" ] ]
f0k/matplotlib
[ "b33a031deeb6a69533449d38d82ccf5a8246c959" ]
[ "lib/matplotlib/backends/backend_wx.py" ]
[ "from __future__ import division, print_function\n\"\"\"\n\n backend_wx.py\n\n A wxPython backend for matplotlib, based (very heavily) on\n backend_template.py and backend_gtk.py\n\n Author: Jeremy O'Donoghue (jeremy@o-donoghue.com)\n\n Derived from original copyright work by John Hunter\n (jdhunter@ace.bsd.uchicag...
[ [ "matplotlib.backend_bases.GraphicsContextBase.set_linewidth", "matplotlib.backend_bases.GraphicsContextBase.set_capstyle", "matplotlib.backend_bases.FigureCanvasBase.filetypes.copy", "matplotlib.backend_bases.FigureCanvasBase.resize_event", "matplotlib.backend_bases.FigureCanvasBase.button_pre...
alisaad012/lossy-compression
[ "473d5cab74acaa18b0c5f0d2866c56db4bc8fd20" ]
[ "src/model.py" ]
[ "import numpy as np\nimport warnings\nwarnings.filterwarnings('ignore',category=FutureWarning)\nimport tensorflow as tf\nfrom tensorflow.contrib.training import HParams\n\ndef default_hparams():\n return HParams(\n n_vocab=0,\n n_ctx=1024,\n n_embd=768,\n n_head=12,\n n_layer=1...
[ [ "tensorflow.exp", "tensorflow.constant_initializer", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.stack", "tensorflow.cast", "tensorflow.random_normal_initializer", "tensorflow.shape", "tensorflow.concat", "tensorflow.transpose", "tensorflow.variable_scope", ...
BastienBalaud/aco-pants
[ "5ed0e798ef9243542d7a7238e878cc61d3b0dd2d" ]
[ "ACOwithPants.py" ]
[ "import pants\r\nimport math\r\nimport random\r\nimport csv\r\nimport sys\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport argparse\r\n\r\nnodes = []\r\ninvalid_lines = 0\r\n\r\n#Traitement des arguements\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument(\"-v\", \"--verbose\", help=\"in...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
luisquintanilla/vscode-tools-for-ai
[ "1098e68d6a503ac8e9935bddde808b75a7b05d14" ]
[ "mnist-vscode-docs-sample/train.py" ]
[ "import numpy as np\nimport argparse\nimport os\nimport tensorflow as tf\nimport sys\n\nimport gzip\nimport struct\nfrom utils import prepare_data\nfrom amlrun import get_AMLRun\n\n# ## Download MNIST dataset\n# In order to train on the MNIST dataset we will first need to download\n\nX_train, X_test, y_train, y_tes...
[ [ "tensorflow.nn.in_top_k", "numpy.float", "numpy.random.permutation", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.layers.dense", "tensorflow.train.GradientDescentOptimizer", "tensorflow.reduce_mean", "ten...
douglasdavis/rexplotlib
[ "178f8b380bf89ea979567ad547cd29c3397feb0b" ]
[ "rexart/utils.py" ]
[ "import numpy as np\nfrom pathlib import PosixPath\nimport os\nimport subprocess\nimport logging\n\n\nlog = logging.getLogger(__name__)\n\n\ndef draw_ratio_with_line(ax, data, mc_sum, mc_err, yline=1.0, autoxscale=True):\n \"\"\" draw the ratio with a horizontal line on the axis \"\"\"\n x1 = data.bins[0]\n ...
[ [ "numpy.power" ] ]
RyanClement/DiffusionEquationSolvers
[ "b698e1aa1426e02d29cf5bf1ee2c3cb293046680" ]
[ "scripts/diffusionEq1D_BackwardEuler.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nProgram: diffusionEq1D_BackwardEuler\nCreated: Aug 2020\n@author: Ryan Clement (RRCC)\n scisoft@outlook.com\n\nPurpose: Solve the\n\n u_t = alpha * u_xx\n\non the interval (0,L) with boundary conditions\n\n u = 10 for x = 0\n ...
[ [ "scipy.sparse.linalg.spsolve", "numpy.sin", "scipy.sparse.diags", "numpy.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.exp", "matplotlib.pyplot.show", "numpy.linspace" ] ]
molingbo/crcn
[ "a01f084cc3a2b4a0533eb7d8709b9a6dcfb8a2db" ]
[ "keras/keras/models.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nimport theano\nimport theano.tensor as T\nimport numpy as np\n\nfrom . import optimizers\nfrom . import objectives\nfrom . import regularizers\nfrom . import constraints\nimport time, copy\nfrom .utils.generic_utils import Progbar\nfrom...
[ [ "numpy.asarray", "numpy.random.shuffle", "numpy.zeros" ] ]
ChenXinhao/Models
[ "924d3b8b14fadb9aa3279e176a81cd18f88659cc" ]
[ "official/vision/gan/megengine_mimicry/metrics/kid/kid_utils.py" ]
[ "# Copyright (c) 2020 Kwot Sin Lee\n# This code is licensed under MIT license\n# (https://github.com/kwotsin/mimicry/blob/master/LICENSE)\n# ------------------------------------------------------------------------------\n# MegEngine is Licensed under the Apache License, Version 2.0 (the \"License\")\n#\n# Copyright...
[ [ "numpy.trace", "numpy.zeros", "numpy.diagonal", "numpy.ravel", "sklearn.metrics.pairwise.polynomial_kernel" ] ]
matthewlchambers/standardizedinventories
[ "153526d34850820ee12bf5601e2703c583a07288" ]
[ "facilitymatcher/globals.py" ]
[ "# globals.py (facilitymatcher)\n# !/usr/bin/env python3\n# coding=utf-8\n\"\"\"\nSupporting variables and functions used in facilitymatcher\n\"\"\"\n\nimport zipfile\nimport io\nimport requests\nimport pandas as pd\nimport os\nfrom datetime import datetime\nfrom stewi.globals import log, set_stewi_meta, source_met...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
nabk89/NAS-with-Proxy-data
[ "165b3d895dde9675a4ae3f98ddf64ae2261df3c9" ]
[ "model_search_imagenet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom operations import *\nfrom torch.autograd import Variable\nfrom genotypes import PRIMITIVES\nfrom genotypes import Genotype\n\n\nclass MixedOp(nn.Module):\n\n def __init__(self, C, stride):\n super(MixedOp, self).__init__()\n self._op...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.softmax", "torch.nn.AdaptiveAvgPool2d", "torch.randn" ] ]
IevaNavikiene/DeepVess
[ "a08f0cab28d2535e2627e8c6e0ba5282e758c9d7" ]
[ "TrainDeepVess.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport time\nfrom random import shuffle\n\ndef train_deep_vess(trnL, it, corePadSize, tstL, tst, nEpoch, trn, train_step, accuracy, keep_prob, x, y_, saver, sess, WindowSize):\n def get_batch(im, l, corePadSize, ID):\n \"\"\" generate a batch fro...
[ [ "numpy.unravel_index", "numpy.ravel_multi_index", "numpy.reshape" ] ]
engisalor/sketch-grammar-explorer
[ "b117b4955a19142c078d01f8a22456599adc765a" ]
[ "apps/app3.py" ]
[ "import dash\nimport dash_html_components as html\nimport dash_table\nimport pandas as pd\nfrom app import app\n\n#### GET DATA\n\ndfAPI = pd.read_csv(\"freqs_data.csv\")\n\n#### LAYOUT\n\nlayout = html.Div(\n [\n html.H6(children=\"All records\"),\n html.Div(\n [\n dash_t...
[ [ "pandas.read_csv" ] ]
matthewse19/quantum-simulation
[ "c79f65e3f19b10ab217d2fbfd0918dae04523472", "c79f65e3f19b10ab217d2fbfd0918dae04523472" ]
[ "qAlgorithms.py", "qGates.py" ]
[ "import math\nimport random\nimport numpy\n\nimport qConstants as qc\nimport qUtilities as qu\nimport qGates as qg\nimport qMeasurement as qm\nimport qBitStrings as qb\n\n\ndef bennett():\n '''Runs one iteration of the core algorithm of Bennett (1992). Returns a tuple of three items --- |alpha>, |beta>, |gamma> ...
[ [ "numpy.array", "numpy.dot", "numpy.matmul", "numpy.exp", "numpy.identity", "numpy.conj", "numpy.transpose" ], [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.matmul" ] ]
DA4EVENT/home
[ "18cc93a795ce132e05b886aa34565a102915b1c6" ]
[ "N-Caltech101/evrepr/representations/event_representation.py" ]
[ "from abc import ABCMeta, abstractmethod\n\nimport torch\nimport torch.nn as nn\n\nfrom evrepr.utils.logger import setup_logger\n\n\nclass EventRepresentation(nn.Module, metaclass=ABCMeta):\n \"\"\"\n Abstract base class for event representations.\n \"\"\"\n\n def __init__(self, cfg, input_is_torch=Fals...
[ [ "torch.cat", "torch.empty" ] ]
sebhoof/gambit_1.5
[ "f9a3f788e3331067c555ae1a030420e903c6fdcd" ]
[ "Backends/patches/montepythonlike/3.3.0/bao_correlations/findiff_py23/coefs.py" ]
[ "\"\"\"\nThis module determines finite difference coefficients for uniform and\nnon-uniform grids for any desired accuracy order.\n\"\"\"\n\nimport math\nimport numpy as np\n\n\ndef coefficients(deriv, acc):\n \"\"\"\n Calculates the finite difference coefficients for given derivative order and accuracy order...
[ [ "numpy.array", "numpy.linalg.solve" ] ]
FDUJiaG/PyML-Course
[ "f606b5eab8dca928532263a9fe9c169549971d42" ]
[ "src/PySurprised/knn_classification.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport mglearn\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\n\nimport warnings\nwarnings.filterwarnings(\"ignore\", category=Warning)\n\n\nX, y = mglearn.datasets.make_forge()\nX_train, X_test, y_train...
[ [ "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.subplots" ] ]
kiarad88/Niffler
[ "f4f5704d839d74d59e077b0ed81ca1cde5a145e7" ]
[ "modules/suvpar/Suvpar.py" ]
[ "import pandas\nimport logging\nimport json\n\nlogging.basicConfig(level=logging.INFO)\ndf = {}\noutput_csv = {}\ndrop = True\n\n\ndef initialize():\n global output_csv, df\n with open('config.json', 'r') as f:\n config = json.load(f)\n\n feature_file = config['FeaturesetFile']\n filename = confi...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
mtaktikos/Polygames
[ "eb5390e57cc38e5287bf6dcfb420308a5995d194" ]
[ "pypolygames/evaluation.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport sys\nimport time\nfrom concurrent.futures import ThreadPoolExecutor\nfrom typing import Itera...
[ [ "torch.device", "torch.no_grad", "torch.cat", "torch.chunk" ] ]
lucianoleite/med2image
[ "fb6f96159a5e29661afb9384e0fc4777fbd0b017" ]
[ "med2image/pore_label.py" ]
[ "# NAME\n#\n# med2image\n#\n# DESCRIPTION\n#\n# 'med2image' converts from medical image data files to\n# display-friendly formats (like png and jpg).\n#\n# HISTORY\n#\n# 23 February 2015\n# o Initial design and coding.\n#\n\n# System imports\nimport os\nimport glob\nimport numpy as np\nimport r...
[ [ "numpy.rot90", "numpy.empty", "numpy.unique" ] ]
aliaydin96/EngineeringDesign
[ "185630cbba509ca1f872c3a3f847e9b155c5172b" ]
[ "Algorithm/Encoder/encoder_motor_controller.py" ]
[ "import RPi.GPIO as GPIO\nimport time\nimport numpy as np\nfrom motor import *\nimport csv\nimport math\nGPIO.setmode(GPIO.BOARD)\nGPIO.setwarnings(False)\nKp = 1\nKd = 0.8\nKi = 0.01\n\ndesired_x_position = 0\ndesired_y_position = 0\nbaseSpeed = 5\nmaxMotorSpeed = 10\nminMotorSpeed = 0\ndesired_angle = 0\ninterCou...
[ [ "numpy.sum", "numpy.zeros" ] ]
Harold2017/golina
[ "373d5e3fb09a347786b5ed01d2e0df766d8e86fd" ]
[ "examples/mesh/displayTriangulation.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\n@author:Harold\n@file: displayTriangulation.py\n@time: 27/09/2019\n\"\"\"\n\nimport numpy as np\n# This import registers the 3D projection, but is otherwise unused.\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nfrom utils.utils import load_3d_pt_cloud_da...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
FreJoe/tff-0.4.0
[ "1856d65c590565c421c579c5952391baf2264b29" ]
[ "tensorflow_federated/python/core/impl/type_utils.py" ]
[ "# Lint as: python3\n# Copyright 2018, The TensorFlow Federated Authors.\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# ...
[ [ "tensorflow.make_tensor_proto", "tensorflow.TensorSpec", "tensorflow.convert_to_tensor", "tensorflow.TensorShape", "tensorflow.nest.map_structure", "tensorflow.dtypes.as_dtype", "tensorflow.nest.assert_same_structure", "tensorflow.is_tensor" ] ]
BarneyQiao/pcl.pytorch
[ "4e8591a7c0768cee9eb7240bb9debd54824f5b33" ]
[ "lib/utils/logging.py" ]
[ "# Copyright (c) 2017-present, Facebook, 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 applicabl...
[ [ "numpy.median", "numpy.mean" ] ]
kierkegaard13/pytorch-dnc
[ "b21a705ccb88f72fe3723e3c1e1f2bbe741f01b6" ]
[ "tasks/argmax_task.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport warnings\nwarnings.filterwarnings('ignore')\n\nimport numpy as np\nimport getopt\nimport sys\nimport os\nimport math\nimport time\nimport argparse\nfrom visdom import Visdom\n\nsys.path.insert(0, os.path.join('..', '..'))\n\nimport torch as T\nfrom torch.au...
[ [ "numpy.array", "numpy.reshape", "numpy.zeros", "torch.save", "numpy.mean", "torch.manual_seed", "numpy.random.randint" ] ]
czczup/URST
[ "000ec9f7728f12ffad989ec1d07b1dd579514133" ]
[ "tools.py" ]
[ "import math\nfrom PIL import Image\nimport torch.nn.functional as F\nimport torch\n\ndef unpadding(image, padding):\n b, c, h ,w = image.shape\n image = image[...,padding:h-padding, padding:w-padding]\n return image\n\ndef preprocess(image:Image, padding=32, patch_size=1024, transform=None, cuda=True, squ...
[ [ "torch.nn.functional.pad", "torch.nn.functional.unfold" ] ]
phapnm/Violence-Recognition
[ "af7e2131308fa437863ac36d15a1620d549f5e5a" ]
[ "tests/test_models/test_backbone.py" ]
[ "import copy\n\nimport numpy as np\nimport pytest\nimport torch\nimport torch.nn as nn\nfrom mmcv.utils import _BatchNorm\n\nfrom mmaction.models import (ResNet, ResNet2Plus1d, ResNet3d, ResNet3dSlowFast,\n ResNet3dSlowOnly, ResNetTSM)\nfrom mmaction.models.backbones.resnet_tsm import NL...
[ [ "torch.Size", "torch.FloatTensor", "torch.cuda.is_available", "torch.zeros_like", "numpy.random.random", "torch.equal" ] ]
rainprob/GibsonEnv
[ "38274874d7c2c2a87efdb6ee529f2b366c5219de" ]
[ "examples/train/enjoy_husky_navigate_ppo1.py" ]
[ "#add parent dir to find package. Only needed for source code build, pip install doesn't need it.\nimport os, inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\nparentdir = os.path.dirname(os.path.dirname(currentdir))\nos.sys.path.insert(0,parentdir)\n\nimport gym, logg...
[ [ "tensorflow.train.import_meta_graph", "tensorflow.train.latest_checkpoint" ] ]
tailtq/TFLite-Retinaface
[ "93a16087d672f8e0efbf981cc61e5369dedb66f0" ]
[ "test_tensorflow.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nimport time\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\n\ngpus = tf.config.list_physical_devices('GPU')\nprint(\"Devices: \", gpus)\n\nfor gpu in gpus:\n tf.config.experimental.set_memory_growth(gpu, False)\n\nimg = cv2.imread(\"imgs/test-...
[ [ "tensorflow.convert_to_tensor", "tensorflow.config.experimental.set_memory_growth", "tensorflow.device", "tensorflow.config.list_physical_devices", "tensorflow.saved_model.load", "numpy.expand_dims" ] ]
sagar-rathod/pytorch_trainer_utility
[ "1695472150c70d788f177d9d3b4ead77764b8cbf" ]
[ "tests/test_learner.py" ]
[ "import unittest\nfrom deepml.train import Learner\nfrom deepml.losses import RMSELoss\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\nimport torchvision\n\n\nclass TestDataSet(torch.utils.data.Dataset):\n \"\"\" Class useful for reading images from a ...
[ [ "torch.nn.Linear", "torch.rand", "torch.nn.MaxPool2d", "torch.nn.Conv2d", "torch.randint", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss" ] ]
chenrz925/pytorch-OpCounter
[ "52f25701eef7771ef6b11947406d7f05d99cb386" ]
[ "thop/vision/basic_hooks.py" ]
[ "import argparse\nimport logging\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.modules.conv import _ConvNd\n\nmultiply_adds = 1\n\n\ndef zero_ops(device):\n def wrapper(m, x, y):\n m.total_ops += torch.DoubleTensor([int(0)]).to(device)\n\n return wrapper\n\n\ndef count_convNd(device):\n def ...
[ [ "torch.DoubleTensor", "torch.prod" ] ]
stevenbennett96/stk
[ "6e5af87625b83e0bfc7243bc42d8c7a860cbeb76", "6e5af87625b83e0bfc7243bc42d8c7a860cbeb76" ]
[ "src/stk/molecular/topology_graphs/cof/square.py", "src/stk/utilities/utilities.py" ]
[ "\"\"\"\nSquare\n======\n\n\"\"\"\n\nimport numpy as np\n\nfrom ..topology_graph import Edge\nfrom .cof import Cof\nfrom .vertices import LinearVertex, NonLinearVertex\n\n\nclass Square(Cof):\n \"\"\"\n Represents a sqaure COF topology graph.\n\n Unoptimized construction\n\n .. moldoc::\n\n impor...
[ [ "numpy.array" ], [ "numpy.square", "numpy.equal", "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.arccos", "numpy.zeros", "numpy.sin", "numpy.sum", "numpy.copy", "numpy.linalg.det", "numpy.identity", "numpy.allclose", "numpy.multiply", "n...
ylipacbio/pbtranscript
[ "6b4ef164f191ffd4201feb62b951d9eeac3315b6" ]
[ "setup.py" ]
[ "from setuptools import setup, find_packages\nfrom distutils.extension import Extension\nimport os.path\nimport sys\nimport numpy\n\n# icedagcon has been replaced by pbdagcon since SMRTAnalysis 2.3.\n# The pseudo namespace 'pbtools' has been removed and the main entry\n# script has changed from pbtranscript.py to p...
[ [ "numpy.get_include" ] ]
yijingchen/RnnTestRepo
[ "54dc7a36c1e80d43216fa010593a1be7e1abb1d4" ]
[ "common/utils.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\nfrom collections import UserDict\n\ndef load_data():\n \"\"\"Load the GEFCom 2014 energy load data\"\"\"\n\n data_dir = 'data/'\n energy = pd.read_csv(os.path.join(data_dir, 'energy.csv'), parse_dates=['timestamp'])\n\n # Reindex the dataframe such th...
[ [ "pandas.melt", "pandas.MultiIndex.from_tuples", "numpy.transpose" ] ]
flatironinstitute/catvae
[ "003a46682fc33e5b0d66c17e85e59e464a465c53" ]
[ "catvae/models/linear_cat_vae.py" ]
[ "import torch\nimport torch.nn as nn\nfrom gneiss.cluster import random_linkage\nfrom gneiss.balances import sparse_balance_basis\nfrom scipy.sparse import coo_matrix\nimport numpy as np\nfrom torch.distributions import Multinomial, Normal\nfrom catvae.composition import ilr\nfrom catvae.distributions.mvn import Mu...
[ [ "torch.nn.Linear", "torch.zeros", "numpy.log", "torch.nn.Sequential", "torch.distributions.Normal", "torch.ones", "torch.tensor", "torch.nn.Softplus", "torch.exp", "numpy.vstack" ] ]
erlendve/catalyst
[ "463575bc23c0abd1287f8ec81c4377baabf2b8b8" ]
[ "tests/exchange/test_suites/test_suite_exchange.py" ]
[ "import json\nimport os\nimport random\nfrom logging import Logger, WARNING\nfrom time import sleep\n\nimport pandas as pd\nfrom catalyst.assets._assets import TradingPair\nfrom logbook import TestHandler\n\nfrom catalyst.exchange.exchange_errors import ExchangeRequestError\nfrom catalyst.exchange.exchange_executio...
[ [ "pandas.date_range", "pandas.Timestamp.utcnow", "pandas.Series" ] ]
PadmajaVB/CycleGAN-TensorFlow
[ "d42eedd72f3b3e043e710ba845ef9f4912ec18d0" ]
[ "ops.py" ]
[ "import tensorflow as tf\n\n\n## Layers: follow the naming convention used in the original paper\n### Generator layers\ndef c7s1_k(input, k, reuse=False, norm='instance', activation='relu', is_training=True, name='c7s1_k'):\n \"\"\" A 7x7 Convolution-BatchNorm-ReLU layer with k filters and stride 1\n Args:\n ...
[ [ "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.nn.relu", "tensorflow.sigmoid", "tensorflow.compat.v1.layers.batch_normalization", "tensorflow.compat.v1.variable_scope", "tensorflow.math.log", "tensorflow.nn.moments", "tensorflow.nn.conv2d_transpose", ...
cycomanic/pyqtgraph
[ "108b115aa56c5fc8fd7a398f26e705b8f8717c0f", "108b115aa56c5fc8fd7a398f26e705b8f8717c0f" ]
[ "pyqtgraph/graphicsItems/GraphItem.py", "pyqtgraph/graphicsItems/ROI.py" ]
[ "from .. import functions as fn\nfrom .GraphicsObject import GraphicsObject\nfrom .ScatterPlotItem import ScatterPlotItem\nimport pyqtgraph as pg\nimport numpy as np\n\n__all__ = ['GraphItem']\n\n\nclass GraphItem(GraphicsObject):\n \"\"\"A GraphItem displays graph information as\n a set of nodes connected by...
[ [ "numpy.any" ], [ "numpy.concatenate", "numpy.fromfunction" ] ]
hsuan81/2020spring_NTNU_IR
[ "72203bffd4595a6f435934bd80224d6726721223" ]
[ "HW1/test.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport math\ndef split_file(file):\n answer = [[]]\n j = 0\n for i in file:\n if i == \"\\n\":\n j += 1\n if j == 16:\n pass\n else:\n answer.append([])\n elif i[:3] == \"VOM\"...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
cremerlab/ltee_diauxie
[ "69eae1857ff93c512d79d12489a287a24351e336" ]
[ "diaux/fitderiv.py" ]
[ "import numpy as np\nfrom . import gaussianprocess as gp\nimport matplotlib.pyplot as plt\n\n#####\ndef findsmoothvariance(y, filtsig= 0.1, nopts= False):\n '''\n Estimates and then smooths the variance over replicates of data\n\n Arguments\n --\n y: data - one column for each replicate\n filtsig:...
[ [ "numpy.tile", "numpy.min", "numpy.mean", "numpy.exp", "matplotlib.patches.Ellipse", "numpy.size", "numpy.max", "numpy.log", "pandas.DataFrame", "numpy.nonzero", "numpy.argmax", "numpy.transpose", "numpy.sqrt", "numpy.arange", "numpy.column_stack", "n...