repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
MECH3750/2021-Tutorials | [
"e813f2a97d9b71ad0e304a35e8c66d21ed63ee0c"
] | [
"Week_01/ict01FirstDerivatives.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 26 21:30:23 2021\n\n@author: uqcleon4\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Define functions and their derivatives\ndef f1(x):\n return x*x*x\n\ndef f2(x):\n return 3*x*x - 2*x\n\ndef f3(x):\n return np.sin(x)\n\ndef f1Prime... | [
[
"numpy.sin",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.empty_like"
]
] |
allswellthatsmaxwell/surrogates | [
"840e011459aa690f30dc1816c19f50c7ee75db37"
] | [
"surrogates/ch01_problem01.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: ch01_problem01.ipynb (unless otherwise specified).\n\n__all__ = ['length', 'DataManager', 'attach_std', 'plot_scatter', 'plot_predictions_actual',\n 'plot_predictions_residuals', 'plot_predictions', 'wires_facet_theme']\n\n# Cell\n#export\nfrom nbdev.showdoc im... | [
[
"numpy.square",
"sklearn.linear_model.LinearRegression",
"pandas.DataFrame",
"numpy.mean",
"numpy.std",
"numpy.sqrt",
"pandas.concat",
"pandas.read_csv"
]
] |
originalpkbims/dash-apps | [
"ea84cbd3e7227fb3de40cd16000838dd088343c7"
] | [
"src/apps/tco2_dashboard/helpers.py"
] | [
"import pandas as pd\nimport datetime as dt\nimport os\nimport json\n\n\ndef pct_change(first, second):\n diff = second - first\n change = 0\n try:\n if diff > 0:\n change = (diff / first) * 100\n elif diff < 0:\n diff = first - second\n change = -((diff / fir... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.DateOffset"
]
] |
gwarmstrong/microsetta-public-api | [
"53fe464aef6df13edb48a781bad6fe6f42f7251b"
] | [
"microsetta_public_api/utils/testing.py"
] | [
"import functools\nimport json\nimport types\nimport tempfile\nfrom unittest.case import TestCase\nfrom unittest.mock import patch\nimport pandas as pd\nimport numpy as np\nimport biom\nfrom qiime2 import Metadata, Artifact\n\n\nimport microsetta_public_api\nimport microsetta_public_api.server\nimport microsetta_pu... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.random.seed",
"pandas.DataFrame",
"pandas.Series",
"numpy.random.multinomial"
]
] |
simonaxelrod/chemprop | [
"1c1090fb894c9f951f5c85600d447af52c7d7a8b"
] | [
"chemprop/args.py"
] | [
"import json\nimport os\nfrom tempfile import TemporaryDirectory\nimport pickle\nfrom typing import List, Optional, Tuple\nfrom typing_extensions import Literal\n\nimport torch\nfrom tap import Tap # pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)\n\nfrom chemprop.data impor... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.cuda.device_count"
]
] |
lyronctk/quant-noisier-speech | [
"cf47a0f1542e51b1ad7c3d43e0266c3592a222f9"
] | [
"src/models/tasks.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass TaskTypePredictor(nn.Module):\n\n def __init__(self, input_dim, task_type_num_classes):\n super().__init__()\n self.task_fc = nn.Linear(input_dim, task_type_num_classes)\n self.task_type_num_classes = task_type_... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.functional.log_softmax",
"torch.nn.functional.nll_loss",
"torch.mean",
"torch.sum"
]
] |
victor-axelsson/SimAPI | [
"0d4511ae75d35f10a5ca2b9feb41af193cce9639"
] | [
"helpers/cache/cache.py"
] | [
"\"\"\"\nThe MIT License (MIT)\nCopyright (c) 2018 Victor Axelsson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, c... | [
[
"numpy.load"
]
] |
ydlstartx/gluon-cv | [
"0645707fdc4d90210b216ec8b023e2c4e4332a5c"
] | [
"scripts/tracking/test.py"
] | [
"\"\"\" SiamRPN test\nCode adapted from https://github.com/STVIR/pysot\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nimport argparse\nimport os\nimport numpy as np\nimport mxnet as mx\nfrom gluoncv.mode... | [
[
"numpy.array"
]
] |
nunorc/astromlp-models | [
"32356d50f9aa45c123df51cdaffb5547c4791248"
] | [
"f2r/train.py"
] | [
"\nimport sys, os\nimport tensorflow as tf\nimport mlflow.keras\n\nfrom astromlp.sdss.helper import Helper\nfrom astromlp.sdss.utils import train_val_test_split, history_fit_plots, my_callbacks\nfrom astromlp.sdss.datagen import DataGen\n\nimport f2r\n\nmlflow.tensorflow.autolog(log_models=False)\nmlflow.set_tag('m... | [
[
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.optimizers.RMSprop"
]
] |
xujun05/nzl | [
"6633777b901359bb053d46ea920281da016b9bf4"
] | [
"zipline/examples/buy_and_hold.py"
] | [
"#!/usr/bin/env python\n#\n# Copyright 2015 Quantopian, 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 requir... | [
[
"pandas.Timestamp"
]
] |
jozef-piechaczek/github-roles-miner | [
"959053eca402fef8c8ef964e86dd1304ea192748"
] | [
"step4_model/src/tasks.py"
] | [
"import itertools\nfrom threading import Thread\n\nfrom sklearn.multioutput import ClassifierChain\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.neighbors import KNeighborsClassifier\n\nfrom data import *\nfrom utils import *\n\n\n# RQ.1: How accurate are machine learning classifiers in identifyin... | [
[
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.neural_network.MLPClassifier"
]
] |
naver-ai/calm | [
"d77b46a047e1b27614b1624d031d52463acbfea0"
] | [
"eval_remove_classify.py"
] | [
"\"\"\"\nCALM\nCopyright (c) 2021-present NAVER Corp.\nMIT license\n\"\"\"\n\nimport os\nimport pickle\nimport torch\n\nfrom util import get_scoremaps\nfrom util import get_baseline\nfrom util import resize_scoremaps\nfrom util import get_topk_to_zero_mask\nfrom util import random_mask_generator\nfrom main import T... | [
[
"torch.no_grad"
]
] |
tobyfrancis/pymicro | [
"5c2ed0bb6990463ea6ee59586c9f59cd9b7b13ba"
] | [
"examples/plotting/field_pole_figure.py"
] | [
"from pymicro.crystal.microstructure import *\nfrom pymicro.crystal.texture import *\nfrom matplotlib import pyplot as plt, colors, colorbar, cm\n\nif __name__ == '__main__':\n '''This example demonstrate how a field can be used to color each\n symbol on the pole figure with the :py:meth:~`pymicro.crystal.tex... | [
[
"matplotlib.image.thumbnail",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.colors.Normalize",
"matplotlib.colorbar.ColorbarBase"
]
] |
isadorafaggiani/Deteccao | [
"fa8c286a7e2e338a8e4eaca39e8bd029169de9e6"
] | [
"exibicao.py"
] | [
"import numpy as np\nimport pandas as pd\nimport seaborn as sns\nsns.set_theme()\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport tkinter as tk\nfrom tkinter import filedialog as fd\nfrom datetime import datetime, timedelta\nfrom scipy.stats import iqr\n\ndef freedman_diaconis_rule(coords):\n... | [
[
"scipy.stats.iqr",
"numpy.max",
"numpy.min"
]
] |
idahopotato1/notebooks | [
"453598a48f984ea379379c27ec8883cb6d99da83"
] | [
"notebooks/twitter/util/utils.py"
] | [
"import pandas as pd\nfrom sklearn.preprocessing import StandardScaler\nfrom statsmodels.stats.stattools import durbin_watson\nfrom statsmodels.tsa.api import VAR\nfrom statsmodels.tsa.stattools import adfuller\nimport scipy.stats as stats\nimport numpy as np\n\n\ndef augmented_dickey_fuller_statistics(\n coin, ... | [
[
"pandas.to_datetime",
"scipy.stats.normaltest",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"pandas.date_range",
"numpy.mean",
"scipy.stats.skew",
"numpy.stack",
"numpy.abs",
"pandas.concat",
"numpy.corrcoef",
"scipy.stats.kurtosis"
]
] |
pravee2019/Movielense | [
"795ab794937e6c858d5d04b09c9f4bed8998ead4"
] | [
"grading.py"
] | [
"#!/usr/bin/env python\n\nimport pandas as pd\n\nsubmission = pd.read_csv('submission.csv') # Learner's submission File\nrubric = pd.read_csv('rubric.csv') # Rubric from edX\n\n\n# If the learner's answer equal to rubric in each row, get 1 points\n\nScore=[]\nmatches=0\nfor x,y in zip(submission.rating, rubric.rati... | [
[
"pandas.read_csv"
]
] |
benfknzen/ml-agents | [
"d76bea75a2eb9b0b9429bd912cc7f72686a9896e"
] | [
"ml-agents/mlagents/trainers/buffer.py"
] | [
"import numpy as np\nimport h5py\nfrom typing import List, BinaryIO\n\nfrom mlagents_envs.exception import UnityException\n\n\nclass BufferException(UnityException):\n \"\"\"\n Related to errors with the Buffer.\n \"\"\"\n\n pass\n\n\nclass AgentBuffer(dict):\n \"\"\"\n AgentBuffer contains a dict... | [
[
"numpy.array",
"numpy.random.randint",
"numpy.random.shuffle"
]
] |
ayushbaid/cloudy-cycle-gans | [
"dfd8481d739ad033d40bbe4ac01b5d0fce4df9f2"
] | [
"utils/buffer.py"
] | [
"import random\n\nimport torch\n\nfrom torch.autograd import Variable\n\n\nclass ImageBuffer(object):\n '''\n Implement the image buffer to be used in training\n\n With p=0.35, return the input images; otherwise return data from buffer and replace them with input\n '''\n # TODO: write tests\n\n def __init__(s... | [
[
"torch.cat",
"torch.unsqueeze"
]
] |
Dhairya1510/pre_react_hover_net | [
"81b1cbe3930a07892b79004eca140ff8a5c0ae76"
] | [
"dataloader/train_loader.py"
] | [
"import csv\nimport glob\nimport os\nimport re\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.io as sio\nimport torch.utils.data\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\nfrom misc.utils import cropping_center\n\nfrom .augs import (\n add_to_brightness,\n ... | [
[
"numpy.array",
"numpy.arange",
"numpy.load"
]
] |
alex-medvedev-msc/ukb_loader | [
"4940f3859eb1cc167bd768def97ce8d55c14892b"
] | [
"src/ukb_loader/load.py"
] | [
"import numpy\nimport pandas\nfrom typing import List, Tuple\nimport zarr\nimport os\n\n\nclass UKBDataLoader():\n def __init__(self, data_dir: str, split: str, phenotype_id: str, features: List[str], array_agg_func='mean') -> None:\n \n self.dataset = zarr.open_group(os.path.join(data_dir, split),... | [
[
"numpy.concatenate",
"numpy.isnan",
"numpy.nanmean",
"numpy.argmax",
"numpy.arange",
"numpy.hstack",
"numpy.column_stack",
"numpy.nanmax",
"numpy.vstack"
]
] |
hoanghungict/TensorFlow-Deep-Learning-Projects | [
"27d0bd456ea1e28823d4a03b996776a8107bb2a1"
] | [
"Chapter05/6_rnn_stock_price_tensorboard.py"
] | [
"import datetime\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nfrom evaluate_ts import evaluate_ts\nfrom tensorflow.contrib import rnn\nfrom tools import fetch_stock_price, format_dataset\n\ntf.reset_default_graph()\ntf.set_random_seed(101)\nnp.random.seed(101)\n\n# Set... | [
[
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.matmul",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"tensorflow.abs",
"tensorflow.zeros",
"tensorflow.summary.scalar",
"tensorflow.Session",
"matplotlib.pyplot.title",
"tensorflow.truncated_no... |
chensming/HeyConstitution | [
"f208127d4428d887d427f6f73360aa02e944229b"
] | [
"mini-program/model/imageClassification/TongueClassification.py"
] | [
"import torch\nfrom torch.autograd import Variable\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import StepLR\nfrom torchvision import datasets, transforms, models\nfrom torchvision.datasets impo... | [
[
"torch.nn.Linear",
"torch.device",
"torch.flatten",
"torch.max",
"torch.no_grad",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.load",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2d",
"t... |
leomariga/py3DRanSAC | [
"9eda322a6ec81074ad171185e44f2a7e8ec2d583"
] | [
"pyransac3d/plane.py"
] | [
"import random\n\nimport numpy as np\n\n\nclass Plane:\n \"\"\"\n Implementation of planar RANSAC.\n\n Class for Plane object, which finds the equation of a infinite plane using RANSAC algorithim.\n\n Call `fit(.)` to randomly take 3 points of pointcloud to verify inliers based on a threshold.\n\n ![... | [
[
"numpy.linalg.norm",
"numpy.multiply",
"numpy.abs",
"numpy.sqrt",
"numpy.cross"
]
] |
royvelich/deep-signature | [
"48f05d3e8482f92094158ed4265fcdf2d76569f2"
] | [
"applets/playgrounds/plots_playground.py"
] | [
"# python peripherals\nimport random\nimport os\nimport sys\nimport math\nsys.path.insert(1, os.path.join(sys.path[0], '../..'))\n\n# numpy\nimport numpy\n\n# pandas\nimport pandas\n\n# ipython\nfrom IPython.display import display, HTML\n\n# matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as t... | [
[
"torch.device",
"numpy.random.seed",
"matplotlib.pyplot.get_cmap",
"numpy.load",
"numpy.random.shuffle",
"torch.load",
"torch.set_default_dtype"
]
] |
NeuroDataDesign/pyautomagic | [
"f03af3f4f0cf859c11d03623d9d2b51f1546b6d7"
] | [
"tests/pyautomagic/test_performEOGRegression.py"
] | [
"import logging\n\nimport numpy as np\nimport pytest\n\n\ndef performEOGRegression(eeg, eog, *args):\n \"\"\"Performs linear regression to remove EOG artifact from the EEG data\n\n Parameters\n ----------\n eeg: np.ndarray\n EEG signal with the EOG artifacts\n eog: np.ndarray\n EOG sign... | [
[
"numpy.array",
"numpy.dot",
"numpy.shape",
"numpy.subtract",
"numpy.transpose"
]
] |
iArunava/IMDB-Sentiment-Analysis-using-PyTorch | [
"cb026d32a928f8a21ed20c726bd86285e7bc0b04"
] | [
"train.py"
] | [
"import os\nimport subprocess\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom string import punctuation\nfrom collections import Counter\nfrom torch.utils.data import TensorDataset, DataLoader\nfrom SentimentRNN import SentimentRNN\nfrom test import test\n\ndef train(FLAGS):\n # download the files... | [
[
"numpy.array",
"numpy.mean",
"torch.from_numpy",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss"
]
] |
raymondng76/sgnlp | [
"f09eada90ef5b1ee979901e5c14413d32e758049"
] | [
"sgnlp/models/lsr/train.py"
] | [
"\"\"\"\nTraining or finetuning a LSR model on DocRED dataset.\n\"\"\"\nimport argparse\nimport csv\nimport json\nimport logging\nimport os\n\nimport numpy as np\nimport torch\nfrom sklearn import metrics\nfrom torch.utils.data.dataloader import DataLoader, default_collate\nfrom transformers import set_seed\n\nfrom... | [
[
"torch.sigmoid",
"torch.device",
"torch.optim.AdamW",
"torch.utils.data.dataloader.DataLoader",
"numpy.asarray",
"torch.optim.SGD",
"torch.optim.lr_scheduler.ExponentialLR",
"numpy.load",
"torch.optim.Adam",
"torch.optim.Adadelta",
"torch.optim.Adamax",
"torch.cuda.... |
kaniblu/pytorch-skipthoughts | [
"6ce13492dc6d4f0378ead8ec5aadb151cc79d93f"
] | [
"src/torchst/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as I\nimport torch.nn.utils.rnn as R\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom torchsru import SRU\n\n\ndef pad_batch(x, n, after=True):\n pad_shape = x.data.shape[1:]\n pad = x.data.new(n, *pad_shape).zero_()\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.init.orthogonal",
"torch.arange",
"torch.nn.init.xavier_normal",
"torch.autograd.Variable",
"torch.nn.functional.log_softmax",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.init.normal",
"torch.nn.utils.rnn.pack_padded_sequenc... |
happyxuwork/neural-networks-and-deep-learning | [
"f20353d9ff076699908675f67ecd3d7285caf160"
] | [
"fig/valley2.py"
] | [
"\"\"\"valley2.py\n~~~~~~~~~~~~~\n\nPlots a function of two variables to minimize. The function is a\nfairly generic valley function.\n\nNote that this is a duplicate of valley.py, but omits labels on the\naxis. It's bad practice to duplicate in this way, but I had\nconsiderable trouble getting matplotlib to upda... | [
[
"numpy.empty",
"matplotlib.pyplot.figure",
"matplotlib.ticker.LinearLocator",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.meshgrid"
]
] |
jack9950/reports | [
"5b113ddfb57914936438b8e6e594be02956e26d6"
] | [
"surveyemail.py"
] | [
"import csv\nimport os\nfrom surveyemaildata import agent_list\nimport pandas as pd\nimport numpy as np\n\n\n\n# fileLocation = 'C:\\\\Users\\\\Jackson.Ndiho\\\\Documents\\\\Sales\\\\MTD Detail - Jackson_18633_1504894770_2017-09-01_2017-09-08.csv'\nfileLocation = 'C:\\\\Users\\\\Jackson.Ndiho\\\\Documents\\\\Sales\... | [
[
"pandas.read_excel",
"pandas.pivot_table"
]
] |
vincentlui/megae | [
"16b8d29377e3180447b03cb8f5120e9e086ad56d",
"16b8d29377e3180447b03cb8f5120e9e086ad56d"
] | [
"envs/goalgan/ant_maze/__init__.py",
"envs/goalgridworld/goal_grid.py"
] | [
"# Copyright (c) 2019, salesforce.com, inc.\n# All rights reserved.\n# SPDX-License-Identifier: MIT\n# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n\nfrom envs.goalgan.ant_maze.create_maze_env import create_maze_env\n\nimport gym\nimport numpy as np\nimport to... | [
[
"numpy.iinfo",
"numpy.allclose",
"numpy.array",
"numpy.linalg.norm"
],
[
"matplotlib.pyplot.clim",
"numpy.zeros",
"numpy.sum",
"numpy.copy",
"numpy.eye",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.clf",
"matp... |
ZeayW/graph-contrastive-learning | [
"b8952b677ec30110f8a616ba7162ae738d5d4052"
] | [
"util/t-SNE.py"
] | [
"# yellowbrick.text.tsne\n# Implements TSNE visualizations of documents in 2D space.\n#\n# Author: Benjamin Bengfort\n# Author: Rebecca Bilbro\n# Created: Mon Feb 20 06:33:29 2017 -0500\n#\n# Copyright (C) 2016 The scikit-yb developers\n# For license information, see LICENSE.txt\n#\n# ID: tsne.py [6aa9198] ben... | [
[
"numpy.array",
"sklearn.manifold.TSNE",
"torch.cuda.is_available",
"sklearn.pipeline.Pipeline",
"numpy.unique"
]
] |
Maqingyang/track_3d_human | [
"fd85f07a9a42df52b1f7dbe06f5752f0a91b5777"
] | [
"demo_mot.py"
] | [
"\"\"\"\nDemo code\n\nTo run our method, you need a bounding box around the person. The person needs to be centered inside the bounding box and the bounding box should be relatively tight. You can either supply the bounding box directly or provide an [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpo... | [
[
"torch.device",
"numpy.array",
"numpy.dot",
"torch.stack",
"numpy.ones_like",
"torch.no_grad",
"torch.from_numpy",
"numpy.radians",
"torch.cuda.is_available",
"torch.load"
]
] |
ztfmars/OpenCV_Tutorial | [
"2c9cf57f469dfec2aca8356f59f7473e5a506988"
] | [
"py_simple/15.傅里叶变换/15多个正弦曲线-相位.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 11 07:38:43 2018\n\n\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nx=np.arange(0,2*np.pi*8,0.01)\ny=3*np.sin(0.8*x)+7*np.sin(1/3*x+2)+2*np.sin(0.2*x+3)\n\ny1=3*np.sin(0.8*x)\ny2=7*np.sin(0.5*x+2)\ny3=2*np.sin(0.2*x+3)\n\nplt.subplot(221)\nplt.pl... | [
[
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
MSimoncelli/phono3py | [
"b28b45a025c279833e9269e5d91330c75d3f6ae0"
] | [
"phono3py/api_phono3py.py"
] | [
"\"\"\"Phono3py main class.\"\"\"\n# Copyright (C) 2016 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phono3py.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of sour... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.arange",
"numpy.hstack",
"numpy.linalg.inv"
]
] |
matthewjones372/winning-ticket-search | [
"17b5e5dbb35c31de37232418ce53dd712ade5619"
] | [
"lottery/metrics/DataLogger.py"
] | [
"import csv\nimport os\nfrom typing import Mapping, List\n\nimport pandas as pd\n\n\nclass DataLogger:\n def __init__(self, headers: List[str], file_name: str, base_path: str):\n self.base_path = base_path\n self.file_name = file_name\n self.file_path = os.path.join(self.base_path, self.file... | [
[
"pandas.read_csv"
]
] |
shmillo/SimplePythonExamples | [
"1ed23af998220448c510cebc03af5ccdbd37a131"
] | [
"simplePhysics/DiscreteGradient/1D/oneDimensionalGradient.py"
] | [
"import matplotlib.pyplot as mplt\nimport numpy as np\n\ndef f(x):\n return x**2.0\n\ndef oneDGradient(vals, dx):\n\n n = len(vals)\n grad = [0.0] * n\n\n #forward difference for outer bounds\n grad[0] = (vals[1] - vals[0]) / dx\n for i in range(1, n - 1):\n #central difference now that dat... | [
[
"numpy.gradient",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
touqir14/Scipy_dev | [
"38ff2a484d6d268de8f0fb745fafa9ac3acb98bb"
] | [
"LP_presolve/_matrix_compress.py"
] | [
"import numpy as np\nimport random\nimport time\nfrom scipy.sparse import random as sparse_random\nfrom scipy import stats\nimport rref\nimport scipy.linalg.interpolative as ID\nfrom scipy.linalg import qr\n# import rref_cy.rref_cy as rref\n\ndef _build_magical_graph(num_nodes_X, num_groups_Y):\n \"\"\"\n Bui... | [
[
"numpy.random.normal",
"numpy.dot",
"numpy.linalg.matrix_rank",
"numpy.zeros",
"numpy.ones",
"scipy.linalg.interpolative.interp_decomp",
"numpy.random.shuffle",
"numpy.allclose",
"numpy.random.uniform",
"numpy.arange",
"scipy.linalg.qr",
"numpy.linalg.svd"
]
] |
adrielyeung/computational-physics | [
"c34c881b2e6ff29aebce6d0eb6d8d8404648ec71"
] | [
"Test2.py"
] | [
"import Matrix_2 as M2\r\nimport imp\r\nimp.reload(M2)\r\nimport numpy as np\r\nimport scipy as sp\r\n\r\nA = np.matrix([[2,1,0,0,0],[3,8,4,0,0],[0,9,20,10,0],[0,0,22,51,-25],[0,0,0,-55,60]],dtype=float)\r\n\r\nprint(M2.LU(A, False))\r\n\r\n#[[ 2. 1. 0. 0. 0. ]\r\n# [... | [
[
"numpy.array",
"numpy.matrix",
"numpy.dot",
"numpy.linalg.det",
"scipy.linalg.lu"
]
] |
Anthony-MostlyHarmless/trimesh | [
"0379562aac88bb53fc658ce722d2aeb28d62eb23"
] | [
"trimesh/nsphere.py"
] | [
"\"\"\"\nnsphere.py\n--------------\n\nFunctions for fitting and minimizing nspheres (circles, spheres,\nhyperspheres, etc.)\n\"\"\"\nimport numpy as np\n\nfrom . import convex\n\nfrom .constants import log, tol\n\ntry:\n from scipy import spatial\n from scipy.optimize import leastsq\nexcept ImportError:\n ... | [
[
"scipy.spatial.Voronoi",
"numpy.linalg.norm",
"numpy.mean",
"scipy.optimize.leastsq",
"numpy.sqrt"
]
] |
agemagician/transformers | [
"666220fc6417505607148ffb19d172d5732e860a",
"666220fc6417505607148ffb19d172d5732e860a"
] | [
"tests/test_modeling_tf_dpr.py",
"src/transformers/testing_utils.py"
] | [
"# coding=utf-8\n# Copyright 2020 Huggingface\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... | [
[
"tensorflow.constant",
"tensorflow.saved_model.save",
"tensorflow.keras.models.load_model"
],
[
"tensorflow.config.list_physical_devices",
"torch.cuda.is_available",
"torch.cuda.device_count"
]
] |
Covac/WaveRNN | [
"a9758caf30022064c604438a0766cad25046c5eb"
] | [
"models/tacotron.py"
] | [
"import os\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pathlib import Path\nfrom typing import Union\n\n\nclass HighwayNetwork(nn.Module):\n def __init__(self, size):\n super().__init__()\n self.W1 = nn.Linear(size, size)\n self.W2 = nn.Lin... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.load",
"torch.nn.MaxPool1d",
"torch.sigmoid",
"torch.nn.Conv1d",
"torch.tensor",
"torch.nn.functional.relu",
"torch.as_tensor",
"torch.zeros",
"torch.nn.LSTMCell",
"torch.nn.functi... |
winsphinx/covid-us | [
"d4715b186747211dc41d2130237be8dd9791a520"
] | [
"covid.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport codecs\nimport os\nimport re\nfrom concurrent.futures import ProcessPoolExecutor\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom pmdarima import arima\nfrom pmdarima.model_selection import train_test_split\nfrom sklearn.metrics import r2_score\... | [
[
"pandas.Timedelta",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"pandas.Series",
"sklearn.metrics.r2_score",
"pandas.read_csv",
"matplotlib.pyplot.ticklabel_format"
]
] |
Bhaskers-Blu-Org2/solution-accelerator-many-models | [
"cef1226195313fecaabce9f107544befbb3b8125"
] | [
"Custom_Script/scripts/timeseries_utilities.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.pipeline import Pipeline\n\n\nclass ColumnDropper(TransformerMixin, BaseEstimator):\n \"\"\"\n Tran... | [
[
"pandas.concat",
"sklearn.pipeline.Pipeline",
"pandas.Series"
]
] |
Jirka-Mayer/BachelorThesis | [
"b5333cb0ac5f6defa8e78573f8da6bcbf97b2bad"
] | [
"mashcima/debug.py"
] | [
"import numpy as np\nimport cv2\n\n\ndef show_images(images, row_length=5):\n \"\"\"For debugging - shows many images in a single plot\"\"\"\n import matplotlib.pyplot as plt\n\n n_total = len(images)\n n_rows = n_total // row_length + 1\n n_cols = min(n_total, row_length)\n fig = plt.figure()\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.figure"
]
] |
jsuarez5341/PettingZoo | [
"0cef616c311c59b592d8639dfe586fba4a9a61a0"
] | [
"pettingzoo/butterfly/pistonball/pistonball.py"
] | [
"import math\nimport os\n\nimport gym\nimport numpy as np\nimport pygame\nimport pymunk\nimport pymunk.pygame_util\nfrom gym.utils import EzPickle, seeding\n\nfrom pettingzoo import AECEnv\nfrom pettingzoo.utils import agent_selector, wrappers\nfrom pettingzoo.utils.conversions import parallel_wrapper_fn\n\nfrom .m... | [
[
"numpy.rot90",
"numpy.array",
"numpy.sin",
"numpy.asarray",
"numpy.arange",
"numpy.transpose",
"numpy.cos",
"numpy.fliplr"
]
] |
stellaraccident/jax | [
"655a3e79c23060e87595d4a52dc595352fa29c9b"
] | [
"docs/autodidax.py"
] | [
"# ---\n# Copyright 2021 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"numpy.testing.assert_allclose",
"numpy.negative",
"numpy.multiply",
"numpy.cos",
"numpy.size",
"numpy.broadcast_to",
"numpy.dtype",
"numpy.sin",
"numpy.less",
"numpy.arange",
"numpy.transpose",
"numpy.ndim",
"numpy.greater",
"numpy.expand_dims",
"numpy.... |
sakshigarg1098/JointBert-CRF | [
"d69fc3ff40fa1fb61c9177ab0145fc24d0c2d0e8"
] | [
"model/modeling_jointbert.py"
] | [
"import torch\nimport torch.nn as nn\nfrom transformers.modeling_bert import BertPreTrainedModel, BertModel, BertConfig\nfrom torchcrf import CRF\nfrom .module import IntentClassifier, SlotClassifier\n\n\nclass JointBERT(BertPreTrainedModel):\n def __init__(self, config, args, intent_label_lst, slot_label_lst):\... | [
[
"torch.zeros",
"torch.nn.MSELoss",
"torch.nn.CrossEntropyLoss",
"torch.argmax"
]
] |
jiangwei221/COTR-1 | [
"96abd8f95e23c7bf4d04811db6dd131887a2f37a"
] | [
"COTR/inference/refinement_task.py"
] | [
"import time\n\nimport numpy as np\nimport torch\nfrom torchvision.transforms import functional as tvtf\nimport imageio\nimport PIL\n\nfrom COTR.inference.inference_helper import BASE_ZOOM, THRESHOLD_PIXELS_RELATIVE, get_patch_centered_at, two_images_side_by_side, find_prediction_loop\nfrom COTR.utils import debug_... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.prod",
"numpy.sqrt"
]
] |
R-abodyak/PalPose | [
"032565a2f951c8825af562b3593bde3fdbfba082"
] | [
"depthai_helpers/utils.py"
] | [
"import importlib\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nimport depthai as dai\n\n\ndef cos_dist(a, b):\n return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))\n\n\ndef frame_norm(frame, bbox):\n norm_vals = np.full(len(bbox), frame.shape[0])\n norm_vals[::2] = frame.shape[1]\... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
]
] |
jlbbj111/2019-Software-Engineering-Curriculum-Design | [
"a55deabaf00220c5ffb531c6e40ed9edb8063062"
] | [
"EMS/courseScheduling/Schedule.py"
] | [
"import numpy as np\nimport heapq\n# 输入\nfrom courseScheduling.models import MajorCourses as MajorCourses\nfrom courseScheduling.models import Teaching as original_Teaching\nfrom backstage.models import ClassRoom, Student, AdmClass, MajorPlan\nfrom courseSelection.models import CourseSelected as courseSelected\n# f... | [
[
"numpy.zeros"
]
] |
AmurG/SPFlow | [
"ab28dd4af9ed722ace69c6b290cf0a279bbda39e"
] | [
"src/spn/structure/prometheus/data.py"
] | [
"# Some helper functions to make the entire thing run\nimport spn.structure.prometheus.nodes\nimport math\nimport numpy as np\nimport scipy\nimport scipy.cluster.hierarchy as hcluster\nfrom scipy.cluster.vq import vq, kmeans, whiten\n\n# Converts array indices from function-level indices to global-level objective i... | [
[
"numpy.where",
"numpy.asarray",
"numpy.shape"
]
] |
rdacomp/pysc2 | [
"d1e7700762723e1ad55bcea4dbb5cc95bcf86e65"
] | [
"pysc2/lib/renderer_human.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"numpy.array"
]
] |
robertcdickson/pymatgen | [
"fb65122a7c471b9ffd0d01f2341339fb1dee2af1"
] | [
"pymatgen/analysis/structure_analyzer.py"
] | [
"# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module provides classes to perform topological analyses of structures.\n\"\"\"\n\n__author__ = \"Shyue Ping Ong, Geoffroy Hautier, Sai Jayaraman\"\n__copyright__ = \"Copyright 2011, The Materials Project\"... | [
[
"numpy.dot",
"numpy.mean",
"numpy.where",
"numpy.max",
"numpy.linalg.norm",
"numpy.cross",
"numpy.array",
"scipy.spatial.Voronoi",
"numpy.reshape",
"numpy.zeros",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.ceil"... |
zhu-eric/ray | [
"8903bcd0c325f76f2642eb542140bdde5a94f7ac"
] | [
"python/ray/tests/test_basic.py"
] | [
"# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nfrom concurrent.futures import ThreadPoolExecutor\nimport glob\nimport json\nimport logging\nfrom multiprocessing import Process\nimport os\nimport random\nimport r... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.int8",
"numpy.uint8",
"numpy.uint32",
"numpy.zeros",
"numpy.testing.assert_equal",
"pandas.DataFrame",
"numpy.random.permutation",
"numpy.ones",
"numpy.int64",
"numpy.float64",
"numpy.float32",
"numpy.random.unifo... |
safeechowdhury/sphere_charts | [
"633e7a7e3cd2f199dbd5bbc824bc3a9c1aa82722"
] | [
"nba_shot_charts.py"
] | [
"\"\"\"\nThis script produces NBA Shot Charts\n\"\"\"\n# %% IMPORTS ===========================================================================================================\nfrom nba_api.stats.endpoints import shotchartdetail as scd\nimport logging\nimport os\nimport warnings\nimport matplotlib.pyplot as plt\nfr... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.hexbin",
"pandas.merge",
"matplotlib.pyplot.gca",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.patches.Ci... |
Steffy-zxf/models | [
"9952b253645c03709d301788ab91e3c6a2c94670"
] | [
"PaddleCV/yolov3/eval.py"
] | [
"# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.\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 require... | [
[
"numpy.array"
]
] |
tianyu-lu/latent_ode | [
"1a9e9415eda1837ed78e50009752b90eda3ca0db"
] | [
"lib/latent_ode.py"
] | [
"###########################\n# Latent ODEs for Irregularly-Sampled Time Series\n# Author: Yulia Rubanova\n###########################\n\nimport numpy as np\nimport sklearn as sk\nimport numpy as np\n#import gc\nimport torch\nimport torch.nn as nn\nfrom torch.nn.functional import relu\n\nimport lib.utils as utils\n... | [
[
"torch.zeros",
"torch.cat",
"torch.isnan",
"torch.sum"
]
] |
ALLYOURSR/loud-light | [
"5b6ad910fdcf56a17d675883022785401cf11ece"
] | [
"docs/plot_generator.py"
] | [
"import matplotlib.pyplot as plt\nimport math\nimport numpy as np\n\nxvals = np.arange(0, 300, .5)\n\nperception_yvals = np.zeros(xvals.shape)\noutput_yvals = np.zeros(xvals.shape)\n\nfor i in range(len(xvals)):\n x = xvals[i]\n perception_yvals[i] = (math.log(x + 1)/.055452)\n output_yvals[i] = math.exp(.... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
AstroBarker/thornado_tools | [
"553fb91910e2b93390629fb77253be2a7e8ac9b2"
] | [
"plot/plot_thor2d.py"
] | [
"###############################################################################\n#\n# Quick plotting script for plotting 2D thornado data.\n#\n# Syntax is `python plot_thor1d.h5 file.h5 field`, e.g., \n# plot_thor1d.py Output/Jet_FluidFields_000010.h5 uCF_D\n#\n####################################################... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.log10"
]
] |
ysfjoe/Improving-learning-from-imbalanced-data-using-CGANs-Credit-card-fraud-detection-case-study | [
"f35ec4bd9638cc8c337ded33cd8d84e0dd1895aa"
] | [
"utils_fraud.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.metrics import classification_report,accuracy_score, confusion_matrix,f1_score, roc_auc_score, roc_curve, precision_recall_curve, auc, balanced_accuracy_score, fbeta_score, recall_score, precision_score\nf... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.RobustScaler",
"numpy.where",
"sklearn.feature_selection.f_classif",
"numpy.concatenate",
"numpy.random.normal",
"sklearn.metrics.precision_recall_curve",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.fbeta_score",... |
code-kage/albumentations | [
"f2462be3a4d01c872474d0e7fc0f32f387b06340"
] | [
"tests/test_pytorch.py"
] | [
"import pytest\n\nimport numpy as np\nimport torch\n\nimport albumentations as A\nfrom albumentations.pytorch.transforms import ToTensor, ToTensorV2\n\n\ndef test_torch_to_tensor_v2_augmentations(image, mask):\n aug = ToTensorV2()\n data = aug(image=image, mask=mask, force_apply=True)\n height, width, num_... | [
[
"numpy.random.randint",
"numpy.array_equal"
]
] |
neerakara/Adaptive_batch_norm_for_segmentation | [
"6e7591c995b63352c58f2b4e68082e9db4e85b7d"
] | [
"data_hcp.py"
] | [
"import os\nimport glob\nimport numpy as np\nimport logging\n# import modules required for reading through layered zip directories\nimport zipfile, re\n# import image and other utility functions\nimport utils\nimport config.system as sys_config\n\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s %(messag... | [
[
"numpy.array",
"numpy.load",
"numpy.save",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplot"
]
] |
PiRSquared17/r-orange | [
"6bc383f1db3c10c59e16b39daffc44df904ce031"
] | [
"rpy3-setup/rpy/rinterface/tests/test_SexpVectorNumeric.py"
] | [
"import unittest\nimport itertools\nimport rpy3.rinterface as rinterface\n\n\ntry:\n import numpy\n has_Numpy = True\nexcept ImportError:\n hasNumpy = False\n\n\nrinterface.initr()\n\ndef floatEqual(x, y, epsilon = 0.00000001):\n return abs(x - y) < epsilon\n\ndef testArrayStructInt(self, numericModule)... | [
[
"numpy.array"
]
] |
iceli1007/DAT-GAN | [
"9d015d5afa4769757edb59a3ef0c53e29b40779a"
] | [
"torch_mimicry/training/logger.py"
] | [
"\"\"\"\nImplementation of the Logger object for performing training logging and visualisation.\n\"\"\"\nimport os\n\nimport numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torchvision import utils as vutils\nfrom torch_mimicry.metrics import compute_fid, compute_is, compute_kid\n... | [
[
"torch.save",
"torch.no_grad",
"torch.from_numpy",
"torch.load",
"torch.randn"
]
] |
HDembinski/boost-histogram | [
"6071588d8b58504938f72818d22ff3ce2a5b45dc"
] | [
"src/boost_histogram/tag.py"
] | [
"from __future__ import absolute_import, division, print_function\n\ndel absolute_import, division, print_function\n\n__all__ = (\"Slicer\", \"Locator\", \"at\", \"loc\", \"overflow\", \"underflow\", \"rebin\", \"sum\")\n\nimport numpy as _np\n\n\nclass Slicer(object):\n \"\"\"\n This is a simple class to mak... | [
[
"numpy.sum"
]
] |
zhampel/FakeFinder | [
"2891a8649acc1dabdef07554d6acb346dd23dbae"
] | [
"detectors/ntech/ensemble.py"
] | [
"import numpy as np\nimport cv2\n\nfrom face_utils import get_tracks, extract_sequence, extract_face\nfrom models import *\n\nVIDEO_FACE_MODEL_TRACK_STEP = 2\nVIDEO_SEQUENCE_MODEL_SEQUENCE_LENGTH = 7\nVIDEO_SEQUENCE_MODEL_TRACK_STEP = 14\n\n\nclass video_reader:\n def __init__(self, face_detector, video_target_f... | [
[
"numpy.concatenate",
"numpy.sign"
]
] |
0aqz0/egm-control | [
"f139980d11f43ae05c306d84dba5b581bf440a51"
] | [
"yumi-control/client/yumi_control/yumi_cfg.py"
] | [
"from yumi_utils import *\nimport numpy as np\n\nyumi_leftarm_lower_limits = np.array([-2.94,-2.50,-2.94,-2.15,-5.06,-1.53,-3.99])\nyumi_leftarm_upper_limits = np.array([ 2.94, 0.75, 2.94, 1.39, 5.06, 2.40, 3.99])\nyumi_rightarm_lower_limits = np.array([-2.94,-2.50,-2.94,-2.15,-5.06,-1.53,-3.99])\nyumi_rightarm_upp... | [
[
"numpy.array"
]
] |
plazas/nonlinearity_and_BF_HXRG_detectors | [
"c4d0acbd714e6fa25f79b57fdfa5d91a26b4581b"
] | [
"pixel_rejector.py"
] | [
"#!/usr/bin/env python\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy.io import fits\nfrom scipy.stats import norm\nfrom scipy import ndimage\n\n\ndef estimateSigma(data=None, mu=0., maxOrder=None, minOrder=None, n_iter=1000):\n factor = 0.\n for i in range(n_iter):\n sample = np.ra... | [
[
"numpy.median",
"numpy.exp",
"numpy.min",
"numpy.mean",
"numpy.concatenate",
"numpy.histogram",
"numpy.zeros_like",
"numpy.max",
"numpy.log",
"numpy.argmax",
"numpy.sqrt",
"matplotlib.pyplot.yscale",
"scipy.optimize.minimize",
"numpy.convolve",
"numpy.ze... |
GNroy/NeMo | [
"3d0c29a317b89b20c93757010db80271eeea6816"
] | [
"nemo/collections/tts/models/hifigan.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | [
[
"torch.cos",
"torch.sqrt",
"torch.sin",
"torch.nn.functional.l1_loss",
"torch.clamp",
"torch.istft",
"torch.utils.data.DataLoader",
"torch.zeros_like",
"torch.atan2",
"torch.randn"
]
] |
haoweini/spotify_stream | [
"83fd13d4da9fb54a595611d4c0cd594eb5b8a9fd"
] | [
"src/data/get_saved_library.py"
] | [
"import configparser\nimport json\nimport spotipy\nimport spotipy.util as util\nimport pandas as pd\nimport spotipy.oauth2 as oauth2\nfrom spotipy.oauth2 import SpotifyClientCredentials\nimport bamboolib\nimport streamlit as st\nimport requests\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nwith open('.... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
jac241/ct-slice-detection | [
"20ceee8f6bb139fbb57455c558d53e303c4ade97"
] | [
"ct_slice_detection/inout/preprocessing.py"
] | [
"import numpy as np\nimport cv2\n\n\n\ndef normalise(img):\n img = img.astype(np.float16)\n return (img - img.min())/(img.max()-img.min()+1e-7)*255\n\ndef to256(img):\n img = img.astype(np.float16)\n return 255*(img - img.min())/(img.max()-img.min()+1e-7)\n\ndef mat2gray(img):\n img = img.astype(np.f... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.pad",
"numpy.zeros",
"numpy.min",
"numpy.stack",
"numpy.random.randint",
"numpy.clip",
"numpy.dstack"
]
] |
lucasondel/amdtk | [
"c5382787255b91e6c66ddab2c9ec2362316f0930"
] | [
"amdtk/densities/normal_gamma.py"
] | [
"\n\"\"\"\nImplementation of a Normal-Gamma density prior.\n\nCopyright (C) 2017, Lucas Ondel\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limi... | [
[
"numpy.asarray"
]
] |
bo1929/pamogk | [
"fdd1a5b3dcd43b91ce9aa9989c7815b71f13e710"
] | [
"visualizations/new_kernel.py"
] | [
"from pamogk.kernels.new_kernel import *\nimport matplotlib.pyplot as plt\n\nconf_def = 0.1\npatient_map = read_data()\n\n# Patient ve mutated genleri yaziyor\npatients = preprocess_patient_data(patient_map)\n\n# Pathwayler geldi graphlar ile\nall_pw_map = read_pathways()\n\n# list of neigbor of genes for all pathw... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.imshow"
]
] |
jg1141/DRLND-Project2 | [
"e72a054338df992883610819100e6077a1d313d1"
] | [
"ddpg_agent.py"
] | [
"import numpy as np\nimport random\nimport copy\nfrom collections import namedtuple, deque\n\nfrom model import Actor, Critic\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBATCH_SIZE = 128 # minibatch size\nBUFFER_SIZE = int(1e5) # replay buffer size\nGAMMA = 0.99 ... | [
[
"numpy.random.standard_normal",
"numpy.zeros",
"torch.no_grad",
"numpy.ones",
"torch.from_numpy",
"torch.nn.functional.mse_loss",
"torch.cuda.is_available",
"numpy.clip",
"numpy.vstack"
]
] |
zswdian/BinarizedSNPS | [
"d1a1a1f7eea74ee8f9c2233ae94f7fa079dc11d5"
] | [
"ImageNet/Models/resnet_snp.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_planes, planes, stride=1):\n super(BasicBlock, self).__init__()\n self.bn1 = nn.BatchNorm2d(in_planes)\n self.conv1 = nn.Conv2d(\n i... | [
[
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.randn"
]
] |
adelavega/pybids | [
"d481dda98c7e3b38b4a812124daaf0d450d64e19"
] | [
"bids/variables/variables.py"
] | [
"import numpy as np\nimport pandas as pd\nimport math\nfrom copy import deepcopy\nfrom abc import abstractmethod, ABCMeta\nfrom scipy.interpolate import interp1d\nfrom bids.utils import listify\nfrom itertools import chain\nfrom six import add_metaclass\nfrom bids.utils import matches_entities\n\n\n@add_metaclass(A... | [
[
"numpy.ceil",
"numpy.zeros",
"numpy.round",
"pandas.DataFrame",
"numpy.arange",
"pandas.core.groupby._get_grouper",
"pandas.concat",
"numpy.linspace"
]
] |
tmiv/lucid | [
"0dd070b4da10a9199369c0c565f62848283b4bdb"
] | [
"lucid/misc/io/showing.py"
] | [
"# Copyright 2018 The Lucid 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 required ... | [
[
"tensorflow.compat.as_bytes",
"tensorflow.GraphDef",
"numpy.random.rand"
]
] |
kwanUm/pytorch-lightning | [
"12edc3099cd0d529b4ff0553f5c7cbe9f47dfdfb"
] | [
"pytorch_lightning/trainer/evaluation_loop.py"
] | [
"\"\"\"\n# Validation loop\n\nThe lightning validation loop handles everything except the actual computations of your model.\nTo decide what will happen in your validation loop, define the `validation_step` function.\nBelow are all the things lightning automates for you in the validation loop.\n\n.. note:: Lightnin... | [
[
"torch.set_grad_enabled"
]
] |
UMass-ReRanker/AlbertReRanker | [
"f5eaddba2f3d82989ce602b62d98ebb8918e3a45"
] | [
"src/select_queries.py"
] | [
"import pandas as pd\nimport numpy\nimport os\nimport sys\ndata_dir = sys.argv[1]\ntop100 = pd.read_csv(os.path.join(data_dir, f'msmarco-doctrain-top100'),\n sep=' ', header=None, names=['qid', 'Q0', 'did', 'rank', 'score', 'run'])\nqueries_id = top100.qid.unique()\nqueries_id = nu... | [
[
"numpy.array",
"numpy.random.choice"
]
] |
durman53/tensorflow-keras-music-generation | [
"02086a2f5afdde32c2a271b60a55ffef2f393061"
] | [
"train.py"
] | [
"#module mido for working with midi files\r\nfrom mido import MidiFile, Message\r\nimport os\r\nimport numpy as np\r\n\r\nfrom tensorflow.keras.models import Sequential, Model\r\nfrom tensorflow.keras.layers import *\r\nfrom tensorflow.keras.callbacks import ModelCheckpoint\r\n\r\ndata = []\r\ntarget = []\r\ntarget... | [
[
"numpy.array",
"tensorflow.keras.models.Model",
"tensorflow.keras.callbacks.ModelCheckpoint"
]
] |
iamleeg/pints | [
"bd1c11472ff3ec0990f3d55f0b2f20d92397926d"
] | [
"pints/_diagnostics.py"
] | [
"#\n# Functions to calculate various MCMC diagnostics\n#\n# This file is part of PINTS.\n# Copyright (c) 2017-2018, University of Oxford.\n# For licensing information, see the LICENSE file distributed with the PINTS\n# software package.\nimport numpy as np\n\n\ndef autocorrelation(x):\n \"\"\"\n Calculate ... | [
[
"numpy.correlate",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.sqrt",
"numpy.var"
]
] |
gregaw/mapel | [
"00e813ebf11882938f6dc1364ca6d790f52fd7fe"
] | [
"mapel/elections/models/single_peaked.py"
] | [
"import numpy as np\nfrom random import *\n\nfrom scipy.special import binom\n\n\ndef generate_sp_party(model=None, num_voters=None, num_candidates=None, params=None) -> np.ndarray:\n candidates = [[] for _ in range(num_candidates)]\n _ids = [i for i in range(num_candidates)]\n\n for j in range(params['num... | [
[
"numpy.random.normal",
"numpy.random.choice",
"numpy.zeros",
"numpy.random.randint",
"scipy.special.binom"
]
] |
HanBnrd/mne-python | [
"9917316f4e376d3c6f3d7cff4dafd237dba64bbf"
] | [
"mne/io/fiff/tests/test_raw_fiff.py"
] | [
"# -*- coding: utf-8 -*-\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n#\n# License: BSD-3-Clause\n\nfrom copy import deepcopy\nfrom pathlib import Path\nfrom functools import partial\nfrom io import BytesIO\nimport os\nimport os.path as op\nimport... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.round",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.random.randn",
"numpy.may_share_memory",
"numpy.testing.assert_array_... |
louity/scattering_transform | [
"1cbf467ff3735f1a91fc512a3fe2b0fb3bccda42"
] | [
"scattering/scattering1d/filter_bank.py"
] | [
"import numpy as np\nimport torch\nimport math\nimport warnings\n\n\ndef adaptative_choice_P(sigma, eps=1e-7):\n \"\"\"\n Adaptive choice of the value of the number of periods in the frequency\n domain used to compute the FFT of a Morlet wavelet.\n\n This function considers a Morlet wavelet defined as t... | [
[
"numpy.max",
"numpy.fft.ifft",
"numpy.exp",
"torch.from_numpy",
"numpy.arange",
"numpy.abs",
"numpy.fft.fftfreq"
]
] |
VideoAnalysis/EDUVSUM | [
"52243053a059a77c63668e9898ab319681b44f2e"
] | [
"src/generateTextFeatures.py"
] | [
"\n\nfrom common import videoLoading\nimport glob\nimport numpy as np \nimport pickle\nimport webvtt\n\n#https://pypi.org/project/webvtt-py/\n\n\n\nfrom bert_embedding import BertEmbedding\nfrom transformers import pipeline\n#https://pypi.org/project/bert-embedding/\n\n\n\n\ndef getSecFromTimeStr(tm):\n tmTkn=tm... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
frutoper/Hockey-Scraper | [
"bd521a4670396f0a565573fdc9cb95c28064ce0a"
] | [
"hockey_scraper/scrape_functions.py"
] | [
"\"\"\"\nFunctions to scrape by season, games, and date range\n\"\"\"\n\nimport hockey_scraper.json_schedule as json_schedule\nimport hockey_scraper.game_scraper as game_scraper\nimport hockey_scraper.shared as shared\nimport pandas as pd\nimport time\nimport random\n\n\n# This hold the scraping errors in a string ... | [
[
"pandas.concat"
]
] |
NickeZ/pyepics | [
"114463cefc15a260b20b1965864bd80ac8415ac6"
] | [
"epics/devices/mca.py"
] | [
"#!/usr/bin/python\nimport sys\nimport time\nimport numpy as np\nfrom .. import Device, get_pv, poll, caput, caget\n\ntry:\n from collections import OrderedDict\nexcept:\n from ordereddict import OrderedDict\n\nif sys.version[0] == '2':\n from ConfigParser import ConfigParser\nelif sys.version[0] == '3':\... | [
[
"numpy.concatenate",
"numpy.arange"
]
] |
bukeplato/pyBKT | [
"733a4ccf0de78bef7d47b5a6af7131c7778560db"
] | [
"source-py/pyBKT/models/Model.py"
] | [
"#########################################\n# Model.py #\n# Model #\n# #\n# @author Anirudhan Badrinath #\n# Last edited: 07 April 2021 #\n#########################################\n\nimport numpy... | [
[
"pandas.DataFrame",
"numpy.delete",
"numpy.random.uniform",
"numpy.append"
]
] |
mananmadan/Ontology-Based-Concept-Similarity | [
"7f9ca63b3b4ef40bd2e8ece8c0872f14a4fade9b"
] | [
"kntool/test_version.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 18 20:12:38 2020\n\n@author: manan\n\"\"\"\nimport nltk\nimport re\nimport pandas as pd\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom nltk.tokenize import PunktSentenceTokenizer\n\n\n\n#reading the data:\npst = PunktSentenc... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.figure"
]
] |
chilung/VisDA1 | [
"d5bafb7c6048f56483d2b03ae7040eee7a60af71"
] | [
"modeling/backbones/resnet_ibn_a.py"
] | [
"import torch\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n__all__ = ['ResNet_IBN', 'resnet50_ibn_a', 'resnet101_ibn_a',\n 'resnet152_ibn_a']\n\n\nmodel_urls = {\n 'resnet50': 'https://download.pyto... | [
[
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.split",
"torch.nn.LeakyReLU",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"torch.load"
]
] |
CombatCovid/operation-air-ventilator | [
"0f11748f2b57ef8f1b3af6bb73581e778cbb0d88"
] | [
"src/Software/src/utils/anamolyDetection.py"
] | [
"from enum import Enum\nfrom queue import Queue\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib import collections as mc\nfrom matplotlib import colors as cl\n\nfrom models.mcuSettingsModel import Settings\nfrom utils.logPlayer import replay_log\n\n\nclass Anomaly(E... | [
[
"numpy.concatenate",
"numpy.array",
"matplotlib.pyplot.ion",
"matplotlib.colors.to_rgba",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.collections.LineCollection",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"matplotlib.is_interactive",
"numpy.append... |
talbertc-usgs/pyphenocam | [
"a414857c0915c26d804c98852c1d509046ef5d81"
] | [
"notebooks/animation.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\nimport os\nimport sys\nimport datetime as dt\n\nsys.path.append(r\"..\")\nimport pyphenocam\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nimport rasterio\n\n\n# In[2]:\n\nbase_dname = r\"J:\\Projects\\NCCSC\\phenocam\\DerivedData\\nationalelkrefuge\"\nsite_name = ... | [
[
"matplotlib.use",
"numpy.sum",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.tight_layout",
"numpy.ma.masked_where"
]
] |
magnusja/metriculous | [
"53fa17ad04ef5d52017a9d1f76cb7f5c4b144960"
] | [
"src/metriculous/evaluators/_regression_evaluator_test.py"
] | [
"from dataclasses import replace\nfrom typing import Optional, Sequence\n\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\n\nfrom .. import Evaluation, Quantity\nfrom . import RegressionEvaluator\nfrom ._bokeh_utils import check_that_all_figures_can_be_rendered\n\n\nclass TestRegressionEvaluator:\n ... | [
[
"numpy.testing.assert_allclose",
"numpy.ones_like",
"numpy.median",
"numpy.sum",
"numpy.random.randn",
"numpy.absolute",
"numpy.average",
"numpy.random.random"
]
] |
coderefinery/pre-workshop-survey | [
"98d45b263908a394d3a28580f1376304a0b0e26d"
] | [
"preprocess/preprocess-typeform.py"
] | [
"import glob\nimport pandas as pd\n\n# first typeform data\npersonal = \"personal/\"\nyears = [2016, 2017, 2018]\ncols_to_rm = ['First Name', 'Last Name', 'E-mail Address']\n\ndfs = []\nkeys = []\nfor f in glob.glob(personal+'/20*/*.csv'):\n if not \"_processed.csv\" in f:\n df = pd.read_csv(f)\n f... | [
[
"pandas.read_csv"
]
] |
Jammy2211/AutoLens | [
"bc132a21d1a52248f08f198474e29f985e365d85"
] | [
"autolens/lens/subhalo.py"
] | [
"from typing import List, Tuple\r\nimport numpy as np\r\n\r\nimport autoarray as aa\r\nimport autogalaxy.plot as aplt\r\n\r\nfrom autoarray.plot.abstract_plotters import AbstractPlotter\r\n\r\nfrom autolens.imaging.fit_imaging import FitImaging\r\nfrom autolens.imaging.plot.fit_imaging_plotters import FitImagingPlo... | [
[
"numpy.median",
"numpy.nanmedian",
"numpy.zeros",
"numpy.fliplr"
]
] |
sdhnshu/Pytorch-Model-Zoo | [
"96fb38db5200f455bf332871f8fbf134f490d4d8"
] | [
"dcgan/train.py"
] | [
"import torch\nimport torchvision.transforms as transforms\nfrom torchvision.datasets import ImageFolder\nfrom torch.autograd import Variable\nfrom model import Generator, Discriminator\n\n# Hyperparameters\nlr = 0.0002\nbatch_size = 32\nimage_size = 64\nz_dim = 100\nepochs = 80\n\n# Image Preprocessing\ntransform ... | [
[
"torch.zeros",
"torch.save",
"torch.ones",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.randn"
]
] |
matthewfeickert/monolens | [
"fb0daae0a7c6a86ee5999bbf65d64d08604e819a"
] | [
"monolens/util.py"
] | [
"import os\nimport sys\nfrom PySide6 import QtGui\nimport numpy as np\nimport numba as nb\n\nDEBUG = int(os.environ.get(\"DEBUG\", \"0\"))\n\nif sys.byteorder == \"little\":\n argb = (3, 2, 1, 0)\nelse:\n argb = (0, 1, 2, 3)\n\n# matrix values from colorblind package\ncb_lms = np.array(\n [\n # Prot... | [
[
"numpy.array",
"numpy.linalg.inv",
"numpy.linalg.multi_dot"
]
] |
FlackoJodye1/thvisa | [
"1472cba988a261ba0084e9997f3a5d483250c8fd"
] | [
"spd3303c_thvisa.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 6 21:37:06 2019\n\n@author: thirschbuechler\n\"\"\"\nimport time\nimport pandas as pd\nimport numpy as np\nimport thvisa as thv\n\n# ToDo: check system:status? to find out whether in cc mode, i.e. limited \n# ToDo: series / parallel mode\... | [
[
"pandas.read_excel"
]
] |
micom-dev/paper | [
"a347dd40f498665462acfa1ee65db316c82650ef"
] | [
"workflows/taxa_stats.py"
] | [
"\"\"\"Calculate stats for taxa assignments and availability in AGORA.\"\"\"\n\nimport pandas as pd\nimport micom\n\n\ntax = pd.read_csv(\"data/abundances.csv\").query(\"kingdom == 'Bacteria'\")\ntax.relative = tax.groupby(\"id\").relative.apply(lambda a: a / a.sum())\ntax.taxa_id = tax.taxa_id.str.replace(\"*\", \... | [
[
"pandas.read_csv",
"pandas.Series"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.