repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
dianakolusheva/indra | [
"9dc1ad43457bf1a722384b00c84d18103d728594"
] | [
"indra/explanation/pathfinding/pathfinding.py"
] | [
"__all__ = ['shortest_simple_paths', 'bfs_search', 'find_sources',\n 'get_path_iter', 'bfs_search_multiple_nodes',\n '_bidirectional_shortest_path', '_bidirectional_pred_succ',\n 'open_dijkstra_search']\nimport sys\nimport logging\nfrom collections import deque, OrderedDict\nfrom copy ... | [
[
"numpy.log"
]
] |
winston-zillow/paddle2onnx | [
"65b9b8a628f6dc65109c30106e58174fcaa5845b"
] | [
"tests/op_test.py"
] | [
"# Copyright (c) 2018 PaddlePaddle 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 re... | [
[
"numpy.testing.assert_almost_equal",
"numpy.squeeze",
"numpy.array"
]
] |
QuarkFang/scanpy | [
"f2e315525defcafd7971824248c4abbf9b51cee8"
] | [
"scanpy/_utils.py"
] | [
"\"\"\"Utility functions and classes\n\"\"\"\nimport sys\nimport inspect\nimport warnings\nimport importlib.util\nfrom pathlib import Path\nfrom weakref import WeakSet\nfrom collections import namedtuple\nfrom functools import partial, wraps\nfrom types import ModuleType, MethodType\nfrom typing import Union, Calla... | [
[
"numpy.random.seed",
"numpy.random.choice",
"numpy.unique",
"numpy.min",
"numpy.arange",
"numpy.cumsum",
"scipy.sparse.csr_matrix",
"numpy.argsort",
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
karolinaszafranbelzowska/Fisher-s-Iris-Data-Set-2019 | [
"5ad7fb98ab65d268dd7a9ebebd13eb00970ddc4b"
] | [
"irisVirginica_summarise.py"
] | [
"# Karolina Szafran-Belzowska, 2019/04/25\n# Iris Flower Data Analysis\n\n# this code will print the Iris VIRGINICA flower Data Set:\n# mean, min., max., std., percentage and count.\n# it will summarise the data \n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt \n\n\ndata = (\"irisVirgini... | [
[
"pandas.read_csv"
]
] |
kzorina/pro_hw2_simulator | [
"c479368fb99ae9cfd757414930a6e556a6b0018f"
] | [
"utils.py"
] | [
"from pyphysx import *\nimport numpy as np\nfrom pyphysx import ShapeFlag, GeometryType\n\ndef get_matrix_dh(theta, d, alpha, a):\n return np.array([[np.cos(theta), -np.sin(theta) * np.cos(alpha), np.sin(theta) * np.sin(alpha), a*np.cos(theta)],\n [np.sin(theta), np.cos(theta) * np.cos(alpha)... | [
[
"numpy.cos",
"numpy.sin"
]
] |
guillaume-plantevin/VeeSeeVSTRack | [
"76fafc8e721613669d6f5ae82a0f58ce923a91e1"
] | [
"plugins/community/repos/Southpole/eurorack/grids/resources/lookup_tables.py"
] | [
"#!/usr/bin/python2.5\n#\n# Copyright 2012 Olivier Gillet.\n#\n# Author: Olivier Gillet (olivier@mutable-instruments.net)\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version... | [
[
"numpy.arange"
]
] |
cjymz886/text_bert_cnn | [
"2a781881eea45d888ba3b2f32e20a6b706b07b9e"
] | [
"text_run.py"
] | [
"import sys\r\nimport os\r\nimport time\r\nfrom sklearn import metrics\r\nfrom text_model import *\r\nfrom loader import *\r\n\r\ndef evaluate(sess,dev_data):\r\n '''批量的形式计算验证集或测试集上数据的平均loss,平均accuracy'''\r\n data_len = 0\r\n total_loss = 0.0\r\n total_acc = 0.0\r\n for batch_ids,batch_mask,batch_seg... | [
[
"sklearn.metrics.classification_report",
"sklearn.metrics.confusion_matrix"
]
] |
scivislab/BDI-ED | [
"c46c9a13706f7a7b0e877dd8f1ebf41662507d83"
] | [
"mergeTreeEdit_constrained.py"
] | [
"import numpy as np\nimport math\nfrom scipy.optimize import linear_sum_assignment\n\nfrom contourMergeTrees_helpers import *\n \ndef editDistance_constrained(nodes1,topo1,rootID1,nodes2,topo2,rootID2,editCost,traceback=False):\n memT = dict()\n memF = dict()\n \n #===========================... | [
[
"scipy.optimize.linear_sum_assignment",
"numpy.zeros"
]
] |
jakesabathia2/turicreate | [
"18dfb91de02992a02037358714e1746c5a88403b"
] | [
"src/python/turicreate/test/test_sframe.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\nfrom __future__ import print_function as _\nfrom __future__ import divisio... | [
[
"numpy.unique",
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal",
"numpy.std",
"numpy.mean",
"numpy.var",
"numpy.array",
"numpy.sum"
]
] |
vartikatewari/Causalfairness | [
"532deed97019738f9c6b30f215e73c79d4fc9205"
] | [
"src/causalfairness/model.py"
] | [
"\"\"\" Contains model definitions \"\"\"\n\nimport torch\nimport pyro\nfrom pyro.distributions import Normal, TransformedDistribution\nfrom pyro.distributions.torch_transform import ComposeTransformModule\nfrom pyro.distributions.conditional import ConditionalTransformedDistribution\nfrom pyro.distributions.transf... | [
[
"torch.tensor",
"torch.ones",
"torch.zeros"
]
] |
s-mackay/combinato | [
"18709b43023c3e66e18586654884d70f611f128e"
] | [
"combinato/plot/plot_rawsignal.py"
] | [
"# -*- coding: utf-8 -*-\n#added comment JN 2014-12-07\n\"\"\"\nscript generates overview figures *from ncs files* to give you a first\nimpression of the data quality, movement artifacts and so on\n\"\"\"\nfrom __future__ import print_function, division, absolute_import\n\nimport os\nimport sys\nimport time\nimport... | [
[
"numpy.linspace",
"scipy.signal.decimate",
"numpy.arange",
"numpy.ceil",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
Teetertater/MARLAnts | [
"a175cfc96688e265049c963934f73fc2a7ee8c63"
] | [
"tower/tower/envs/tower_env_v0_0_1.py"
] | [
"import numpy as np\r\n\r\nimport gym\r\nfrom gym import spaces\r\n\r\n\r\n# CONSTANTS\r\nNUM_AGENTS = 2\r\n\r\nFPS = 2\r\nDISPLAY_SIZE = 512\r\nCELL_SIZE = 32\r\nNUM_CELLS = DISPLAY_SIZE//CELL_SIZE\r\nTARGET_TOWER_HEIGHT = 5\r\nMAX_AGENT_BLOCKS = 2\r\n\r\n\r\naction_list = [\"walk\", \"place\"]\r\n\r\n\r\ndef xy_t... | [
[
"numpy.zeros",
"numpy.random.randint"
]
] |
DIUx-xView/xView3_fourth_place | [
"47f638127bb90262e031ccb3da2b332aecf72e2b",
"47f638127bb90262e031ccb3da2b332aecf72e2b"
] | [
"src/xview3/misc/pred2label_concat.py",
"src/xview3/models/frcnn_l1.py"
] | [
"import pandas as pd\nimport sys\n\ngt_path = sys.argv[1]\npred_path = sys.argv[2]\nout_path = sys.argv[3]\n\ngt = pd.read_csv(gt_path)\npred = pd.read_csv(pred_path)\n\nscores = []\nfor _, label in gt.iterrows():\n if label.confidence in ['HIGH', 'MEDIUM']:\n scores.append(1.0)\n else:\n scores... | [
[
"pandas.concat",
"pandas.read_csv"
],
[
"torch.sigmoid",
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.Conv2d",
"torch.where",
"torch.nn.functional.smooth_l1_loss"
]
] |
voltek62/h2o-3 | [
"d581245120bf0cb6fab2bc7e8273b4f41f461448"
] | [
"h2o-py/h2o/frame.py"
] | [
"# -*- coding: utf-8 -*-\n# import numpy no numpy cuz windoz\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport requests\nfrom six import iteritems, itervalues\nimport collections\nfrom io import StringIO\nimport csv\nimport imp\nimport os\nimport tempfile\nimport sys\nimpor... | [
[
"matplotlib.use",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
FabianRei/optimal_observer | [
"f1cc99226d63ceb12a6e48e8f4365882ae1b7b27"
] | [
"src/visualization/fa_visualize.py"
] | [
"from preprocess import getTensorList_general\nfrom dipy.reconst.dti import fractional_anisotropy\nimport numpy as np\nfrom skimage.measure import block_reduce\nimport pickle\nfrom PIL import Image\n\ndef six2mat(voxel6):\n return voxel6[[0,3,4,3,1,5,4,5,2]].reshape(3,3)\n\n\ndef getFAfromSix(sixArr, axis=-1):\n... | [
[
"numpy.linalg.eig",
"numpy.max",
"numpy.argmax"
]
] |
caoyunhao/keras-speed-prediction | [
"b1c87a012f8049050f124062e3cc24322e7d95b9"
] | [
"src/train.py"
] | [
"# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 2018/4/5 11:31\n# @Author : Yunhao Cao\n# @File : train.py\nimport codecs\nimport json\nimport os\nimport time\n\nfrom keras import backend as K, Input, Model, models, Sequential\nfrom keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\nfrom ... | [
[
"numpy.array"
]
] |
owerbat/scikit-learn-intelex | [
"986637668853a00f0047b7a8854ddb9fb3620549",
"986637668853a00f0047b7a8854ddb9fb3620549"
] | [
"examples/daal4py/pivoted_qr_batch.py",
"examples/daal4py/decision_tree_classification_batch.py"
] | [
"#===============================================================================\n# Copyright 2014-2021 Intel 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# ... | [
[
"pandas.read_csv",
"numpy.loadtxt"
],
[
"pandas.read_csv",
"numpy.loadtxt"
]
] |
mrbengutierrez/Musical-Instrument-Decoder | [
"15a51c133dc1b55ea76741315c9d6bcada40a6c1"
] | [
"old_code/fft_features_01.py"
] | [
"import scipy.io.wavfile as wavfile\nimport scipy\nimport scipy.fftpack\nimport scipy.signal\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport os\nimport wave\nimport audioop\n\nclass AudioException(Exception):\n \"\"\" General Purpose Exception for class NeuralNetwork\"\"\"\n def __init___(se... | [
[
"scipy.fft",
"scipy.signal.resample",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"scipy.fftpack.fftfreq",
"scipy.arange",
"matplotlib.pyplot.xlabel",
"numpy.array",
"scipy.io.wavfile.read",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
LindgeW/DualEncoder4TextSimilarity | [
"90a729e11166f8c64c5e5ba44df6a7fecc74c733"
] | [
"modules/BertModel_adapter.py"
] | [
"from transformers import BertModel\nimport torch\nimport math\nimport torch.nn as nn\nfrom modules.scale_mix import ScalarMix\n\n\nclass GELU(nn.Module):\n def __init__(self):\n super(GELU, self).__init__()\n\n def forward(self, x):\n return 0.5 * x * (1.0 + torch.tanh(math.sqrt(2.0 / math.pi) ... | [
[
"torch.nn.Linear",
"torch.pow"
]
] |
romeorizzi/TALight | [
"2b694cb487f41dd0d36d7aa39f5c9c5a21bfc18e"
] | [
"example_problems/tutorial/graph_connectivity/graph_connectivity_lib.py"
] | [
"#!/usr/bin/env python3\r\n \r\nfrom collections import defaultdict \r\nimport random \r\nfrom sys import stderr, exit\r\nimport networkx as nx\r\nimport matplotlib.pyplot as plt\r\n\r\nclass Graph(): \r\n \r\n def __init__(self, num_nodes:int): \r\n \"\"\"Constructor: a graph is the number of its nodes... | [
[
"matplotlib.pyplot.show"
]
] |
qingfan-amber/uis-rnn | [
"b0889e5a2a7f590d8919fe2634df233464eff656"
] | [
"tests/utils_test.py"
] | [
"# Copyright 2018 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 agreed ... | [
[
"numpy.array"
]
] |
UtrechtUniversity/datascienceday-hpc | [
"119ca79d5d369020dbf00ecd7c81da736f6e34e8",
"119ca79d5d369020dbf00ecd7c81da736f6e34e8"
] | [
"python/aggregation.py",
"python/digits_svm.py"
] | [
"# Aggregate the results and generate a plot\n#\n# Authors: Roel Brouwer, Kees van Eijden, Jonathan de Bruin\n#\n# Dependencies: sklearn, numpy\n# License: BSD-3-Clause\n\n# pylint: disable=C0321\n\nimport os\nimport re\nimport glob\nimport warnings\n\nfrom sklearn import metrics\nimport numpy as np\nimport matplot... | [
[
"matplotlib.use",
"sklearn.metrics.f1_score",
"numpy.loadtxt",
"pandas.DataFrame"
],
[
"sklearn.metrics.confusion_matrix",
"sklearn.svm.SVC",
"numpy.savetxt",
"sklearn.metrics.classification_report",
"numpy.loadtxt"
]
] |
mudrat/sonnet | [
"108fce7bc1f5313a3ac4cadc58dbb3cb15adc39f"
] | [
"sonnet/python/modules/basic_rnn.py"
] | [
"# Copyright 2017 The Sonnet 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.TensorShape",
"tensorflow.logging.warning",
"tensorflow.concat",
"tensorflow.python.framework.tensor_shape.as_shape",
"tensorflow.python.util.nest.map_structure",
"tensorflow.python.util.nest.pack_sequence_as",
"tensorflow.python.util.nest.flatten"
]
] |
Pineapple-1/open-cv | [
"91e6ef6ee6150976279f68151fddc49066171503"
] | [
"histogram.py"
] | [
"import cv2 as cv\nimport matplotlib.pyplot as plt\nCATS =cv.imread('Photos/cats 2.jpg')\nGRAY = cv.cvtColor(CATS,cv.COLOR_BGR2GRAY)\nGRAY_HIST= cv.calcHist([CATS],[2],None,[256],[0,255])\nplt.figure()\nplt.title('HISTOGRAM')\nplt.xlabel('BINS')\nplt.ylabel('# of pixels')\nplt.plot(GRAY_HIST)\nplt.xlim([0,256])\npl... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
Reuben-Brewer/Phidgets1xEncoderENC1000_ReubenPython2and3Class | [
"ee0a4aa63eba4569f90dde002b5c2f413651febc"
] | [
"LowPassFilter_ReubenPython2and3Class.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\n'''\r\nReuben Brewer, Ph.D.\r\nreuben.brewer@gmail.com\r\nwww.reubotics.com\r\n\r\nApache 2 License\r\nSoftware Revision D, 03/013/2022\r\n\r\nVerified working on: Python 2.7, 3.8 for Windows 8.1, 10 64-bit and Raspberry Pi Buster (no Mac testing yet).\r\n'''\r\n\r\n__author__ = 'reu... | [
[
"numpy.roll"
]
] |
willstauffernorris/boat_data | [
"efd33dcf40155fcf8701269201d36b018a2249e0"
] | [
"pages/predictions.py"
] | [
"# Imports from 3rd party libraries\nimport dash\nimport dash_bootstrap_components as dbc\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nfrom joblib import load\npipeline = load('assets/pipeline.joblib')\n\n\n# Imports from this application\nfr... | [
[
"pandas.DataFrame"
]
] |
MrSamuelLaw/sherline_lathe | [
"7e5d0e38ac72c96587f4e7fe2ffa7e2d03b7ff32"
] | [
"gui/embedded_plot.py"
] | [
"import sys\nimport matplotlib\nfrom matplotlib import rcParams\nmatplotlib.use('Qt5agg')\nrcParams.update({'figure.autolayout': True})\n\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar\nfrom matplotlib.figure import Figure\n\n\nclass MplCanvas(FigureCanv... | [
[
"matplotlib.use",
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"matplotlib.rcParams.update",
"matplotlib.figure.Figure"
]
] |
Erechtheus/mutation-ner | [
"81220fc4079aa7fdebacfba5096d29dae2adb9bf"
] | [
"toIOB.py"
] | [
"# Script to transform corpus from .ann to .iob format\n\nimport pandas as pd\nimport urllib.request # handles url\nimport spacy # spacing and tokenization #conda install -c conda-forge spacy #python -m spacy download en_core_web_sm\n\nnlp = spacy.load('en_core_web_sm')\n\nurl_corpus = \"https://raw.githubusercont... | [
[
"pandas.DataFrame"
]
] |
ironmussa/Optimus | [
"fbaea6e0957f0bc016280a85ff021904faac20c5"
] | [
"optimus/engines/base/distributed/io/jdbc.py"
] | [
"import numpy as np\nimport pandas as pd\nimport sqlalchemy as sa\nfrom dask.dataframe import from_delayed, from_pandas\nfrom dask.delayed import delayed\nfrom sqlalchemy import create_engine\nfrom sqlalchemy import sql\nfrom sqlalchemy.sql import elements\n\n# Optimus plays defensive with the number of rows to be ... | [
[
"pandas.Series",
"pandas.read_sql",
"numpy.linspace"
]
] |
csinva/transformation-importance | [
"256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e",
"256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e",
"256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e"
] | [
"ex_simulation/knockout_wt.py",
"ex_fashion_mnist/model_fashion_mnist.py",
"ex_simulation/01_sim_simple.py"
] | [
"import numpy as np\nimport torch\nimport random\ndevice = 'cuda' if torch.cuda.is_available() else 'cpu'\nimport os, sys\nopj = os.path.join\nfrom tqdm import tqdm\nfrom functools import partial\nimport acd\nfrom copy import deepcopy\nsys.path.append('..')\nfrom transforms_torch import perturb_wt, perturb_wt_augme... | [
[
"torch.ones",
"numpy.random.seed",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cuda.is_available"
],
[
"torch.nn.Dropout",
"torch.nn.Dropout2d",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Ba... |
parmance/tvm | [
"bcbf8f7935bc4e0984d6a1624c187dc41cfd5dc1"
] | [
"python/tvm/relay/frontend/onnx.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.append",
"numpy.flip",
"numpy.iinfo"
]
] |
elavington/PIRE | [
"a3a3358471ba2e44447720e40c13b4a7090d0be2"
] | [
"pi_for_temperature_notebook.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 4 13:38:17 2020\n\n@author: Erik Lavington\n\nThis program caculates Nucleotide diversity (pi) from SNP frequency data.\nExpected input is an Excel or csv file with data from varscan plus metadata.\nA metadata column is used to calculate pi by subset from the sa... | [
[
"numpy.sqrt",
"pandas.DataFrame.from_dict"
]
] |
mveyette/Simple_Neural_Network | [
"a32604b742d20b9bca2b62c873db91055822cfc3"
] | [
"test_NN.py"
] | [
"import numpy as np\r\nimport os\r\nimport NN\r\n\r\n## XOR training set\r\nx = np.array([[0, 0],\r\n [0, 1],\r\n [1, 0],\r\n [1, 1]])\r\n\r\ny = np.array([[0, 1, 1, 0]]).T\r\n\r\nnn = NN.nn((2,3,1))\r\nnn.randomize()\r\nfor i in range(10000):\r\n nn.train(x, y)\r\n \r\n... | [
[
"numpy.array"
]
] |
agalea91/nhl-goalie-pull-optimization | [
"7e57d50163c5f96a22dd5afd96c6e1ba5487c600"
] | [
"notebooks/py/1_html_download.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\nfrom IPython.display import HTML\nHTML('<style>div.text_cell_render{font-size:130%;}</style>')\nget_ipython().run_line_magic('load_ext', 'version_information')\nget_ipython().run_line_magic('version_information', 'pandas')\n\n\n# # Goalie Pull Bayes Optimize\n# \n# - Save... | [
[
"numpy.random.beta"
]
] |
BradleyHigdon/web-scraping-challenge | [
"1078e7e2b5a1fbd74be83d82a2beabbe90220c34"
] | [
"scrape_mars.py"
] | [
"from bs4 import BeautifulSoup as bs\nimport pandas as pd\nfrom splinter import Browser\nimport pymongo\nimport requests\n\n\ndef init_browser():\n executable_path = {\"executable_path\": \"/usr/local/bin/chromedriver\"}\n return Browser(\"chrome\", **executable_path, headless=False)\n\ndef scrape():\n bro... | [
[
"pandas.read_html"
]
] |
cznewt/pyanp | [
"731fa2c6090e274843f854081610599a2001e00a"
] | [
"pyanp/mcanp.py"
] | [
"'''\nMonte Carlo ANP calculations. The main classes are MCAnp, which can perform simulations on all ANP/AHP\nstructures, and PrioritySim, which is the resulting structure that a simulation returns\n'''\nimport numpy as np\nfrom pyanp.priority import pri_eigen\nfrom pyanp.prioritizer import PriorityType\nfrom pyan... | [
[
"scipy.stats.triang",
"numpy.random.uniform",
"pandas.DataFrame"
]
] |
suryagram/sequential_social_dilemma_games | [
"bbac0fa731820572a2698236b5639d9272ace532"
] | [
"visuallizer_rllib.py"
] | [
"\"\"\"Defines a multi-agent controller to rollout environment episodes w/\n agent policies.\"\"\"\n\nimport argparse\nimport json\nimport numpy as np\nimport os\nimport shutil\nimport sys\n\nimport ray\nfrom ray.rllib.agents.registry import get_agent_class\nfrom ray.rllib.models import ModelCatalog\nfrom ray.tun... | [
[
"numpy.zeros"
]
] |
suoxinkey/PlenOctrees_NeRF-SH | [
"bf66ecc93ee166a4dc1a208d063408b452484dde"
] | [
"utils/batchify_rays.py"
] | [
"import torch\n\n\ndef batchify_ray(model, rays, bboxes, chuncks = 1024*7, near_far=None):\n N = rays.size(0)\n if N <chuncks:\n return model(rays, bboxes,near_far =near_far)\n\n else:\n rays = rays.split(chuncks, dim=0)\n if bboxes is not None:\n bboxes = bboxes.split(chunc... | [
[
"torch.cat"
]
] |
montdor/kanagawa.nvim | [
"4a9f193c76d8c5a1a6ab41810787001a7758a576"
] | [
"palette.py"
] | [
"from skimage import io, color\nfrom skimage.transform import rescale\nfrom sklearn.cluster import KMeans\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport argparse\n\ndef palette(img, n=10, r=1):\n img = img[:,:,(0,1,2)]\n img = rescale(img, (r, r, 1), anti_aliasing=True)\n lab = color.rgb2lab(... | [
[
"matplotlib.pyplot.axes",
"numpy.round",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.savefig"
]
] |
LalauX-bit/multiagent-particle-envs-master | [
"5a572f433eac7bc3fb8433897f30517f711f31c6"
] | [
"maddpg/trainer/maddpg.py"
] | [
"import numpy as np\nimport random\nimport tensorflow.compat.v1 as tf\nimport maddpg.common.tf_util as U\n\nfrom maddpg.common.distributions import make_pdtype\nfrom maddpg import AgentTrainer\nfrom maddpg.trainer.replay_buffer import ReplayBuffer\n\n\ndef discount_with_dones(rewards, dones, gamma):\n discounted... | [
[
"tensorflow.compat.v1.square",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.reduce_mean",
"tensorflow.compat.v1.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.group",
"tensorflow.compat.v1.placeholder",
"numpy.std",
"nu... |
songzibo/face_recognition | [
"b0536b925fac1dacca792dc0b3e0d847380bf3fd"
] | [
"examples/facerec_from_webcam.py"
] | [
"import click\nimport os\nimport re\nimport face_recognition.api as face_recognition\nimport multiprocessing\nimport itertools\nimport sys\nimport PIL.Image\nimport numpy as np\nimport face_recognition\nimport cv2\n\n# This is a super simple (but slow) example of running face recognition on live video from your web... | [
[
"numpy.array"
]
] |
legitishan/PteraSoftware | [
"88edd8e3eae61e9de0b481dce9accf95a89a0615"
] | [
"examples/unsteady_benchmark_timed.py"
] | [
"# ToDo: Document this script.\n\nimport timeit\n\nimport numpy as np\n\nn_repeat = 3\nn_execute = 1\n\nprint(\"\\tBenchmarking unsteady solver...\")\n\nsetup = \"\"\"\nimport pterasoftware as ps\n\nflapping_frequency = 1\nnum_chordwise_panels = 5\nnum_spanwise_panels = 20\n\nexample_airplane = ps.geometry.Airplane... | [
[
"numpy.format_float_scientific"
]
] |
celikten/armi | [
"4e100dd514a59caa9c502bd5a0967fd77fdaf00e"
] | [
"armi/reactor/composites.py"
] | [
"# Copyright 2019 TerraPower, 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr... | [
[
"numpy.array",
"numpy.zeros"
]
] |
lucabenedetto/edm2016 | [
"6be7064cd36d21f4482635d9440580b4f1ee6dca"
] | [
"rnn_prof/run_rnn.py"
] | [
"\"\"\"\nScript that constructs an RNN to predict student performance.\n\"\"\"\nfrom __future__ import division\n\nimport logging\n\nimport numpy as np\n\nfrom .data.rnn import build_nn_data\nfrom .simple_rnn import SimpleRnn, RnnOpts\n\n\n_logger = logging.getLogger(__name__)\n\n\ndef run(data_folds, num_folds, nu... | [
[
"numpy.random.seed"
]
] |
oskoumal/djl-serving | [
"d41c4cfd1eb472603017e03dd9adcf5640224f44"
] | [
"engines/python/src/test/resources/accumulate/model.py"
] | [
"#!/usr/bin/env python\n#\n# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file\n# except in compliance with the License. A copy of the License is located at\n#\n# http://aws.amazon.com/apache2.0/\... | [
[
"numpy.zeros"
]
] |
seungwubaek/tensorflow | [
"d0e3ce5b4bc8bea4bbb9fe51635dd36104e4ad86"
] | [
"tensorflow/python/compat/compat.py"
] | [
"# Copyright 2018 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.platform.tf_logging.warning",
"tensorflow.python.util.tf_export.tf_export"
]
] |
DanAnastasyev/unilm | [
"107c0732d7f1810e812e2c2966febf86253e982b"
] | [
"trocr/augmixations/cutout.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\n\nfrom .utils import unpack_mm_params, generate_parameter\nfrom .configs import cutout_process_box_config, cutout_crop_rect_config\nfrom .core import (\n generate_rect_coordinates,\n correct_background_boxes,\n)\n\n\nclass SmartCutout:\n \"\"\"\n Description... | [
[
"numpy.array"
]
] |
jiangzeyinzi/EssentialMC2 | [
"cfb49fa51a13373e4afc74f8800ec8284c41b8d2"
] | [
"papers/pytorch-video-understanding/models/utils/model_ema.py"
] | [
"#!/usr/bin/env python3\n# taken from https://github.com/rwightman/pytorch-image-models/blob/master/timm/utils/model_ema.py\n# thanks for the nice implementation\n\nimport torch\nimport torch.nn as nn\nfrom copy import deepcopy\n\nclass ModelEmaV2(nn.Module):\n \"\"\" Model Exponential Moving Average V2\n Kee... | [
[
"torch.no_grad"
]
] |
xdr940/DeepSfMLearner | [
"591efe6b2ab74b0c72215fe69d2c38d624547fa3"
] | [
"scripts/evaluate_depth_wo_dl.py"
] | [
"from __future__ import absolute_import, division, print_function\r\n\r\nimport cv2\r\nimport numpy as np\r\n\r\nimport torch\r\nfrom torch.utils.data import DataLoader\r\nfrom datasets.mc_dataset import relpath_split\r\n\r\nfrom networks.encoders import getEncoder\r\nfrom networks.depth_decoder import getDepthDeco... | [
[
"numpy.linspace",
"torch.load",
"numpy.clip",
"numpy.logical_and",
"numpy.median",
"torch.utils.data.DataLoader",
"torch.tensor",
"numpy.concatenate",
"numpy.std",
"torch.no_grad",
"numpy.mean",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
maxtomCMU/hfnet | [
"ce3b0b0a2cb663a46108e3697fd042cf188d58aa"
] | [
"colmap-helpers/internal/frame_matching.py"
] | [
"import cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\ndef baseline_sift_matching(img1, img2):\n sift = cv2.xfeatures2d.SIFT_create()\n kp1, des1 = sift.detectAndCompute(img1, None)\n kp2, des2 = sift.detectAndCompute(img2, None)\n matches = cv2.BFMatcher().knnMatch(des1, des2, k=2)\... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.sort",
"numpy.load",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
johann-su/K-nstliche-Intelligenz---12.-klassarbeit | [
"166b855120cb1dbdcdc1b1ff2b5d2d78cf137ba7"
] | [
"Reinforcement Learning/Flappy Birds/flappy.py"
] | [
"#!/Users/johann/anaconda3/bin/python\n\nfrom itertools import cycle\nimport random\nimport sys\nimport numpy as np\n\nimport pygame\nfrom pygame.locals import *\n\n\nFPS = 30\nSCREENWIDTH = 288\nSCREENHEIGHT = 512\n# amount by which base can maximum shift to left\nPIPEGAPSIZE = 100 # gap between upper and lower ... | [
[
"numpy.random.randint"
]
] |
andrewzic/gwb_crn_sims | [
"65bcfea54ac5a42730f4f927a1c2288fc4b821ba",
"65bcfea54ac5a42730f4f927a1c2288fc4b821ba"
] | [
"ppta_dr2_models.py",
"generate_incremental_results.py"
] | [
"import scipy\nimport warnings\nimport numpy as np\nimport enterprise.constants as const\nfrom enterprise.signals import signal_base\nfrom enterprise_extensions import chromatic\nimport enterprise.signals.parameter as parameter\nimport enterprise.signals.gp_signals as gp_signals\nfrom enterprise.signals import gp_p... | [
[
"numpy.dot",
"numpy.log",
"numpy.median",
"scipy.stats.uniform.pdf",
"numpy.all",
"numpy.sign",
"numpy.round",
"numpy.log10",
"numpy.interp",
"numpy.char.lower",
"numpy.array",
"numpy.exp",
"numpy.zeros"
],
[
"numpy.meshgrid",
"numpy.random.seed",
... |
keskinyasemin/Car-License-Plate-Recognition | [
"7737f80f5a8a8bfa244a86f4e4c91b5c35bc1bfc"
] | [
"final.py"
] | [
"from keras.models import model_from_json\nfrom local_utils import detect_lp\nimport matplotlib.image as im\nimport numpy as np\nimport pytesseract\nimport functools\nimport datetime\nimport imutils\nimport cv2\n\n# License Plate Detection\n\ncap = cv2.VideoCapture(0)\nret, img = cap.read()\ncv2.imshow('Original Im... | [
[
"numpy.zeros",
"matplotlib.image.imsave",
"numpy.float32",
"numpy.unique"
]
] |
papermsucode/2020bboxrestoration | [
"89c6767fe4dcc34a0390db4ddb4662bc8b156971"
] | [
"privacy_pipeline.py"
] | [
"import numpy as np\nimport random\nfrom tqdm import tqdm\nfrom PIL import Image\n\nimport torch\nimport torch.nn as nn\n\nfrom archface import LResNet100\n\ntorch.manual_seed(0)\ntorch.cuda.manual_seed_all(0)\n\n\n\nclass Pipeline(nn.Module):\n \"\"\"\n Classs for reconstructing a face from its embedding. Da... | [
[
"torch.flip",
"torch.transpose",
"torch.norm",
"torch.max",
"numpy.linspace",
"torch.zeros",
"torch.manual_seed",
"torch.cosine_similarity",
"torch.nn.ReLU",
"torch.exp",
"torch.FloatTensor",
"torch.rand",
"torch.cuda.manual_seed_all",
"torch.stack",
"to... |
qiaw99/Machine-Learning-1 | [
"ababda51d8fa3cdad1548bf8225991335b912eaf"
] | [
"Ex05 - Model Selection/utils.py"
] | [
"import numpy,scipy.spatial,sklearn,sklearn.datasets\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\n# ============================================\n# DATASETS\n# ============================================\n\n# --------------------------------------------\n# YEAST classification dataset\n# --------------... | [
[
"numpy.dot",
"sklearn.datasets.load_boston",
"numpy.array",
"numpy.exp",
"numpy.random.mtrand.RandomState",
"matplotlib.pyplot.figure"
]
] |
faisalnazir/Deep-Feature-Flow | [
"489959fa4dc2a287ec28237d9eb4eec46ebce698"
] | [
"lib/utils/roidb.py"
] | [
"# --------------------------------------------------------\n# Deep Feature Flow\n# Copyright (c) 2017 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Yuwen Xiong\n# --------------------------------------------------------\n\n\"\"\"\nroidb\nbasic format [image_index]['boxes', 'gt... | [
[
"numpy.where"
]
] |
BenjaPrograma/proyecto-IA | [
"2cc1ff078cbfeb2c467758594bcb749211f0342b"
] | [
"tasks/R2R/eval.py"
] | [
"''' Evaluation of agent trajectories '''\r\n\r\nimport json\r\nfrom collections import defaultdict\r\nimport networkx as nx\r\nimport numpy as np\r\nimport pprint\r\npp = pprint.PrettyPrinter(indent=4)\r\n\r\nfrom utils import load_datasets, load_nav_graphs\r\n\r\n\r\nclass Evaluation(object):\r\n ''' Results s... | [
[
"numpy.average"
]
] |
mohui37/Ultra_light_OCR_No.20 | [
"8e6cf6bbe1311999ac5e1d2f32a09e2a18296c8b"
] | [
"work/PaddleOCR/tools/program.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 re... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.min"
]
] |
mpariente/pb_bss | [
"59aea812aaefe4fab115390066fb5d7dbf53db0e",
"59aea812aaefe4fab115390066fb5d7dbf53db0e"
] | [
"pb_bss_eval/extraction/mask_module.py",
"pb_bss_eval/distribution/complex_circular_symmetric_gaussian.py"
] | [
"\"\"\"\nAll provided masking functions expect the complex valued stft signal as input.\nEach masking function should not take care of further convenience functions\nthan allowing arbitrary sensor_axis and any number of independent dimensions.\n\nOnly, when a multichannel signal is used to pool the power along chan... | [
[
"numpy.split",
"numpy.asarray",
"numpy.squeeze",
"numpy.cumsum",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.moveaxis",
"numpy.reshape",
"numpy.arange",
"numpy.argmax",
"numpy.min",
"numpy.logical_or",
"numpy.logical_and",
"numpy.sum",
"numpy.abs",
... |
yosais/Computer-Simulation-Book | [
"87b2d83eded02f69cd7b8d839adfa554b25ae19d",
"87b2d83eded02f69cd7b8d839adfa554b25ae19d"
] | [
"ch05/welch.py",
"ch09/spectral_test.py"
] | [
"from simLib import out_var_cum_mm1\nfrom random import seed\nfrom matplotlib.pyplot import *\nimport numpy as np\n\nlamda = 1.3\nmu = 2\n\nn = 10000\t# Number of packets to be simulated\nR = 5\t\t# Number of replications (repetitions)\n\nY = np.zeros( shape = (R, n) )\t# Output variable Delay\n\n# 1. Generate sam... | [
[
"numpy.zeros"
],
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Moumeneb1/IRIT_INTERNSHIP | [
"6a443508e9a6e26e46354c2d8282e360afdc02e7"
] | [
"easy_nlp/models/losses.py"
] | [
"import torch.nn as nn\nimport torch\nimport numpy as np\n\n\nclass FocalLoss2(nn.Module):\n \"\"\"\n This is a implementation of Focal Loss with smooth label cross entropy supported which is proposed in\n 'Focal Loss for Dense Object Detection. (https://arxiv.org/abs/1708.02002)'\n Focal_Loss= -1*a... | [
[
"torch.nn.functional.softmax",
"torch.ones",
"torch.FloatTensor",
"torch.clamp",
"torch.pow"
]
] |
unibastts/Artifical-Neural-Network-Optimisation-Using-Evolutionary-Algorithms | [
"7237f8c4b423d5947d1f467fba6d1b83669dd0ee"
] | [
"Layer.py"
] | [
"# support/Layer.py\n\nimport numpy as np\nfrom support.AbstractLayer import Layers\n\nclass Layer(Layers): #weigth layer\n\n def __init__(self, inputSize, outputSize):\n self.weights = np.random.randn(inputSize, outputSize) * 0.1 # keep initial weights small\n self.bias = np.random.rand(1, outputS... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.random.normal",
"numpy.random.randn",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum"
]
] |
zzdxfei/3d_landmarks | [
"c4c55cb95563ca64a197effe4ddf69ac406c7e76"
] | [
"train.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\nimport keras\nimport keras.backend as K\nimport re\nimport cv2\nimport numpy as np\nnp.set_printoptions(threshold='nan')\n\n\ndef list_pictures(directory, ext='jpg|jpeg|bmp|png|ppm'):\n return [os.path.join(root... | [
[
"numpy.savez",
"numpy.set_printoptions",
"numpy.load",
"numpy.array",
"numpy.where"
]
] |
FelixFu520/DAO | [
"ac30bad4503408e771bc28c77dd8a20c18c15a05"
] | [
"core/modules/losses/CrossEntropyLoss.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom core.modules.register import Registers\n\n\n@Registers.losses.register\ndef CrossEntropyLoss(weight=None, ignore_index=255, reduction='mean'):\n weight = torch.from_numpy(np.array(weight)).float()\n CE = nn.CrossEntropyLoss(weight=weight... | [
[
"torch.nn.CrossEntropyLoss",
"numpy.array"
]
] |
akakream/dcTorch | [
"e1405984c2a64a47527a47f05fd2056bd2149281"
] | [
"data/bigearthoriginalPREP/pytorch_utils.py"
] | [
"import json\nimport csv\nimport os\nimport numpy as np\n\nfrom collections import defaultdict\n\n\n\n# original labels\nLABELS = [\n 'Continuous urban fabric',\n 'Discontinuous urban fabric',\n 'Industrial or commercial units',\n 'Road and rail networks and associated land',\n 'Port areas',\n 'Ai... | [
[
"numpy.asarray",
"numpy.squeeze",
"numpy.array",
"torch.utils.data.DataLoader"
]
] |
cimes-isi/RITSAR | [
"af16f175abe27c783f61c22888adf5d9eb61bc6c"
] | [
"examples/DSBP_demo.py"
] | [
"##############################################################################\n# #\n# This is a demonstration of the Digital Spotlight Backprojection algorithm.#\n# Data sets can be switched in and out by commenting/uncommenting the line... | [
[
"matplotlib.pylab.tight_layout",
"numpy.arange",
"matplotlib.pylab.title",
"matplotlib.pylab.subplot",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.xlabel"
]
] |
wanglamao/poke-auto-fuka | [
"afa66eca7da25d0c256eb013b2be0b3c5ab37cee"
] | [
"stm/volatile_class_run.py"
] | [
"import cv2\nimport numpy as np\nfrom time import sleep\nimport time\nimport show.drawing as drawing\n\n\nclass VolatileClassRun(object):\n width = int(1280 / 2)\n height = int(720 / 2)\n\n ALGOLISM = 'USURF' #'AKAZE', 'SURF', 'USURF', 'FAST'\n MIN_MATCH_COUNT = 0\n ratio = 0.0\n\n breeder_house_... | [
[
"numpy.int32",
"numpy.int8",
"numpy.mean",
"numpy.float32",
"numpy.sum"
]
] |
ncsurobotics/acoustics-sw7 | [
"89bda1eac46518e5ef5f8c059821df37fc2596c5"
] | [
"pythonTestCode/simulator.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport sys\nv_sound = 1530\nf_s = 10e6\nf_pinger = 42e3\n\n\nleft = np.array([-0.0095, 0, 0])\nright = np.array([0.0095,0, 0.])\nfront = np.array([0, -0.1, 0])\nback = np.array([0, -0.119, 0.0])\n\nhydrophones = [left, right, front, back]\n\npinger_locs = np.ar... | [
[
"numpy.linalg.solve",
"numpy.abs",
"numpy.arange",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.cos",
"numpy.sin",
"numpy.deg2rad",
"numpy.array",
"numpy.zeros"
]
] |
MaleNurse/DeepStack | [
"0315e48907c36c075da5aa558756786c0d76c1b8"
] | [
"intelligencelayer/shared/utils/activations.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n# Swish https://arxiv.org/pdf/1905.02244.pdf ---------------------------------------------------------------------------\nclass Swish(nn.Module): #\n @staticmethod\n def forward(x):\n return x * torch.sigmoid(x)\n\n\nclass Hard... | [
[
"torch.sigmoid",
"torch.nn.Conv2d",
"torch.nn.functional.hardtanh",
"torch.nn.BatchNorm2d",
"torch.nn.functional.softplus"
]
] |
ftramer/stanford-suns-nips17 | [
"07763eda056aeff07fe7132df4cd0281e22ee221"
] | [
"untargeted/tf_jpeg_utils.py"
] | [
"import itertools\r\nimport numpy as np\r\nimport PIL.Image\r\nimport tensorflow as tf\r\n\r\n# From https://gist.github.com/kylemcdonald/2f1b9a255993bf9b2629\r\ndef showarray(a, fmt='png'):\r\n import IPython.display\r\n from cStringIO import StringIO\r\n a = np.uint8(a)\r\n f = StringIO()\r\n PIL.I... | [
[
"numpy.sqrt",
"tensorflow.stack",
"tensorflow.pad",
"numpy.uint8",
"tensorflow.squeeze",
"tensorflow.tensordot",
"numpy.outer",
"numpy.zeros",
"tensorflow.tile",
"tensorflow.nn.avg_pool",
"tensorflow.split",
"tensorflow.round",
"numpy.array",
"tensorflow.red... |
leejaymin/QDroid | [
"13ff9d26932378513a7c9f0038eb59b922ed06eb"
] | [
"TestSourceCode_Store/histogram.py"
] | [
"'''\nCreated on 2013. 5. 10.\n\n@author: root\n'''\nfrom PIL import Image\nimport numpy\n\ndef smoothListGaussian(list,degree=5):\n window=degree*2-1\n weight=numpy.array([1.0]*window)\n weightGauss=[]\n\n for i in range(window):\n i=i-degree+1\n frac=i/float(window)\n gauss=1/(numpy.exp((4*(frac))**2... | [
[
"numpy.exp",
"numpy.array"
]
] |
stjordanis/trax | [
"517dc78174ff87c0b753b97247afc1408f8822fc"
] | [
"trax/supervised/decoding_timing_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"numpy.arange",
"tensorflow.compat.v2.test.main"
]
] |
saridut/BROWNPAK | [
"8a3aef5f393826e8b5d8c374a190e6e6e1140221"
] | [
"utils/models/create-chn-ub.py"
] | [
"#!/usr/bin/env python\n\n'''\nCreates initial configuration for a system containing single unbranched linear\nchain in an unbounded domain.\n\n'''\nimport sys\nimport math\nimport numpy as np\nfrom configuration import Configuration\nfrom config_io import *\n\n#-----------------------------------------------------... | [
[
"numpy.array"
]
] |
tejasrivastav/productionze-datascience | [
"14cbcc826a46f26ad0b1908415c4d09641fccad3"
] | [
"app/notebook/model_generation.py"
] | [
"\n# coding: utf-8\n\n# In[16]:\n\n\n# Load libraries\nimport pandas\nfrom pandas.plotting import scatter_matrix\nimport matplotlib.pyplot as plt\nfrom sklearn import model_selection\nfrom sklearn.metrics import classification_report\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.metrics import accurac... | [
[
"pandas.read_csv",
"sklearn.model_selection.cross_val_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.naive_bayes.GaussianNB",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.KFold",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.metrics.confusi... |
reshalfahsi/myqlanet | [
"f0eeadd2e6c4760aaf769c469f39f0d73f5044ee"
] | [
"myqlanet/utils/tensor_util.py"
] | [
"import torch\nimport torchvision.transforms as transforms\n\nclass ToTensor(object):\n \"\"\"Convert ndarrays in sample to Tensors.\"\"\"\n def __call__(self, sample):\n image, bbox = sample['image'], sample['bbox']\n # swap color axis because\n # numpy image: H x W x C\n # torch ... | [
[
"torch.from_numpy"
]
] |
anonymspeechbrain/speechbrain | [
"9a0632ddb066f5bceffb71fb971552fb542f7b7e",
"9a0632ddb066f5bceffb71fb971552fb542f7b7e"
] | [
"recipes/UrbanSound8k/SoundClassification/confusion_matrix_fig.py",
"recipes/CommonVoice/ASR/seq2seq/train.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Helper to create Confusion Matrix figure\n\nAuthors\n * Anonymous\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport itertools\n\n\ndef create_cm_fig(cm, display_labels):\n\n fig = plt.figure(figsize=cm.shape, dpi=50, facecolor=\"w\", edgecolor=\"k\")\n ax = ... | [
[
"numpy.arange",
"matplotlib.pyplot.figure"
],
[
"torch.mean",
"torch.LongTensor",
"torch.no_grad"
]
] |
getyourguide/image-quality-assessment | [
"6e61ca2d2627e5c16a648db4097519936d86b604"
] | [
"data/TID2013/get_labels.py"
] | [
"\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom image_quality_assessment.utils.utils import save_json\nfrom maxentropy.skmaxent import MinDivergenceModel\n\n\n# the maximised distribution must satisfy the mean for each sample\ndef get_features():\n def f0(x):\n return x\n\n return [f0... | [
[
"numpy.arange",
"numpy.array",
"pandas.read_csv"
]
] |
vincekurtz/valkyrie_drake | [
"253cf809db7b00f24a901ac1e4ee8aed0df1d6b2",
"253cf809db7b00f24a901ac1e4ee8aed0df1d6b2"
] | [
"controllers/pd_controller.py",
"utils/approximate_simulation_mpc_test.py"
] | [
"##\n#\n# Example whole-body controllers for the Valkyrie robot.\n#\n##\n\nimport time\nimport numpy as np\nfrom pydrake.all import *\nfrom utils.helpers import *\nfrom utils.walking_pattern_generator import *\n\nclass ValkyriePDController(VectorSystem):\n \"\"\"\n A simple PD controller that regulates the ro... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.hstack"
],
[
"matplotlib.pyplot.legend",
"numpy.dot",
"numpy.sqrt",
"numpy.asarray",
"matplotlib.pyplot.figure",
"numpy.eye",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.sh... |
sn95033/Project-2-Research-Notebook | [
"e9d6ad453479be152af948bd4736200dbdd04325"
] | [
"Web_Page/app.py"
] | [
"import os\n\nimport pandas as pd\nimport numpy as np\n\nfrom flask import Flask, jsonify, render_template, make_response\nfrom json import dumps\n\napp = Flask(__name__)\n\n#################################################\n# Database Setup\n#################################################\n\narticles = pd.read_c... | [
[
"pandas.read_csv"
]
] |
etseidl/cudf | [
"84073e8c3c9477c8afa974f14058f1208f63aba2"
] | [
"python/cudf/cudf/_fuzz_testing/utils.py"
] | [
"# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n\nimport random\nfrom collections import OrderedDict\n\nimport fastavro\nimport numpy as np\nimport pandas as pd\nimport pyorc\n\nimport cudf\nfrom cudf.testing._utils import assert_eq\nfrom cudf.utils.dtypes import (\n pandas_dtypes_to_np_dtypes,\n pyarrow_dty... | [
[
"pandas.api.types.is_datetime64_dtype",
"pandas.Series",
"pandas.Int32Dtype",
"pandas.Int16Dtype",
"pandas.StringDtype",
"pandas.DataFrame",
"pandas.Int8Dtype",
"pandas.BooleanDtype",
"numpy.iinfo",
"pandas.Int64Dtype",
"pandas.api.types.is_timedelta64_dtype",
"nump... |
xunzi/nagiosplugin | [
"050651a39c3ad986367bf93d817fa62a47c15de2"
] | [
"nagiosplugin/examples/check_haproxy_log.py"
] | [
"#!python\n\"\"\"haproxy log check for request time and error rate.\n\nThis check shows an advanced programming technique: we allow the user to\ndefine the thresholds dynamically. You can specify a list of conditions\nlike:\n\n* the N1th percentile of t_tot must match range R1\n* the N2th percentile of t_tot must m... | [
[
"numpy.sum"
]
] |
esgario/mlp-mixer-keras | [
"b3c66744470c53e0f851f24eb52bc327f09c208d"
] | [
"mlp_mixer_keras/test_core.py"
] | [
"import pytest\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nfrom .core import mlp_mixer\n\n\n@pytest.fixture\ndef image_batch():\n np.random.seed = 1\n return np.random.random((3, 224, 224, 3))\n\n\n@pytest.mark.parametrize(\n \"spec_code, n_parameters\",\n [(\"S32... | [
[
"tensorflow.device",
"numpy.random.random",
"tensorflow.keras.backend.count_params"
]
] |
OmarEltouny78/SoccermaticsForPython | [
"4f645f6774a9a435a4f559f48287a33580fc067e"
] | [
"8PassCompare.py"
] | [
"#Understand the relationship between number of passes and shots\n#Compare teams in where they create chance from\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom pandas.io.json import json_normalize\nfrom FCPython import createPitch\nimport json\n\n#Function for finding passes before shot\nshot_windo... | [
[
"matplotlib.pyplot.gca",
"numpy.logical_not",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.xlim",
"pandas.io.json.json_normalize",
"matplotlib.pyplot.show",
"numpy.histogram2d"
]
] |
DancingChild/Mask_RCNN-master | [
"7c920645c5ba5d668f527e88b50e3987d5555e3f"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implemenetation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDic... | [
[
"numpy.amax",
"numpy.expand_dims",
"tensorflow.concat",
"tensorflow.control_dependencies",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.minimum",
"tensorflow.cast",
"tensorflow.image.non_max_suppression",
"tensorflow.equal",
"tensorflow.image.crop_and_resize... |
popgenmethods/pyrho | [
"89ae3b30cd3961107e2eec1410a9ef645c8b949f"
] | [
"pyrho/haplotype_reader.py"
] | [
"\"\"\"\nA collection of methods for reading and processing data.\n\nFunctions:\n parse_vcf_to_genos: Uses cyvcf2 to parse VCF format data into genotypes.\n parse_seqs_to_genos: Parses fasta format or LDHat sites and locs data.\n genos_to_configs: Converts genotypes into an array of two-locus configs.\n\"\... | [
[
"numpy.minimum",
"numpy.arange",
"scipy.sparse.csr_matrix",
"numpy.ones",
"numpy.diff",
"numpy.any",
"numpy.array",
"numpy.zeros"
]
] |
brunograssano/Analisis_Numerico_fiuba | [
"104949391c931c7a1ca6d4d12221756ed34083d7"
] | [
"TP2/PruebaRK4Euler.py"
] | [
"from calculadoraDeHistorias import HistoriasEuler\nfrom calculadoraDeHistorias import HistoriasRK4\nimport Graficador\nimport numpy as np\n\nnp.set_printoptions(formatter={'float_kind':\"{:.3e}\".format})\n\ndef imprimirHistorias(HistoriaThetaRK1, HistoriaThetaRK4, HistoriaURK1, HistoriaURK4):\n print(\"PRIMERO... | [
[
"numpy.set_printoptions",
"numpy.math.radians"
]
] |
shiyussy/graspy | [
"7e9ab41c782899f21e573604db0fac843b575186"
] | [
"graspy/plot/plot.py"
] | [
"# Copyright 2019 NeuroData (http://neurodata.io)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"sklearn.utils.check_consistent_length",
"numpy.cumsum",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.where",
"matplotlib.pyplot.gca",
"numpy.hstack",
"numpy.ones_like",
"numpy.unique",
"numpy.count_nonzero",
... |
Saurav-D/tensorboardX | [
"34d1616c035faaa0f3f7c9d19cb8bb4425f19939"
] | [
"examples/demo.py"
] | [
"import torch\nimport torchvision.utils as vutils\nimport numpy as np\nimport torchvision.models as models\nfrom torchvision import datasets\nfrom tensorboardX import SummaryWriter\nimport datetime\n\ntry:\n import soundfile\n skip_audio = False\nexcept ImportError:\n skip_audio = True\n\nresnet18 = models... | [
[
"torch.ones",
"torch.Tensor",
"torch.zeros",
"numpy.arctan",
"torch.cat",
"numpy.cos",
"numpy.sin",
"torch.rand",
"numpy.random.rand",
"numpy.random.randint"
]
] |
Kitware/trailblazer | [
"f5576eaf150162ba3642f764fedb0ad1f2f54428",
"f5576eaf150162ba3642f764fedb0ad1f2f54428",
"f5576eaf150162ba3642f764fedb0ad1f2f54428"
] | [
"src/python/trailblazer/traffic/road_mapping.py",
"src/python/trailblazer/utils/coordinate_converter.py",
"src/python/trailblazer/feature/io.py"
] | [
"# Distributed under the Apache License, Version 2.0.\n# See accompanying NOTICE file for details.\n\nfrom itertools import chain\nimport os\nimport pathlib\nimport csv\n\nimport numpy as np\nfrom leuvenmapmatching.matcher.distance import DistanceMatcher\nfrom leuvenmapmatching.map.inmem import InMemMap\nfrom scipy... | [
[
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.plot",
"numpy.ceil",
"matplotlib.pyplot.ylabel",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.close",
"numpy.diff",
"matplotlib.pyplot.xlabel",
... |
mdwarfgeek/tres-tools | [
"0febc6ea6d3494e8518d2adeaa835d3c5cdf6f4a"
] | [
"eqwidth.py"
] | [
"import math\nimport numpy\n\n# Should really do this using the original polynomial wavelength solution,\n# where available.\n\ndef subpixel(wave):\n # Wavelength interval of each pixel in spectrum.\n # delta_x = x_i+1 - x_i-1\n # do by shifting input array.\n # Extend to ends (where we have no information).\n ... | [
[
"numpy.sqrt",
"numpy.empty_like",
"numpy.median",
"numpy.logical_and",
"numpy.where",
"numpy.sum"
]
] |
catchchaos/EDVR | [
"08372e821cffa579e381cc58654285c0c08e2195"
] | [
"basicsr/models/video_base_model.py"
] | [
"import importlib\nimport torch\nfrom collections import Counter\nfrom copy import deepcopy\nimport os\nfrom os import path as osp\nfrom torch import distributed as dist\nfrom tqdm import tqdm\nimport subprocess as sp\nfrom PIL import Image\n\nfrom basicsr.models.sr_model import SRModel\nfrom basicsr.utils import g... | [
[
"torch.mean",
"torch.distributed.reduce",
"torch.cuda.empty_cache",
"torch.distributed.barrier"
]
] |
iSriBalaji/MachineLearning | [
"6c1c5ac954485a0a385a9409cdbf00f7692cd4a1"
] | [
"Titanic_Kaggle/Titanic_Project.py"
] | [
"import pandas as pd\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.model_selection import train_test_split\n\n#reading the data...Creating a Dataframe\ntit_data=pd.read_csv(r\"C:\\Users\\Sri Balaji\\Desktop\\Sri Tut\\Machine Learning\\Titanic_Kagg... | [
[
"sklearn.ensemble.RandomForestRegressor",
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
cps11/catvrnn | [
"de4cd963769f7d82115272dfcb859792f5789d01"
] | [
"generate.py"
] | [
"import torch\nfrom catvrnn import CatVRNN\nimport dataset\nimport os\nimport argparse\n\ndef breakmodelname(modelpath):\n name = os.path.split(modelpath)[-1]\n name = os.path.splitext(name)[0]\n corpus, mode, tag, w, ts = name.split('_')\n if w != 'True':\n w = float(w)\n else:\n w = F... | [
[
"torch.full",
"torch.cuda.is_available",
"torch.load"
]
] |
LucasG0/koalas | [
"c973195600f2b28b4dfb92aa3e114d1c6e8528ab",
"c973195600f2b28b4dfb92aa3e114d1c6e8528ab"
] | [
"databricks/conftest.py",
"databricks/koalas/accessors.py"
] | [
"#\n# Copyright (C) 2019 Databricks, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la... | [
[
"matplotlib.pyplot.close"
],
[
"pandas.concat"
]
] |
zhaqu/ncnn | [
"e4c821a468e0664f0383b4a5b325275266143ee2"
] | [
"tools/pnnx/tests/ncnn/test_nn_SiLU.py"
] | [
"# Tencent is pleased to support the open source community by making ncnn available.\n#\n# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n# in compliance with the License. You may obtain a... | [
[
"torch.jit.trace",
"torch.manual_seed",
"torch.rand",
"torch.allclose",
"torch.nn.SiLU"
]
] |
mwcraig/ccdproc | [
"f67212e60538571aea58ab1cc0b0e169d28cb318",
"f67212e60538571aea58ab1cc0b0e169d28cb318"
] | [
"ccdproc/image_collection.py",
"ccdproc/tests/test_combiner.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom collections import OrderedDict\nimport fnmatch\nfrom os import listdir, path\nimport re\n\nimport logging\n\nimport numpy as np\nimport numpy.ma as ma\n\nfrom astropy.table import Table, MaskedColumn\nimport astropy.io.fits as fits\nfrom astro... | [
[
"numpy.logical_not",
"numpy.zeros",
"numpy.ones"
],
[
"numpy.sqrt",
"numpy.median",
"numpy.ones",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_almost_equal",
"numpy.std",
"numpy.ma.average",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.... |
GarrettGarrett/tensorflow | [
"1778ee1f5421126438dca9edb5c540d6f27aa51b"
] | [
"tensorflow/python/data/ops/dataset_ops.py"
] | [
"# Copyright 2017 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.data.util.nest.map_structure_up_to",
"tensorflow.python.ops.gen_dataset_ops.window_dataset",
"tensorflow.python.data.util.structure.type_spec_from_value",
"tensorflow.python.ops.gen_dataset_ops.batch_dataset_v2",
"tensorflow.python.ops.gen_dataset_ops.dataset_cardinality",
... |
bgalvao/models | [
"befbe0f9fe02d6bc1efb1c462689d069dae23af1"
] | [
"official/nlp/xlnet/run_squad.py"
] | [
"# Copyright 2019 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.io.gfile.GFile",
"tensorflow.version.VERSION.startswith",
"tensorflow.distribute.experimental.TPUStrategy",
"tensorflow.summary.scalar",
"tensorflow.distribute.MirroredStrategy"
]
] |
george1459/ICSE2022_158 | [
"f8bb797fc003f11485d3552f81cc7b8ba8a22b9b"
] | [
"testing_tool/my_tool/reverse_API/vision.py"
] | [
"import os\nimport shutil\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom icrawler.builtin import GoogleImageCrawler, BaiduImageCrawler, BingImageCrawler \nimport csv\nfrom time import gmtime, strftime\nimport urllib.request\n\nfrom numpy.lib.type_check import imag\n\n\n# folder locations\nTM... | [
[
"numpy.asarray",
"numpy.repeat",
"numpy.zeros"
]
] |
taichofu/tetris_v2 | [
"283b96660f87ef04c040852a636e8d7ea0aeeb75"
] | [
"game_manager/board_manager.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np_randomShape\nimport numpy as np_randomObstacle\nimport numpy as np_randomObstaclePiece\n\n# Shape manager\nclass Shape(object):\n shapeNone = 0\n shapeI = 1\n shapeL = 2\n shapeJ = 3\n shapeT = 4\n shapeO = 5\n shapeS = 6\n s... | [
[
"numpy.random.seed",
"numpy.random.randint"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.