repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ZhaiFengYun/R329-AIPU-gesture-recognition | [
"a4c0061b9d97761bcac38ef01aa40b5411b819c6"
] | [
"pytorch2tensorflow/torch2tf_model_weight.py"
] | [
"\n#################\n#@zhai fengyun -->Yanshan University\n#################\n\n\n# model_node = ['Conv/Relu6:0', 'SeparableConv2d/Relu6:0', 'Conv_1/Conv2D:0', 'Conv_2/Relu6:0',\n# 'SeparableConv2d_1/Relu6:0', 'Conv_3/Conv2D:0', 'Conv_4/Relu6:0', 'SeparableConv2d_2/Relu6:0',\n# ... | [
[
"tensorflow.Session",
"numpy.load",
"tensorflow.train.Saver",
"tensorflow.Variable",
"tensorflow.contrib.framework.load_variable",
"tensorflow.contrib.framework.list_variables",
"tensorflow.global_variables_initializer"
]
] |
EnesMercan/Computer-Vision-Python | [
"21ba2f5125b56c17fa72e8b032cbe943af1f36fb"
] | [
"16_mouse_practice_4.py"
] | [
"#tiklanan noktanin rengini ayri bir ekranda gosterir\n\nimport cv2\nimport numpy as np\n\ndef click_event(event, x, y, flags, param) :\n if event == cv2.EVENT_LBUTTONDOWN :\n red = img[y,x,2]\n green = img[y,x,1]\n blue = img[y,x,0]\n colorImage = np.zeros((100,100,3),np.uint8)\n ... | [
[
"numpy.zeros"
]
] |
jackode/tensorflow | [
"11f4ecb54708865ec757ca64e4805957b05d7570"
] | [
"tensorflow/python/keras/callbacks.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.backend.get_graph",
"numpy.median",
"tensorflow.python.framework.ops.init_scope",
"tensorflow.python.ops.summary_ops_v2.histogram",
"tensorflow.python.keras.backend.int_shape",
"tensorflow.python.eager.context.eager_mode",
"numpy.less",
"tensorflow.python.u... |
glangford/python-sgp4 | [
"fdc031157e0e46dea65c78103dece1ef64573d08"
] | [
"sgp4/model.py"
] | [
"\"\"\"The Satellite class.\"\"\"\n\nfrom sgp4.earth_gravity import wgs72old, wgs72, wgs84\nfrom sgp4.ext import days2mdhms, jday\nfrom sgp4.functions import jday as jday2\nfrom sgp4.io import twoline2rv\nfrom sgp4.propagation import sgp4, sgp4init\n\nWGS72OLD = 0\nWGS72 = 1\nWGS84 = 2\ngravity_constants = wgs72old... | [
[
"numpy.array"
]
] |
yerang823/landmark-detection | [
"a01bcf79abcf9d203c1b92f29b49aab9005952c3"
] | [
"SRT/lib/datasets/augmentation_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n#\nimport torch\nimport numpy as np\n\nclass CutOut(object):\n def __init__(self, length):\n self.length = ... | [
[
"numpy.ones",
"numpy.random.randint",
"torch.from_numpy",
"numpy.clip"
]
] |
thinkofher/rollerpy | [
"14ee2676da93c3c972f215c6a7895d84d9451332"
] | [
"models/curve.py"
] | [
"from abc import ABC, abstractclassmethod\nimport numpy as np\n\n\ndef numpize(func):\n '''\n Changing function ouput from list (or other iter)\n to numpy array\n '''\n def wrapper(point):\n return np.array(func(point))\n return wrapper\n\n\nclass Curve(ABC):\n\n '''\n A simple curve ... | [
[
"numpy.array",
"numpy.linalg.norm"
]
] |
jitendrs/Cirq | [
"8cc0befae09063369cca06e3d66740ef8adf6f2c"
] | [
"cirq/qis/states_test.py"
] | [
"# Copyright 2019 The Cirq Developers\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 o... | [
[
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.exp",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.conj",
"numpy.sqrt",
"numpy.diag"
]
] |
SJTUwxz/LocoNet | [
"29e592f1322616ded67bc56abb14e42f89ea08bc"
] | [
"examples/evaluate_jh.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session"
]
] |
ZhangK9509/DROW-pytorch | [
"7d643e2bad984e3c15e4bb0e795cd794d9fc361a"
] | [
"utils/utils.py"
] | [
"# -*- coding=utf8 -*-\n\n# Author : Painter\n# Created Time : 2019-01-08 Tue 15:39:24\n# Filename : utils.py\n# Email : painter9509@126.com\n\n\nimport json\n\nimport numpy as np\nimport cv2\nfrom scipy.spatial.distance import cdist\n\n\ndef load_scan(filename):\n data = np.genfromtxt(filename,... | [
[
"numpy.array",
"numpy.clip",
"numpy.zeros_like",
"numpy.sin",
"numpy.zeros",
"numpy.argmin",
"numpy.genfromtxt",
"numpy.radians",
"numpy.arange",
"numpy.arctan2",
"numpy.cos",
"numpy.append",
"numpy.linspace"
]
] |
chinganc/mamba | [
"e8adf0cf91660aed2c025508137a14f9d062248c"
] | [
"rl/algorithms/utils.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport numpy as np\nfrom rl import online_learners as ol\nfrom rl.online_learners import base_algorithms as balg\n\n\ndef get_learner(optimizer, policy, scheduler, max_kl=None):\n \"\"\" Return an first-order optim... | [
[
"numpy.sum",
"numpy.where",
"numpy.arange",
"numpy.random.geometric",
"numpy.random.multinomial"
]
] |
Caoang327/vis_det | [
"0b544cee20bb304b27bac6d9e64d3bac6b4b6b4b"
] | [
"vis_det/optimize/loss.py"
] | [
"import torch\n\n\ndef tv_loss(img, alpha=2):\n \"\"\"\n Compute total variation loss.\n\n Args:\n -- img: PyTorch Variable of shape (N, 3, H, W) holding an input image.\n -- alpha: alpha norm.\n\n Returns:\n -- loss: PyTorch Variable holding a scalar giving the total variation loss for img.\n ... | [
[
"torch.sum",
"torch.pow"
]
] |
edjzhang/zipbiaschecker | [
"d425f5a1fc7a2dedbe157019c757277980bbf33e"
] | [
"zipbiaschecker/tests/check_bias_test.py"
] | [
"import unittest\nimport pandas as pd\nfrom ..zipbiaschecker import ZipBiasChecker\nfrom ..data import example\ntry:\n import importlib.resources as pkg_resources\n# For Python version 3.4 through 3.8\nexcept ImportError:\n import importlib_resources as pkg_resources\n\n\nclass CheckBiasTest(unittest.TestCase... | [
[
"pandas.read_csv",
"pandas.Series"
]
] |
achaika80/Python | [
"4e927677027ebc55006528febeb03ace43ee7b9a"
] | [
"AzureLogAnalyticsRESTAPIQuery/Get-AzureLogAnalytics-Perf-Data.py"
] | [
"#import modules region\n\nimport requests, urllib3, json\nimport pandas as pd\nfrom pandas.io.json import json_normalize\nfrom datetime import datetime\nfrom datetime import timedelta\nimport plotly.express as px\nimport re\n\n#variables region\n\nworkspaceid = '<>'\n# Tenant ID for your Azure subscription\nTENANT... | [
[
"pandas.DataFrame"
]
] |
jehboyes/planning_system | [
"a415f1408ef344732498d2ffb111dfd187b9b50f"
] | [
"planning_system/cli/survey/nss.py"
] | [
"import datetime\nimport sys\nimport os\nfrom collections import defaultdict\nfrom copy import deepcopy\nfrom itertools import product\nimport click\nimport pandas as pd\nfrom pulp import LpMinimize, LpProblem, lpSum, LpVariable, LpStatus\nfrom planning_system.db.schema.tables.survey import QuestionOption, SurveyIn... | [
[
"pandas.read_excel",
"pandas.MultiIndex.from_tuples",
"pandas.Series"
]
] |
aaronhan223/htsf | [
"cfda92e63bcf9743e25d1784c32363ab50d573bb"
] | [
"DYCHEM-Accelerated/hiertsforecaster/recon/ERM.py"
] | [
"import numpy as np\nfrom numpy.linalg import inv\nfrom hiertsforecaster.preprocess.hierarchical import TreeNodes\nimport pdb\n\n\ndef get_p_matrix(S, Y, Y_hat):\n P = -np.dot(np.dot(inv(np.dot(S.T, S)), np.dot(S.T, Y.T)), np.dot(Y_hat, inv(np.dot(Y_hat.T, Y_hat))))\n return P\n\n\ndef unbiased_recon(nodes, y... | [
[
"numpy.dot"
]
] |
Divesh2201/imdb_Movie_Review-Predictor | [
"3747924059ef4458d0bd6b3155b66f292f516e00"
] | [
"imdb_reviews/myData_model.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np \n \ndata = keras.datasets.imdb\n\n(train_data, train_labels), (test_data, test_labels) = data.load_data(num_words = 88000)\n\nword_index = data.get_word_index()\n\nword_index = {k:(v+4) for k, v in word_index.items()}\n\nword_index[\"<PAD>\... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.models.load_model"
]
] |
RAS-2018-grp-4/ras_path_planning | [
"a1fc9fdb6b96ca5c8c6b64faed0b5569ce504d3d"
] | [
"path_planner/src/path_planner.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom nav_msgs.msg import MapMetaData\nfrom nav_msgs.msg import OccupancyGrid\nfrom nav_msgs.msg import Odometry\nfrom nav_msgs.msg import Path\nimport time\nimport matplotlib.pyp... | [
[
"numpy.linspace",
"numpy.sqrt"
]
] |
luispedro/milk | [
"abc2a28b526c199414d42c0a26092938968c3caf"
] | [
"milk/unsupervised/parzen.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (C) 2010, Luis Pedro Coelho <luis@luispedro.org>\n# vim: set ts=4 sts=4 sw=4 expandtab smartindent:\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the ... | [
[
"numpy.dot",
"numpy.exp",
"numpy.sqrt"
]
] |
E-dog91/Reservoir-Reinforcement-LEarning-for-Trading- | [
"3e91ee67f899555b2b02affcdf69d510671ad387"
] | [
"matrix_generator/matrix_uni_gen.py"
] | [
"# Import\r\nimport torch\r\n\r\nfrom src.rc_class.matrix_gen.matrix_generator import Matrix_generator\r\n\r\n\r\nclass Matrix_uni_gen(Matrix_generator):\r\n\r\n def __init__(self, *args, **kwargs):\r\n super().__init__(*args, **kwargs)\r\n\r\n def _generate_matrix(self, size, dtype=torch.float64):\r\n... | [
[
"torch.rand"
]
] |
gkduss/WebCrawler | [
"160128854648a6dce7e297cbc788192d6095b7f4"
] | [
"chart.py"
] | [
"from matplotlib import pyplot\nfrom matplotlib.axes import Axes\n\nfrom utils.db_library import get_site_data\nfrom datetime import datetime, timedelta\nfrom pytz import timezone, utc\n\n\ndef convert_iso_to_kst_date(iso_string: str) -> datetime:\n naive_datetime = datetime.fromisoformat(iso_string)\n return... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Eliasfarah0/OpenFOAM-Automated-Tool-Chain-PoC | [
"3fb03bc25959de56aef2cf2550c6f79ff5edb691"
] | [
"src/WriteSystemDirectoryFiles/genBlockMeshDict.py"
] | [
"#########################################################################\r\n# #\r\n# C R A N F I E L D U N I V E R S I T Y #\r\n# 2 0 1 9 / 2 0 2 0 #\r\n# ... | [
[
"numpy.vstack"
]
] |
disadone/pyperplot | [
"7beafd700482d4d2722d874d26920a4b4890020d"
] | [
"src/pyperplot/draw.py"
] | [
"import matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\naa=np.asarray\nimport os\nimport string\n\nfrom .settings import styles_path\n\n\nclass SF(object):\n \"\"\"\n save figure context\n \"\"\"\n def __init__(self,figure_name=None,figures_folder='figs',figure_markers=None,figur... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.rcParams.update",
"matplotlib.pyplot.style.use"
]
] |
Dennis-van-Gils/DvG_Arduino_lock-in_amp | [
"4576aa529413c93c6e4d6152802349f5f0c3ee16"
] | [
"DvG_Arduino_lockin_amp.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Arduino lock-in amplifier\n\"\"\"\n__author__ = \"Dennis van Gils\"\n__authoremail__ = \"vangils.dennis@gmail.com\"\n__url__ = \"https://github.com/Dennis-van-Gils/DvG_Arduino_lock-in_amp\"\n__date__ = \"31-08-2021\"\n__version__ = \"2.0.0\"\n# pylint: disable... | [
[
"numpy.max",
"numpy.full",
"numpy.square",
"numpy.min",
"numpy.mean",
"numpy.ma.transpose",
"numpy.multiply",
"numpy.std",
"numpy.arange",
"numpy.arctan2"
]
] |
catrove/mmdetection-sugon | [
"57336c149f4b3899362dd35f7019535576089202",
"57336c149f4b3899362dd35f7019535576089202"
] | [
"mmdet/ops/_cpools/test.py",
"mmdet/ops/dcn/test.py"
] | [
"import torch \nimport right_pool\ndevice = torch.device(\"cuda:0\")\na = torch.zeros([10,10,10,10],device=device)\nb = torch.zeros([10,10,10,10],device=device)\nc = right_pool.backward(a,b)\nprint(c)\n",
"import torch\nimport deform_conv_cuda\n\ndevice = torch.device(\"cuda:0\")\na_list = [ torch.zeros([10,10],d... | [
[
"torch.zeros",
"torch.device"
],
[
"torch.zeros",
"torch.device"
]
] |
luyug/transformers | [
"a59e7c1ed4ef1568ca0ba4140c9af641b17fa37e"
] | [
"src/transformers/models/albert/modeling_albert.py"
] | [
"# coding=utf-8\n# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LIC... | [
[
"torch.nn.Linear",
"torch.einsum",
"torch.ones",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.nn.Softmax",
"tensorflow.train.list_variables",
"numpy.transpose",
"torch.tensor",
"torch.zeros",
"tensorflow.train.load_variable... |
bjornrun/ride-plot-latency | [
"9116ae9d65f33e6cbc6f0ce694a0a275cadd01d5"
] | [
"plot.py"
] | [
"import sys\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef _plot_latency_data(src_file: str, dst_file: str) -> None:\n df = pd.read_csv(src_file, index_col='datetime', parse_dates=True).fillna(0)\n df['lte_modem_latency'].plot(label='lte_modem_latency')\n df['5G_modem_latency'].plot(label='... | [
[
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.legend"
]
] |
Devanshu-singh-VR/Objection_detection_hand_written | [
"c66bad26036f7c0b91c77a48df7a4e1b000fa43b"
] | [
"Train_model/train_model.py"
] | [
"import os\r\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\r\nimport tensorflow as tf\r\nimport pandas as pd\r\n\r\ndata = pd.read_csv('train_label.csv') # CSV file path\r\n\r\nimage = data.iloc[:, 0].values\r\nlabel = data.iloc[:, 1:].values\r\n\r\ntrain = tf.data.Dataset.from_tensor_slices((image, label))\r\n\r\ndef ... | [
[
"tensorflow.keras.regularizers.l1",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.decode_image",
"tensorflow.keras.layers.Flatten",
"tensorflow.io.read_file",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.... |
ko-takahashi/college | [
"c333f1e1767f1206687f5e9b0fb3f0145b2d5d6a"
] | [
"CS596/Homework/HW2/GD.py"
] | [
"\nimport numpy as np\n# X - single array/vector\n# y - single array/vector\n# theta - single array/vector\n# alpha - scalar\n# iterations - scarlar\n\ndef gradientDescent(X, y, theta, alpha, numIterations):\n '''\n # This function returns a tuple (theta, Cost array)\n '''\n ... | [
[
"numpy.square",
"numpy.dot",
"numpy.transpose"
]
] |
Shashank3071/Autumn-of-Automation | [
"2dd795a254468bcd287a2125f7a9403b70028066"
] | [
"OpenCV/assign3_1.py"
] | [
"#LET'S FALL IN LOVE WITH IMAGES!!!!\n\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport os\n\nimg = cv2.imread('lena.jpg', cv2.IMREAD_GRAYSCALE)\n\n\nlap = cv2.Laplacian(img, cv2.CV_64F, ksize=3)\nsobelX = cv2.Sobel(img, cv2.CV_64F, 1, 0)\nsobelY = cv2.Sobel(img, cv2.CV_64F, 0, 1)\n\nla... | [
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"numpy.absolute",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.imshow"
]
] |
cemfi/hannds | [
"4a7e99170faf6d7cf6a9e0c705539a48fd741521"
] | [
"train_hannds.py"
] | [
"\"\"\"Trains a neural network for hand mapping.\"\"\"\n\nimport argparse\nimport datetime as dt\nimport json\nimport os\n\nimport matplotlib\n\nmatplotlib.use(\"TkAgg\")\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\nimport torch\n\nimport hannds_data as hd\nfrom network_zo... | [
[
"matplotlib.use",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"torch.cuda.is_available"
]
] |
i-strielkov/tfdrive | [
"b5559a9be57b34b01fc6d7df13f6835676906fa9"
] | [
"python/jupyter_notebooks/pwcal_hsa.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pyarrow\nfrom multiprocessing import Pool\nfrom collections import Counter\nfrom itertools import repeat\nimport scipy.stats as st\n\ndef __get_ptws(ids, pathways_db, go_terms_db):\n '''Get list of patways/terms based on gene IDs'''\n pathways = list(pathways_d... | [
[
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.concat",
"pandas.read_parquet",
"scipy.stats.beta"
]
] |
JoseAntonioSiguenza/deepchem | [
"05fe1b186ec154e18de9aa1b110e9258dc484e21"
] | [
"deepchem/feat/graph_features.py"
] | [
"# flake8: noqa\n\nimport numpy as np\nimport deepchem as dc\nfrom deepchem.feat.base_classes import MolecularFeaturizer\nfrom deepchem.feat.mol_graphs import ConvMol, WeaveMol\nfrom deepchem.data import DiskDataset\nimport logging\nfrom typing import Optional, List, Tuple, Union, Iterable\nfrom deepchem.utils.typi... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.delete",
"numpy.zeros",
"numpy.mean",
"numpy.eye",
"numpy.where",
"numpy.stack",
"numpy.linalg.matrix_power",
"numpy.vstack"
]
] |
codeneuro/neurofinder-evaluator | [
"27e36155963cdec8f25fa07274ddf5e0dbad4c1a"
] | [
"neurofinder/main.py"
] | [
"import json\nimport os\nfrom numpy import inf, NaN, newaxis, argmin, delete, asarray, isnan, sum, nanmean\nfrom scipy.spatial.distance import cdist\nfrom regional import one, many\n\ndef load(file):\n \"\"\"\n Load neuronal regions from a file or string.\n \"\"\"\n if os.path.isfile(file):\n wit... | [
[
"numpy.delete",
"numpy.isnan",
"numpy.asarray",
"numpy.argmin",
"numpy.nanmean",
"scipy.spatial.distance.cdist"
]
] |
Goxiaoy/rasa | [
"93d9983e465f7a426930a746fef1252cbb2f8f35"
] | [
"rasa/core/featurizers/tracker_featurizers.py"
] | [
"from pathlib import Path\nfrom collections import defaultdict\nfrom abc import abstractmethod\nimport jsonpickle\nimport logging\n\nfrom tqdm import tqdm\nfrom typing import Tuple, List, Optional, Dict, Text, Union, Any, Iterator, Set\nimport numpy as np\n\nfrom rasa.core.featurizers.single_state_featurizer import... | [
[
"numpy.ndarray"
]
] |
zachdj/solarrad | [
"5129e85cc00c8a14c4b4a27b54fc2b9ea3c4e598"
] | [
"experiments/replication/persistence.py"
] | [
"\"\"\" Experiments with persistence models \"\"\"\n\nimport logging\nimport mysql.connector\nimport sys\nfrom texttable import Texttable\n\nfrom sklearn.metrics import mean_absolute_error\n\nimport solardata.config\nimport solardata.sites as sites\n\nlogger = logging.getLogger(__name__)\n\n\ndef current_value():\n... | [
[
"sklearn.metrics.mean_absolute_error"
]
] |
loayghawji/CPM | [
"8d1c1d0e15bba04c0ef06997411a09765f736cfa"
] | [
"utils/utils.py"
] | [
"import albumentations as albu\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\n\n\ndef matplotlib_imshow(img, one_channel=False):\n if one_channel:\n img = img.mean(dim=0)\n img = img / 2 + 0.5 # unnormalize\n npimg = img.numpy()\n if one_... | [
[
"torch.autograd.Variable",
"numpy.array",
"numpy.transpose",
"matplotlib.pyplot.imshow"
]
] |
jlashner/ares | [
"6df2b676ded6bd59082a531641cb1dadd475c8a8",
"6df2b676ded6bd59082a531641cb1dadd475c8a8",
"6df2b676ded6bd59082a531641cb1dadd475c8a8",
"6df2b676ded6bd59082a531641cb1dadd475c8a8"
] | [
"ares/util/SetDefaultParameterValues.py",
"input/litdata/alavi2016.py",
"tests/test_analysis_uvlf.py",
"input/secondary_electrons/read_FJS10.py"
] | [
"\"\"\"\nSetDefaultParameterValues.py\n\nAuthor: Jordan Mirocha\nAffiliation: University of Colorado at Boulder\nCreated on 2010-10-19.\n\nDescription: Defaults for all different kinds of parameters.\n\n\"\"\"\n\nimport os, imp\nimport numpy as np\nfrom ares import rcParams\nfrom ..physics.Constants import m_H, cm_... | [
[
"numpy.arange"
],
[
"numpy.arange",
"numpy.ma.array"
],
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.log10"
],
[
"numpy.zeros_like",
"numpy.array",
"numpy.zeros"
]
] |
subhacom/argos | [
"e1b4057e470c517aabca6b6e0a0efb44871fed82"
] | [
"yolact/layers/functions/detection.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom yolact.layers.box_utils import decode, jaccard, index2d\nfrom yolact.utils import timer\n\nfrom yolact.data import cfg, mask_type\n\nimport numpy as np\n\n\nclass Detect(object):\n \"\"\"At test time, Detect is the final layer of SSD. Decode location preds,\n... | [
[
"torch.cat",
"torch.arange",
"torch.max",
"numpy.get_include",
"torch.Tensor"
]
] |
malhotraa/vision | [
"e1a3042792a3f15a8cae8cc563d54d2215a3e201"
] | [
"torchvision/models/detection/transform.py"
] | [
"import random\nimport math\nimport torch\nfrom torch import nn, Tensor\nimport torchvision\nfrom torch.jit.annotations import List, Tuple, Dict, Optional\n\nfrom torchvision.ops import misc as misc_nn_ops\nfrom .image_list import ImageList\nfrom .roi_heads import paste_masks_in_image\n\n\n@torch.jit.unused\ndef _r... | [
[
"torch.jit.annotate",
"torch.stack",
"torch.min",
"torch.max",
"torch.nn.functional.interpolate",
"torch.onnx.operators.shape_as_tensor",
"torch._C._get_tracing_state",
"torch.tensor",
"torch.as_tensor",
"torch.nn.functional.pad",
"torch.empty"
]
] |
kb2623/NiaPy-examples | [
"a405be2cc48c56429a1b63d8026cc98bd0a027a9"
] | [
"CEC/run_cec.py"
] | [
"# encoding=utf8\nimport sys\n\nimport random\nimport logging\nfrom numpy import asarray, savetxt, set_printoptions\nfrom NiaPy import Runner\nfrom NiaPy.util import Task, TaskConvPrint, TaskConvPlot, OptimizationType\nfrom cecargparser import getDictArgs\n\nlogging.basicConfig()\nlogger = logging.getLogger('cec_ru... | [
[
"numpy.savetxt",
"numpy.asarray"
]
] |
Anonym96/Pea-KD | [
"e387ccf6f5112dd84b56ec4c57aea5af0465d260"
] | [
"src/finetune.py"
] | [
"\"\"\"\nThe main file used to train student and teacher models. Mainly based on [GitHub repository](https://github.com/intersun/PKD-for-BERT-Model-Compression) for [Patient Knowledge Distillation for BERT Model Compression](https://arxiv.org/abs/1908.09355).\n\"\"\"\n\nimport logging\nimport os\nimport random\nimp... | [
[
"numpy.array",
"torch.cuda.manual_seed_all",
"torch.stack",
"numpy.random.seed",
"torch.manual_seed",
"torch.tensor"
]
] |
julianirwin/hotplots.party | [
"34d4e7b5ffa2f8de4dcc4c4ba9aebfa1c8bbf492"
] | [
".data/burrito/burrito_hotplot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\ndata = {\n 'Chipotle': 0.4,\n 'Qdoba': 0.3,\n 'Local Chain': 0.1, \n 'Taco Bell': 0.2}\nrestaurants, pcs = list(data.keys()), list(data.values())\n\ny = 100 * np.array(pcs)\nx = np.arange(len(y))\nwidth = 0.4\n\nfig, ax = plt.subplots()\nax.set_yla... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots"
]
] |
radiocosmology/cora | [
"7d34e502c8536adc2d68b6a5d703ce8bbc6afcca",
"7d34e502c8536adc2d68b6a5d703ce8bbc6afcca"
] | [
"cora/util/nputil.py",
"cora/signal/corrfunc.py"
] | [
"\"\"\"Utility functions to help with pure numpy stuff.\"\"\"\nfrom typing import TypeVar\n\nimport numpy as np\nimport scipy.linalg as la\n\n\n# Type variable for ArrayLike arguments\nFloatArrayLike = TypeVar(\"FloatArrayLike\", float, np.ndarray)\n\n\ndef save_ndarray_list(fname, la):\n \"\"\"Save a list of nu... | [
[
"numpy.random.standard_normal",
"scipy.linalg.eigh",
"numpy.load",
"numpy.savez",
"scipy.linalg.cholesky",
"numpy.flatnonzero"
],
[
"numpy.exp",
"numpy.sinc",
"numpy.where",
"numpy.sort",
"numpy.logspace",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.... |
almarklein/visvis2 | [
"728a4b7434879d3606f32836eda3971ed73905f8"
] | [
"pygfx/resources/_buffer.py"
] | [
"import numpy as np\n\nSTRUCT_FORMAT_ALIASES = {\"c\": \"B\", \"l\": \"i\", \"L\": \"I\"}\n\n\nclass Resource:\n pass\n\n\nclass Buffer(Resource):\n \"\"\"A buffer object represents a piece of memory to the GPU, that can be\n used as index buffer, vertex buffer, uniform buffer, or storage buffer.\n You ... | [
[
"numpy.ascontiguousarray",
"numpy.frombuffer"
]
] |
Iburelli/protopipe | [
"1f392ea5abca6b09b684fca1e4ff3b138faa0b5a"
] | [
"protopipe/pipeline/image_cleaning.py"
] | [
"import numpy as np\nfrom ctapipe.image.cleaning import mars_cleaning_1st_pass\n\ntry:\n from pywicta.denoising.wavelets_mrtransform import WaveletTransform\n from pywicta.denoising import cdf\n from pywicta.denoising.inverse_transform_sampling import EmpiricalDistribution\n from pywicta.io import geome... | [
[
"numpy.copy"
]
] |
YaCpotato/dash-docs | [
"3b56d18454923f753283ac7c836f71ba23cb3bed"
] | [
"dash_docs/tutorial/examples/graph_callbacks_same_graph.py"
] | [
"import math\nimport dash\nfrom dash.dependencies import Input, Output\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\n\nexternal_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n\napp = dash.Dash(__name__, external_stylesheets=external_stylesheets)\n\ndf ... | [
[
"pandas.read_csv"
]
] |
lantuzi/Joint-Text-and-Image-Representation | [
"906d490f2795fdd1dd76abb70d658b49bf68f8bd"
] | [
"test/tsne/tsne_caption_3d_scatter_test.py"
] | [
" #####################################################################################\n # MIT License #\n # #\n # Copyright (C) 2019 Charly Lamothe, Guillaume Oll... | [
[
"numpy.load"
]
] |
YiqunChen1999/NTIRE2021NHDehazing | [
"3341ae561ac8caff7f40ddf6d4408032a28ff13c"
] | [
"src/main.py"
] | [
"\n\"\"\"\nAuthor:\n Yiqun Chen\nDocs:\n Main functition to run program.\n\"\"\"\n\nimport sys, os, copy\nimport torch, torchvision\n\nfrom configs.configs import cfg\nfrom utils import utils\nfrom models import model_builder\nfrom data import data_loader\nfrom generate import generate\n\ndef main():\n # B... | [
[
"torch.device"
]
] |
qinwang-ai/Contact-Distil | [
"5e98389de70e0d9c4d16bd91ca1326689dc220a6"
] | [
"tools/compute_topAccuracy.py"
] | [
"from ignite.metrics import Metric\nfrom ignite.exceptions import NotComputableError\n\n# These decorators helps with distributed settings\nfrom ignite.metrics.metric import sync_all_reduce, reinit__is_reduced\nimport torch\nimport pandas as pd\nimport argparse\nimport os\nimport numpy as np\n\n\nclass ContactPredi... | [
[
"numpy.array",
"torch.cat",
"numpy.load",
"torch.softmax",
"torch.ones",
"torch.triu",
"torch.Tensor",
"torch.sort",
"torch.sum"
]
] |
aladshaw3/idaes-pse | [
"23d627958cfd934e91fc6cfc2c82661c67237bb5"
] | [
"idaes/models_extra/power_generation/unit_models/soc_submodels/tests/test_herring_replication.py"
] | [
"#################################################################################\n# The Institute for the Design of Advanced Energy Systems Integrated Platform\n# Framework (IDAES IP) was produced under the DOE Institute for the\n# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021\n# by th... | [
[
"pandas.DataFrame",
"numpy.linspace",
"numpy.array",
"pandas.testing.assert_frame_equal"
]
] |
TriplePool/mmdetection | [
"f72a87174ef9397b1e9239809bb961c8edbf4239"
] | [
"mmdet/core/utils/charset.py"
] | [
"import mmcv\nimport numpy as np\nimport torch\n\n\nclass Charset:\n def __init__(self, vocab_path):\n self.vocab_dict = mmcv.load(vocab_path)\n self.BOS_TOKEN = self.vocab_dict['stoi']['<s>']\n self.EOS_TOKEN = self.vocab_dict['stoi']['</s>']\n self.UNKNOWN_TOKEN = self.vocab_dict['s... | [
[
"torch.as_tensor",
"numpy.ones",
"torch.stack"
]
] |
amiruulmabiya/olympic-hero | [
"0492d5c7edb98daedddf9b01d210885e28a1f9cd"
] | [
"code.py"
] | [
"# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\ndata = pd.read_csv(path)\r\n\r\n#Code starts here\r\ndata.rename(columns={\"Total\":\"Total_Medals\"},inplace=True)\r\ndata.head(10)\n\n\n# --------------\n#Code sta... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"numpy.where",
"matplotlib.pyplot.ylabel",
"numpy.intersect1d",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
Murabei-OpenSource-Codes/regen-timescale-db | [
"93e75c9b984434e33ca6a8dde889a9d0411faf6a"
] | [
"aux/load_database.py"
] | [
"\"\"\"Create a dummy database just to simulate regen.\"\"\"\nimport pandas as pd\nimport random\nfrom sqlalchemy import create_engine\n\n\nengine = create_engine(\n \"postgresql://murabei:is_very_nice!@localhost/murabei\")\npd.read_sql(\"SELECT 1;\", con=engine)\n\n###################\n# Create database #\nvar1... | [
[
"pandas.DataFrame",
"pandas.read_sql"
]
] |
jls713/jfactors | [
"2427f4bad052b37fb7eefffaa4ee46d398f33504"
] | [
"spherical/J_D_table.py"
] | [
"# -*- coding: utf-8 -*-\n### Generates J and D factor table for Evans, Sanders & Geringer-Sameth (2016)\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nfrom scipy.special import gamma as Gamma\nfrom spherical_Jfactors import *\n\n### A set of strings to convert pan... | [
[
"numpy.delete",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.genfromtxt",
"numpy.ones",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"numpy.append",
"numpy.log10",
"pandas.read_csv",
"matplotlib.pyplot.subplots_adjust"
]
] |
daijuting/interpGaze | [
"f2a73497f67f4f941956605faba242b00cb26c90",
"913a190ad9c3f56a93fc5ba79452fbba3f91cffe"
] | [
"src/util/sqrtm.py",
"comparison/DeepWarp/gui.py"
] | [
"import torch\nfrom torch.autograd import Variable\nfrom torch.autograd import Function\nimport numpy as np\nimport scipy.linalg\n\n\nclass MatrixSquareRoot(Function):\n \"\"\"Square root of a positive definite matrix.\n NOTE: matrix square root is not differentiable for matrices with\n zero eigenval... | [
[
"torch.autograd.Variable",
"torch.autograd.gradcheck",
"torch.randn",
"torch.from_numpy"
],
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.copy",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.linspace"
]
] |
liuky74/MLP-Mixer-pytorch | [
"81800ddcaa7c2f60230acb14bbfc99075e0bc21e"
] | [
"data_package/data_transform.py"
] | [
"import cv2\nimport numpy as np\ntmp_file_idx = 0\n# 这个类每次进行预处理的时候都会重新声明,所以init每次预处理都会执行,随机数并不会被固定\nclass VideoTransform():\n def __init__(self, size,\n flip_p=0.5, # 反转概率\n mean=127, # 通道均值\n std=1.,\n horizontal_flip= False, # 随机水平翻转\n ... | [
[
"numpy.zeros_like",
"numpy.random.rand",
"numpy.empty",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
lufeng5001/simetra | [
"4f046b57386255ffd3c9e70b63d1ef36e7139aea"
] | [
"simetra/mfilter.py"
] | [
"import numpy as np\n\ndef get_template_average(template, beam):\n \"\"\"\n Calculate the (beam-weighted) average of the lightcurve template <F>.\n\n template.shape => (t,)\n beam.shape => (x, y, t)\n output.shape => (x, y)\n\n where t is the number of time samples, (x, y) is the image dimension. ... | [
[
"numpy.repeat",
"numpy.sum",
"numpy.inner"
]
] |
Ruiguo124/ConcentrateAI | [
"855ce1280e0d66a6bfe4a39953aee118f25d82cf"
] | [
"eyecapture.py"
] | [
"import cv2\nimport tensorflow as tf\nimport numpy as np\nfrom tensorflow.keras.preprocessing import image\n\neye = {1:'Closed',0:'Open'}\n\neyes_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')\nface_cascade = cv2.CascadeClassifier('haarcascade_face.xml')\ntry:\n model = tf.keras.models.load_model('eye.h... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.argmax",
"numpy.expand_dims"
]
] |
emcxcme/slitherin | [
"7f4f3a93558e6824580ed268de09c9c3671aa456"
] | [
"game/environment/environment.py"
] | [
"\nimport random\nimport math\nimport numpy as np\nfrom collections import deque\nfrom game.helpers.point import Point\nfrom game.environment.action import Action\nfrom game.environment.tile import Tile\nfrom game.helpers.constants import Constants\n\n\nclass Environment:\n\n snake = []\n fruit = []\n wall... | [
[
"numpy.array"
]
] |
cabrittin/elegansbrainmap | [
"049a26a094e085bacc70f5b05ea04a007d00eb2c",
"049a26a094e085bacc70f5b05ea04a007d00eb2c"
] | [
"scripts/syn_size_violin.py",
"scripts/cluster_perturbation_validation.py"
] | [
"\"\"\"\n@name: syn_size_violoin.py\n@description:\n plot distribution of synapse sizes\n\n@author: Christopher Brittin\n@email: \"cabrittin\"+ <at>+ \"gmail\"+ \".\"+ \"com\"\n@date: 2020-03\n\"\"\"\n\nimport os\nimport argparse\nfrom configparser import ConfigParser,ExtendedInterpolation\nimport pandas as pd\n... | [
[
"matplotlib.ticker.MultipleLocator",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
],
[
"numpy.max",
"scipy.stats.norm",
"numpy.zeros",
"numpy.log",
"numpy.true_divide",
... |
jrderek/Big_Data_Engineering_Portfolio | [
"bf7a5efb24f2c6e860e5ead544dadc08f791814e"
] | [
"Projects/Spotify ETL/dags/spotify_etl.py"
] | [
"import sqlite3\nimport requests\nimport json\nfrom datetime import datetime\nimport datetime\nimport pandas as pd\nimport sqlalchemy\nfrom sqlalchemy.orm import sessionmaker\nimport auth\n\n# Transform\ndef check_if_valid(df: pd.DataFrame) -> bool:\n # Check if dataframe is empty\n if df.empty:\n prin... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
bpedersen2/python-gr | [
"664f83d11c5d710aa27e117cc1c2899fbd5582a7",
"664f83d11c5d710aa27e117cc1c2899fbd5582a7"
] | [
"examples/matplotlib/animation/anim.py",
"examples/matplotlib/animation/simple_3danim.py"
] | [
"\nfrom pylab import plot, draw, pause\nfrom numpy import arange, sin, pi\nfrom time import time\n\nx = arange(0, 2 * pi, 0.01)\n\ntstart = time()\nline, = plot(x, sin(x))\nfor i in arange(1, 200):\n line.set_ydata(sin(x + i / 10.0))\n draw()\n pause(0.001)\n\nfps_mpl = int(200 / (time() - tstart))\nprint(... | [
[
"numpy.sin",
"numpy.arange"
],
[
"matplotlib.pyplot.show",
"numpy.empty",
"numpy.random.rand",
"matplotlib.pyplot.figure"
]
] |
lemiceterieux/nilearn | [
"bb3c9bf0aaf82ae99a5c425d17ce4bd174ec7056",
"bb3c9bf0aaf82ae99a5c425d17ce4bd174ec7056"
] | [
"examples/01_plotting/plot_3d_map_to_surface_projection.py",
"nilearn/glm/thresholding.py"
] | [
"\"\"\"\nMaking a surface plot of a 3D statistical map\n=============================================\n\nproject a 3D statistical map onto a cortical mesh using\n:func:`nilearn.surface.vol_to_surf`. Display a surface plot of the projected\nmap using :func:`nilearn.plotting.plot_surf_stat_map` and adding contours of... | [
[
"numpy.array"
],
[
"numpy.max",
"numpy.ceil",
"numpy.minimum",
"scipy.ndimage.label",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.trunc",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.sort",
"scipy.stats.norm.sf",
"numpy.size",
"numpy.cumsum"... |
khayratk/OpenPNM | [
"a0a057d0f6346c515792459b1da97f05bab383c1"
] | [
"OpenPNM/Geometry/models/throat_shape_factor.py"
] | [
"r\"\"\"\n===============================================================================\nSubmodule -- throat_shape_factor\n===============================================================================\n\n\"\"\"\nimport scipy as _sp\n\n\ndef compactness(geometry, throat_perimeter='throat.perimeter',\n ... | [
[
"scipy.sqrt",
"scipy.ones_like"
]
] |
sophieball/toxicity-detector | [
"7c07c5e6a6915428fdae64cbd3bc07caa697774e"
] | [
"src/get_data.py"
] | [
"#from pymongo import MongoClient\r\nimport pandas as pd\r\nimport random\r\nfrom copy import deepcopy\r\n#import mysql.connector\r\n\r\n\"\"\"\r\ndef connect_to_database():\r\n global db\r\n mongo_name = \"NAME\"\r\n mongo_password = \"PASSWORD\"\r\n\r\n # Connect to the Mongo Database\r\n client = ... | [
[
"pandas.read_csv"
]
] |
scott-huberty/mne-python | [
"17f4260f42b7c24489263ff10dee612789de8dfb"
] | [
"mne/viz/_brain/_brain.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Eric Larson <larson.eric.d@gmail.com>\n# Oleh Kozynets <ok7mailbox@gmail.com>\n# Guillaume Favelier <guillaume.favelier@gmail.com>\n# jona-sassenhagen <jona.sassenhagen@gmail.com>\n# Joan Massich <mailsik@gm... | [
[
"numpy.dot",
"numpy.array_equal",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.max",
"numpy.full",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.empty",
"numpy.interp",
"numpy.eye",
"numpy.unravel_index",
"numpy.prod",
"numpy.arange",
"numpy.i... |
nakosung/tensorflow-wavenet | [
"90dbf52949937cd507874917de9fded4b6067fcb"
] | [
"test/test_model.py"
] | [
"\"\"\"Unit tests for the WaveNet that check that it can train on audio data.\"\"\"\n\nimport json\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom wavenet import WaveNetModel, time_to_batch, batch_to_time, causal_conv\n\n\ndef MakeSineWaves():\n \"\"\"Creates a time-series of audio amplitudes correspondin... | [
[
"tensorflow.trainable_variables",
"tensorflow.convert_to_tensor",
"numpy.sin",
"tensorflow.train.AdamOptimizer",
"tensorflow.initialize_all_variables",
"numpy.random.seed",
"numpy.arange",
"tensorflow.test.main"
]
] |
Aasdeep/MovieRecommendation | [
"6afdfd6875d4f013e237aeaf99816ad2655be864"
] | [
"main.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom flask import Flask, render_template, request\n# libraries for making count matrix and similarity matrix\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\n# define a function that creates similarity m... | [
[
"pandas.read_csv",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.pairwise.cosine_similarity"
]
] |
mvp18/custom-keras-callbacks | [
"ec6a247e361c234ea9ac3b3cf13b4ceaddcc793b"
] | [
"src/callbacks/metric_callback.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.callbacks import Callback\nimport tensorflow.keras.backend as K\nimport numpy as np\n\nfrom sklearn.metrics import precision_recall_fscore_support, roc_auc_score\n\n\nclass clf_metrics(Callback):\n\n\tdef __init__(self, xVal, yVal):\n\t\tsuper(clf_metrics, self).__ini... | [
[
"numpy.argmax",
"sklearn.metrics.roc_auc_score",
"tensorflow.summary.scalar",
"sklearn.metrics.precision_recall_fscore_support"
]
] |
logoc/fil_backend | [
"60347fc0213440b19743dfc10ce8f66979c4ffa5"
] | [
"qa/L0_e2e/test_model.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.concatenate",
"numpy.product",
"numpy.isnan",
"numpy.random.rand",
"numpy.dtype",
"numpy.vstack"
]
] |
NarutoUA/WaveRNN | [
"ed80c3f092b9c086d42af51a7f2545727ed1610c"
] | [
"train_tacotron.py"
] | [
"import torch\nfrom torch import optim\nimport torch.nn.functional as F\nfrom utils import hparams as hp\nfrom utils.display import *\nfrom utils.dataset import get_tts_datasets\nfrom utils.text.symbols import symbols\nfrom utils.paths import Paths\nfrom models.tacotron import Tacotron\nimport argparse\nfrom utils ... | [
[
"torch.device",
"numpy.isnan",
"torch.cuda.amp.autocast",
"torch.nn.functional.l1_loss",
"torch.no_grad",
"numpy.save",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.cuda.amp.GradScaler"
]
] |
urielsinger/fairwalk | [
"b9f0e5ac66dd0c03b7865dfc8fe03fcbfaf05200"
] | [
"fairwalk/fairwalk.py"
] | [
"import os\nfrom collections import defaultdict\n\nimport numpy as np\nimport networkx as nx\nimport gensim\nfrom joblib import Parallel, delayed\nfrom tqdm import tqdm\n\nfrom .parallel import parallel_generate_walks\n\n\nclass FairWalk:\n FIRST_TRAVEL_KEY = 'first_travel_key'\n PROBABILITIES_KEY = 'probabil... | [
[
"numpy.array"
]
] |
ba-san/DL-CV-tools | [
"ae5895a189fde39abe342ec19eaca2f388504b48"
] | [
"img_3d_by_luminance.py"
] | [
"#https://teratail.com/questions/98319\n# 2d img --> 3d img by luminance\n\nfrom PIL import Image, ImageOps\nimport numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\n\n# 画像読み込み\norg_img = Image.open('4388281942_resized.jpg')\n# グレースケール化\nimg = ImageOps.grayscale(org_img)\n# 配列化\... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"numpy.asarray"
]
] |
Yury-MonZon/pycryptobot | [
"bca95ac0fc8fd813e2bf7ef5ca16c4b993e5bff3"
] | [
"pycryptobot.py"
] | [
"\"\"\"Python Crypto Bot consuming Coinbase Pro or Binance APIs\"\"\"\n\nimport functools\nimport os\nimport sched\nimport sys\nimport time\nimport pandas as pd\nfrom datetime import datetime\nfrom models.PyCryptoBot import PyCryptoBot, truncate as _truncate\nfrom models.AppState import AppState\nfrom models.Tradin... | [
[
"pandas.DataFrame"
]
] |
VASIL-ANSARI/tensorflow | [
"9dea91b4a99f3a5613f07b6d6648417ed05d6277"
] | [
"tensorflow/python/framework/ops.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.client.pywrap_tf_session.TF_OperationGetAttrInt",
"tensorflow.python.framework.device.is_device_spec",
"tensorflow.core.framework.attr_value_pb2.AttrValue.ListValue",
"tensorflow.python.tf2.enabled",
"tensorflow.python.util.memory.dismantle_ordered_dict",
"tensorflow.pyt... |
blagojce95/ai-research-mamo-framework | [
"7f3b5a5a9fb8b19c9eef453b81b03b6046a33bf2"
] | [
"tests/unit/test_validator.py"
] | [
"from metric.recall_at_k import RecallAtK\nfrom loss.vae_loss import VAELoss\nfrom dataloader.mamo_dataset import MamoDataset\nfrom validator import Validator\nfrom torch.utils.data import DataLoader\nfrom models.multi_VAE import MultiVAE\nimport os\nimport numpy as np\nimport pytest\nimport yaml\n\n# Packages need... | [
[
"numpy.random.seed",
"numpy.random.rand",
"numpy.load",
"torch.utils.data.DataLoader"
]
] |
terasakisatoshi/pyvino | [
"f8b8548be9d38f775886d7562aa4e3b5411ea97a"
] | [
"pyvino/model/human_pose_estimation/human_3d_pose_estimator/modules/pose.py"
] | [
"import cv2\nimport numpy as np\n\nfrom ..modules.one_euro_filter import OneEuroFilter\n\n\nclass Pose:\n num_kpts = 18\n kpt_names = ['neck', 'nose',\n 'l_sho', 'l_elb', 'l_wri', 'l_hip', 'l_knee', 'l_ank',\n 'r_sho', 'r_elb', 'r_wri', 'r_hip', 'r_knee', 'r_ank',\n ... | [
[
"numpy.sum",
"numpy.array",
"numpy.count_nonzero",
"numpy.spacing"
]
] |
ZhangYikaii/Proto-CAT | [
"57bb2c7fd88a9489faa88e3b904218bf5fb01b4e"
] | [
"run/prepare_lrw1000_audio.py"
] | [
"######################################\n## 数据文件夹下LRW文件夹的名字. ##\n######################################\nLRW1000_DATA_PATH_NAME = '/data/zhangyk/data/CAS-VSR-W1k/audio/LRW1000_Public/audio'\nLRW1000_AUDIO_DATA_PATH_NAME = '/data/zhangyk/data/lrw1000_audio_pkl'\n######################################\n\nimport torch... | [
[
"torch.zeros"
]
] |
techwizrd/leaf-sparse-kmeans | [
"24b6a7e930c91267fad6c27ec9f8a0afebe1e09c"
] | [
"results/exp85/randk_4_10/client.py"
] | [
"#!/usr/bin/env python\n\nimport random\nimport warnings\nimport time\nimport numpy as np\nfrom compressors import (\n sparse_ratio_metric,\n TopKCompressor,\n RandKCompressor\n)\n\n\nclass Client:\n\n def __init__(self, client_id, group=None, train_data={'x' : [],'y' : []}, eval_data={'x' : [],'y' : []... | [
[
"numpy.average",
"numpy.array",
"numpy.ceil"
]
] |
iliar-rabet/SDMob | [
"e24a00ba29ce92f37bfbcb2595713f2764cd8e9d"
] | [
"examples/res.py"
] | [
"#!/usr/bin/python3\nfrom datetime import datetime\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt \n\ntry:\n\tif sys.argv[1]:\n\t\tfileName = sys.argv[1]\nexcept IndexError:\n\tprint(\"Using default file name.\")\n\tfileName = 'loglistener.txt'\n\nf = open(fileName,\"r\")\nf2 = open(fileName,\"r\"... | [
[
"numpy.savez"
]
] |
manodeep/rgz_rcnn | [
"ccb618e289250b4746821e04779876a8bd54d617"
] | [
"lib/utils/boxes_grid.py"
] | [
"# --------------------------------------------------------\n# Subcategory CNN\n# Copyright (c) 2015 CVGL Stanford\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Yu Xiang\n# --------------------------------------------------------\n\nfrom __future__ import absolute_import\nimport numpy as... | [
[
"numpy.repeat",
"numpy.reshape",
"numpy.zeros",
"numpy.tile",
"numpy.arange",
"numpy.dstack",
"numpy.hstack",
"numpy.meshgrid",
"numpy.floor"
]
] |
JohnAndrewTaylor/flowsa | [
"21b14b19f08370db574bdd59219a2773983c6f95"
] | [
"scripts/FlowByActivity_Crosswalks/write_Crosswalk_USDA_CoA_Cropland.py"
] | [
"# write_Crosswalk_UDSA_CoA_Cropland.py (scripts)\n# !/usr/bin/env python3\n# coding=utf-8\n# ingwersen.wesley@epa.gov\n\n\"\"\"\nCreate a crosswalk linking the downloaded USDA_CoA_Cropland to NAICS_12. Created by selecting unique Activity Names and\nmanually assigning to NAICS\n\nNAICS8 are unofficial and are not ... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
ctb/BioBombe | [
"8e4da86914d3d45d57f549b057d17e42a712ed62"
] | [
"8.gtex-interpret/scripts/nbconverted/1A.download-neutrophil-data.py"
] | [
"\n# coding: utf-8\n\n# # Download Publicly Available Neutrophil Dataset\n# \n# **Gregory Way, 2018**\n# \n# Here, I download [GSE103706](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE103706) which is associated with [Rincon et al. 2018](https://doi.org/10.1186/s12864-018-4957-6).\n# \n# This dataset includ... | [
[
"pandas.read_table",
"pandas.DataFrame",
"pandas.read_excel",
"sklearn.preprocessing.MinMaxScaler",
"pandas.Series"
]
] |
kangzhiq/Rotate-and-Render | [
"e4b0946260f9ece8af7066f2668ee889a1ee9f23"
] | [
"data/casia_dataset.py"
] | [
"import os\nimport math\nimport numpy as np\nfrom PIL import Image\nimport skimage.transform as trans\nimport cv2\nimport torch\nfrom data import dataset_info\nfrom data.base_dataset import BaseDataset\nimport util.util as util\n\ndataset_info = dataset_info()\n\nclass CasiaDataset(BaseDataset):\n @staticmethod\... | [
[
"numpy.array",
"numpy.random.randint",
"torch.from_numpy",
"numpy.frombuffer"
]
] |
N-Squared-Labs/MUFFT-GAN | [
"df07034366eb4fb31cdd30a8042b5c000ae414a7"
] | [
"models/base_models.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport numpy as np\r\nimport torch.nn.functional as F\r\nfrom train_utils.util_functions import *\r\n\r\n# -------------------------------------------------\r\n# Reference Equations\r\n# -------------------------------------------------\r\n\r\n# Output height = (Input heigh... | [
[
"torch.nn.Linear",
"numpy.array",
"numpy.ceil",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.randperm",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d"... |
reinert/talos | [
"d8d4cb0377c99e9a973f7d4ef4d49e941ed903d8"
] | [
"talos/parameters/round_params.py"
] | [
"from numpy import random\n\n\ndef round_params(self):\n\n '''Picks the paramaters for a round based on the available\n paramater permutations using the param_log index'''\n\n # pick the permutation for the round\n if self.search_method == 'random':\n _choice = random.choice(self.param_log)\n\n ... | [
[
"numpy.random.choice"
]
] |
yuayi521/keras-example | [
"3f624a945963928c8d3b9485169584db5e10ce4b"
] | [
"tests/keras/backend/backend_test.py"
] | [
"import pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nimport scipy.sparse as sparse\n\nfrom keras import backend as K\nfrom keras.backend import theano_backend as KTH, floatx, set_floatx, variable\nfrom keras.backend import tensorflow_backend as KTF\nfrom keras.utils.conv_utils import conve... | [
[
"numpy.repeat",
"numpy.testing.assert_allclose",
"numpy.random.choice",
"numpy.array_equal",
"numpy.random.rand",
"numpy.min",
"numpy.mean",
"numpy.exp",
"numpy.alltrue",
"numpy.random.random",
"numpy.max",
"numpy.log",
"numpy.eye",
"numpy.prod",
"numpy.... |
pwdemars/pglib-uc | [
"e835335e569781c5cb5fa6b77dc7e5cde49a4836"
] | [
"tests.py"
] | [
"from create_milp_dict import create_problem_dict\nfrom uc_model import solve_milp, solution_to_schedule\nfrom rl4uc.rl4uc.environment import make_env\nimport numpy as np\nimport pandas as pd\n\n\ndef test_kazarlis():\n \"\"\"Kazarlis 1996 problem\"\"\"\n\n demand = np.array([700, 750, 850, 950, 1000, 1100,\n... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
naylor-b/pyCycle | [
"787743b39b17443631debb145a976b0ccdee43ab"
] | [
"example_cycles/tests/benchmark_hbtf_offdesign.py"
] | [
"import numpy as np\nimport unittest\nimport os\n\nimport openmdao.api as om\nfrom openmdao.utils.assert_utils import assert_rel_error\n\nfrom example_cycles.high_bypass_turbofan import HBTF\n\n\nclass CFM56OffdesignTestCase(unittest.TestCase):\n\n def setUp(self):\n\n self.prob = om.Problem()\n\n ... | [
[
"numpy.seterr"
]
] |
ACea15/sharpy | [
"c89ecb74be3cb9e37b23ac8a282c73b9b55dd792",
"c89ecb74be3cb9e37b23ac8a282c73b9b55dd792",
"c89ecb74be3cb9e37b23ac8a282c73b9b55dd792"
] | [
"sharpy/linear/assembler/linearuvlm.py",
"cases/coupled/hinged_controlled_wing/generate_hinged_controlled_wing.py",
"sharpy/generators/shearvelocityfield.py"
] | [
"\"\"\"\nLinear UVLM State Space System\n\"\"\"\n\nimport sharpy.linear.utils.ss_interface as ss_interface\nimport numpy as np\nimport sharpy.linear.src.linuvlm as linuvlm\nimport sharpy.linear.src.libsparse as libsp\nimport sharpy.utils.settings as settings\nimport scipy.sparse as sp\nimport sharpy.utils.rom_inter... | [
[
"numpy.dot",
"numpy.zeros",
"scipy.sparse.eye",
"numpy.eye",
"numpy.hstack"
],
[
"numpy.sin",
"numpy.array",
"numpy.savetxt",
"numpy.column_stack",
"numpy.zeros",
"numpy.ones",
"numpy.geomspace",
"numpy.cos",
"numpy.linspace",
"numpy.diag"
],
[
... |
stefanvasilev/keras-tuner | [
"5c402b02af9a2a98ab5eece802f1ec7ca5331379"
] | [
"tutorials/helloworld/helloworld.py"
] | [
"# Copyright 2019 The Keras Tuner 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras... |
Darshan-Ramesh/EmpRecognition | [
"c85775659bcbb79f62de29a7a764cc72f1de0674"
] | [
"src/backbone/resnet.py"
] | [
"import torch.nn as nn\nimport math\nimport torch\nimport pickle\n\n# weights from https://github.com/cydonia999/VGGFace2-pytorch\n# pretrained_model_path = \"..\\\\models\\\\pretrained_models\\\\resnet50_scratch_weight.pkl\"\n# pretrained on traning data VGGFace2\n# resnet50_scratch ResNet-50 trained from scratch ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
fatiando/verde | [
"8bdb785ed42cd4eae1b3e71571ec04b2ec5b2ad3"
] | [
"verde/base/least_squares.py"
] | [
"# Copyright (c) 2017 The Verde Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n#\n# This code is part of the Fatiando a Terra project (https://www.fatiando.org)\n#\n\"\"\"\nFunctions for least-squares fitting with optional regularization.\n\"\"\"\nf... | [
[
"sklearn.linear_model.Ridge",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.StandardScaler"
]
] |
AXE02/NeuroLang | [
"a81ceaa7f0ded20dd26a585065e807e83755c19c"
] | [
"neurolang/frontend/query_resolution.py"
] | [
"r\"\"\"\nQuery Builder Base, Region and Neurosynth Mixins\n================================================\nBase classes to construct Datalog programs.\nCapabilities to declare, manage and manipulate symbols.\nMixins provide capabilities related to brain volumes and\nNeurosynth metadata manipulation\n\"\"\"\nfrom... | [
[
"numpy.asanyarray"
]
] |
datalab-georgetown/fairness-and-missing-values | [
"d51a2fcf6418b39c2422fb6e3fd1ef7b065c9920"
] | [
"fairness_metrics/tnr.py"
] | [
"from sklearn.metrics import confusion_matrix\n\n# acutal is the list of actual labels, pred is the list of predicted labels.\n# positive_pred is the favorable result in prediction task. e.g. get approved for a loan\ndef TNR(actual,pred,positive_pred):\n classes = list(set(actual))\n matrix = confusion_matrix... | [
[
"sklearn.metrics.confusion_matrix"
]
] |
futuran/OpenNMT-py | [
"0fef19aff6ea839e0684314792d41f7e08d1232d"
] | [
"onmt/inputters/dataset_base.py"
] | [
"# coding: utf-8\n\nfrom itertools import chain, starmap\nfrom collections import Counter\n\nimport torch\nfrom torchtext.data import Dataset as TorchtextDataset\nfrom torchtext.data import Example\nfrom torchtext.vocab import Vocab\n\n\ndef _join_dicts(*args):\n \"\"\"\n Args:\n dictionaries with disj... | [
[
"torch.save",
"torch.LongTensor"
]
] |
PAWTOSKI/RecoBooks | [
"950ad29482544a3c41f78c26b15e9a7efa1e5ea1"
] | [
"services.py"
] | [
"import pandas as pd\nimport numpy as np\nimport re\n\n\n\ndef format_books(data_books: pd.DataFrame):\n \"\"\"\n nettoyer et formatter des données fournant par dataframe: books\n afin d'avoir un df books tout prête à insérer dans BD\n *** Params:\n data_books: dataframe étant cha... | [
[
"pandas.merge"
]
] |
paarthneekhara/cleverhans | [
"5400ee359946a5abb7b66e41084f15523d9c98e0"
] | [
"examples/adversarial_asr/generate_imperceptible_adv_def.py"
] | [
"import tensorflow as tf\nfrom lingvo import model_imports\nfrom lingvo import model_registry\nimport numpy as np\nimport scipy.io.wavfile as wav\nimport generate_masking_threshold as generate_mask\nfrom tool import Transform, create_features, create_inputs\nimport time\nfrom lingvo.core import cluster_factory\nfro... | [
[
"tensorflow.group",
"tensorflow.clip_by_value",
"tensorflow.identity",
"tensorflow.set_random_seed",
"tensorflow.concat",
"tensorflow.global_variables",
"tensorflow.ConfigProto",
"tensorflow.get_collection",
"numpy.array",
"tensorflow.train.AdamOptimizer",
"tensorflow.n... |
MosesBomera/CloudCoverDetectionChallenge | [
"da1e35586fd30cc795efe6baca1f297400e5ce99"
] | [
"scripts/losses.py"
] | [
"import numpy as np\n\ndef intersection_over_union(pred, true):\n \"\"\"\n Calculates intersection and union for a batch of images.\n\n Args:\n pred (torch.Tensor): a tensor of predictions\n true (torc.Tensor): a tensor of labels\n\n Returns:\n intersection (int): total intersection... | [
[
"numpy.logical_or",
"numpy.logical_and"
]
] |
timotheecour/ncluster | [
"24baf049c2690505bf4dd63ec7d8822edb81b5a9"
] | [
"benchmarks/ray_two_machines.py"
] | [
"#!/usr/bin/env python\n#\n# Example of two process Ray program, worker sends values to parameter\n# server on a different machine\n#\n# Run locally:\n# ./ray_two_machines.py\n#\n# Run on AWS:\n# ./ray_two_machines.py --aws\n\n\n# Example timings\n# c5.18xlarge over network: over network: 63.0 ms: 1586.76 MB/second... | [
[
"numpy.zeros",
"numpy.median",
"numpy.ones",
"numpy.min",
"numpy.mean"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.