repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
PABannier/sparseglm | [
"ec1c6a15786d9fc0cc58ae3d7e28227bbc9077e9"
] | [
"python/sparseglm/benchmarks/lasso.py"
] | [
"import time\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom sklearn.linear_model import Lasso as Lasso_sk\nfrom sparseglm.estimators import Lasso\n\nfrom sparseglm.utils import make_correlated_data, compute_alpha_max\n\nn_samples = 300\nn_features = 1000\n\nsnr = 2\ncorr = 0.6\ndensity = 0.5\n\ntol = 1e-9... | [
[
"numpy.random.binomial",
"numpy.testing.assert_allclose",
"sklearn.linear_model.Lasso"
]
] |
The-SocialLion/Smart-Attendance-System | [
"92d846027bbf367ee6b6ba99a4eb83e74bdc15c7"
] | [
"4_recognizingPerson.py"
] | [
"import numpy as np\nimport imutils\nimport pickle\nimport time\nimport cv2\n\nembeddingModel = \"openface_nn4.small2.v1.t7\"\n\nembeddingFile = \"output/embeddings.pickle\"\nrecognizerFile = \"output/recognizer.pickle\"\nlabelEncFile = \"output/le.pickle\"\nconf = 0.5\n\nprint(\"Loading face detector...\")\nprotot... | [
[
"numpy.array",
"numpy.argmax"
]
] |
ArgonneCPAC/skysim | [
"5bc2abebd7123f29b424efc11c3ef374a51cd6c1"
] | [
"lightcone_resample/test_v4.py"
] | [
"#!/usr/bin/env python2.7\n\nfrom __future__ import print_function, division\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as clr\nimport dtk \nimport h5py\nimport sys\nimport time\n\n\nif __name__ == \"__main__\":\n param = dtk.Param(sys.argv[1])\n output_fname = param.ge... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"numpy.max",
"numpy.histogram",
"numpy.size",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.logspace",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.ylabel",
"numpy.histogram... |
camposouza/NMR | [
"a55ebf738799b4c1cc14dcd1ebebae3ed57a8d58"
] | [
"NMR_Pulse_Sequences/PulsoSimples.py"
] | [
"import numpy as np\nfrom numpy import pi, sin, cos\nimport matplotlib.pyplot as plt\n\nT1 = 600\nT2 = 400\nFo = 10\ndf = np.arange(-10, 50, 0.1)\n\ntheta = pi/2.0\nT = 2000\ndT = 1\n\nT2inom = 200\nT22 = 1/((1/T2) + (1/T2inom))\n\nRtheta = np.matrix([[1, 0, 0], [0, cos(theta), sin(theta)], [0, -sin(theta), cos(the... | [
[
"numpy.matrix",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"numpy.exp",
"numpy.zeros",
"matplotlib.pyplot.show"
]
] |
zomglings/MONAI | [
"ba127a2077b1a5d8aed01bc98a6f9550cc191c2b"
] | [
"monai/transforms/spatial/array.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"numpy.pad",
"numpy.allclose",
"numpy.meshgrid",
"numpy.asarray",
"numpy.linalg.inv",
"numpy.eye",
"numpy.ascontiguousarray",
"torch.tensor",
"numpy.append",
"numpy.any",
"numpy.array",
"torch.as_tensor"
]
] |
JoeyLI17/2019_11_30_AV_System_Integration_ROS | [
"32ea70758d1082660dd5be09098bcf7a23f1338e"
] | [
"ros/src/waypoint_updater/waypoint_updater.py"
] | [
"#!/usr/bin/env python\n\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\nfrom std_msgs.msg import Int32\nfrom scipy import spatial\nimport numpy as np\nimport math\n\n'''\nThis node will publish waypoints from the car's current position to some `x` distance ahead.... | [
[
"numpy.dot",
"numpy.array",
"scipy.spatial.KDTree"
]
] |
dema-software-solutions/paz-1 | [
"e75ab1ba5b0980ee76ae6bd95545497665d69304"
] | [
"paz/processors/keypoints.py"
] | [
"from warnings import warn\n\nimport numpy as np\n\nfrom ..abstract import Processor\nfrom ..backend.keypoints import translate_keypoints\nfrom ..backend.keypoints import arguments_to_image_points2D\nfrom ..backend.keypoints import normalize_keypoints2D\nfrom ..backend.keypoints import denormalize_keypoints2D\nfrom... | [
[
"numpy.asarray",
"numpy.squeeze",
"numpy.expand_dims",
"numpy.matmul"
]
] |
anukaal/rlax | [
"caf976f6a808792e604de348187cda15b091085b"
] | [
"rlax/_src/base.py"
] | [
"# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle... | [
[
"numpy.all",
"numpy.array",
"numpy.ones"
]
] |
songmeixu/snowfall | [
"1f79957e9716c3f980c151df5b1d77bc4bb7ce78"
] | [
"egs/gigaspeech/asr/simple_v1/ctc_decode.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) 2020 Xiaomi Corporation (authors: Daniel Povey, Haowen Qiu)\n# Copyright (c) 2020-2021 Johns Hopkins University (author: Piotr Żelasko)\n# Apache 2.0\n\nimport logging\nimport os\nfrom pathlib import Path\nfrom typing import Union\n\nimport k2\nimport torch\nfrom k2 im... | [
[
"torch.set_num_interop_threads",
"torch.load",
"torch.utils.data.DataLoader",
"torch.floor_divide",
"torch.set_num_threads",
"torch.no_grad",
"torch.device",
"torch.argsort"
]
] |
irap-omp/deconv3d | [
"0ab5322f99e28a19ce5540d9a27dcbe340542d0a"
] | [
"tests/run_test.py"
] | [
"\n# GENERAL PACKAGES ############################################################\nfrom os import pardir, remove\nfrom os.path import abspath, dirname, join, isfile\nimport numpy as np\nimport unittest\nfrom hyperspectral import HyperspectralCube as Cube\n\n# LOCAL PACKAGES ########################################... | [
[
"numpy.resize",
"numpy.save",
"numpy.random.rand",
"numpy.array",
"numpy.testing.assert_array_almost_equal"
]
] |
aayars/py-noisemaker | [
"4e27f536632ade583eb0110aaaa9e19c59355ba6"
] | [
"noisemaker/value.py"
] | [
"\"\"\"Low-level value noise functions\"\"\"\n\nfrom collections import defaultdict\n\nimport math\nimport random\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom noisemaker.constants import (\n DistanceMetric,\n InterpolationType,\n PointDistribution,\n ValueDistribution,\n ValueMask,\n Vor... | [
[
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.random.set_seed",
"tensorflow.cumsum",
"tensorflow.floor",
"tensorflow.nn.top_k",
"tensorflow.gather",
"tensorflow.square",
"numpy.repeat",... |
radiasoft/rssympic | [
"14b119267686c64e2d0fcd3be19c365b8d486e22"
] | [
"rssympim/examples/rz_profile.py"
] | [
"# # A simple test of SymPIM-rz which can be used for profiling the Python bottlenecks\n# \n# September 26, 2017\n# Nathan Cook\n\nimport numpy as np\n\nfrom rssympim.sympim_rz.data import particle_data, field_data\nfrom rssympim.sympim_rz.integrators import integrator\nfrom rssympim.constants import constants\n\n#... | [
[
"numpy.amax",
"numpy.sqrt",
"numpy.linspace",
"numpy.asarray",
"numpy.arange",
"numpy.ones",
"numpy.round",
"numpy.zeros"
]
] |
ptrendx/tvm | [
"f07fe80aaf110086b651f2850506c803a5688ddb"
] | [
"tests/python/unittest/test_codegen_c_host.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.random.uniform",
"numpy.zeros",
"numpy.random.randint"
]
] |
twang5/mne-python | [
"a885741c16abc21b5fccba85a3650a03f87e5e8f"
] | [
"mne/gui/tests/test_ieeg_locate_gui.py"
] | [
"# Authors: Alex Rockhill <aprockhill@mailbox.org>\n#\n# License: BSD-3-clause\n\nimport os.path as op\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nimport pytest\n\nimport mne\nfrom mne.datasets import testing\nfrom mne.utils import requires_nibabel, requires_version\nfrom mne.viz.utils import ... | [
[
"numpy.random.random",
"numpy.random.seed",
"numpy.isnan",
"numpy.eye",
"numpy.round",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.zeros"
]
] |
YFCodeDream/novelvqa | [
"63a6bdd91282d09685d98a7cdf3cc80b3783e048"
] | [
"core/model/losses.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom math import sqrt\nimport numpy as np\n\n\nclass ContrastProjection(nn.Module):\n def __init__(self, __C):\n super().__init__()\n self.linear1 = nn.Linear(__C.HIDDEN_SIZE, __C.HIDDEN_SIZE)\n self.linear2 = nn.Linear(... | [
[
"torch.nn.functional.normalize",
"torch.div",
"torch.nn.functional.softmax",
"torch.mean",
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.zeros",
"torch.cat",
"torch.nn.Linear"
]
] |
AadilLatif/HELICS-Examples | [
"2aa7e9e280b6cb96ee70e79802a68905e5002253"
] | [
"user_guide_examples/fundamental/fundamental_message_comm/endpoints/Battery.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 9/28/2020\n\nThis is a simple battery message federate that models an EV\nbattery as it is being charged. The federate receives a voltage signal\nrepresenting the voltage applied to the charging terminals of the battery\nand based on its internally modeled SOC, calculate... | [
[
"numpy.random.seed",
"numpy.random.choice",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.random.randint",
"numpy.interp",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
ChristophorusX/Burer-Monteiro | [
"c69b72c3ad5eab901a6df4da6ebf48d4c6ee8e3b"
] | [
"trigonometric.py"
] | [
"import numpy as np\nimport burer_monteiro as bm\nimport basin_of_attraction as basin\nimport aux\nfrom scipy import optimize as opt\n\n\ndef trig_objective_function(A, theta):\n \"\"\"\n Returns the function value in trigonometric parameterization.\n \"\"\"\n\n # dim, _ = A.shape\n # T = np.empty((d... | [
[
"numpy.cos",
"numpy.tile",
"numpy.ones",
"numpy.sin",
"numpy.random.uniform",
"numpy.empty"
]
] |
tehZevo/pget | [
"f3b5ff85221d15911548f7d18d45b1bec9c68ddb"
] | [
"pget/agent.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nfrom ml_utils.keras import get_states, set_states, apply_regularization\nfrom ml_utils.model_builders import dense_stack\n\nfrom .pget import create_traces, update_traces, step_weights_opt\nfrom .pget import explore_continuous, explore_discrete, explore_multibinary\n\... | [
[
"tensorflow.keras.optimizers.Adam",
"numpy.expand_dims",
"numpy.abs",
"numpy.clip"
]
] |
yuhengwang1/kalm-fl | [
"c713014d85e71bf728f6687a1b41c47ebd626263"
] | [
"kalmfl/multistanza/models/common/char_model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence\n\nfrom kalmfl.multistanza.models.common.packed_lstm import PackedLSTM\nfrom kalmfl.multistanza.models.common.utils import tensor_unsort, unsort\nfrom kalmfl.multistanza.mode... | [
[
"torch.nn.Dropout",
"torch.load",
"torch.zeros",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Linear",
"torch.nn.utils.rnn.PackedSequence",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.no_grad",
"torch.nn.utils.rnn.pack_sequence",
"torch.save"
]
] |
jacobchanyeol/style-transfer_v1.0 | [
"d272cb2aa0f67a8db4f8efe01808d1e480c9d075"
] | [
"transformer_net.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Dec 4 02:03:13 2019\r\n\r\n@author: jacobchoi\r\n\"\"\"\r\n\r\nimport torch\r\n\r\n\r\nclass TransformerNet(torch.nn.Module):\r\n def __init__(self):\r\n super(TransformerNet, self).__init__()\r\n # Initial convolution layers\r\n self.con... | [
[
"torch.nn.ReflectionPad2d",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"torch.nn.functional.interpolate",
"torch.nn.ReLU"
]
] |
marko4789/Visualizacion-Covid19-MX | [
"9194a2590c35a12ddd66f1914c93f1ff869620b0"
] | [
"Visualizacion_comparativo_nuevos.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndataset_casos = pd.read_csv(\"Datos/comparativo_casos_nuevos.csv\")\ndataset_muertes = pd.read_csv(\"Datos/comparativo_muertes_nuevas.csv\")\n\ndias = np.arange(585)\ncasos = dataset_casos.iloc[:, 1]\ncasos_prom = dataset_casos.iloc[:, 3]\... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.scatter",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
cuhksz-nlp/SANER | [
"dffc7a06cdbff2671a3ca73d2398159d91a4a7db"
] | [
"fastNLP/io/pipe/summarization.py"
] | [
"\"\"\"undocumented\"\"\"\nimport os\nimport numpy as np\n\nfrom .pipe import Pipe\nfrom .utils import _drop_empty_instance\nfrom ..loader.summarization import ExtCNNDMLoader\nfrom ..data_bundle import DataBundle\nfrom ...core.const import Const\nfrom ...core.vocabulary import Vocabulary\nfrom ...core._logger impor... | [
[
"numpy.array",
"numpy.zeros"
]
] |
alvaro-serra/malib | [
"fe2b0736974c2a3ed9e41121b6cf475a3ee0b5a0"
] | [
"tests/fixtures/fixtures.py"
] | [
"import gc\nimport unittest\n\nimport tensorflow as tf\n\n# from malib.experiment import deterministic\nfrom malib.logger import logger\nfrom tests.fixtures.logger import NullOutput\n\n\nclass TfTestCase(unittest.TestCase):\n def setUp(self):\n self.sess = tf.Session()\n self.sess.__enter__()\n\n ... | [
[
"tensorflow.get_default_session",
"tensorflow.Graph",
"tensorflow.Session"
]
] |
minkj1992/Korean_emotion_classification_attention | [
"7e09cd8cd9b18c438d7b9032efb8ee37c505a7fa"
] | [
"ex1_w2v/predict.py"
] | [
"# 0. 사용할 패키지 불러오기\nfrom keras.utils import np_utils\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation\nimport numpy as np\nimport keras\nfrom keras.models import model_from_json\nfrom konlpy.tag import Okt as Twitter\nimport re\nimport json\n\n\n# to... | [
[
"numpy.asarray",
"numpy.fromfile"
]
] |
Leevisir/TimeseriesForecastingQA | [
"df6402fdc499d28195e88177c2c866787cf1f019"
] | [
"QUANTAXIS/TSFetch/fetchdata.py"
] | [
"import QUANTAXIS as QA\nimport pandas as pd\nimport json\nimport datetime\nfrom QUANTAXIS.QAUtil import QASETTING\nfrom QUANTAXIS.TSData.TSRawdata import TSRawdata\n\n\ndef TS_fetch_stock_day_adv(code, start, end):\n #get all history data from tdx\n # date = datetime.date.today()\n # data=QA.QAFetch.QATdx... | [
[
"pandas.to_datetime"
]
] |
campagnola/acq4 | [
"c77636a76d68ffa1bc7dbd41edc522e523b909b8",
"c77636a76d68ffa1bc7dbd41edc522e523b909b8"
] | [
"acq4/util/generator/SeqParamSet.py",
"acq4/util/igorpro.py"
] | [
"from __future__ import print_function\nimport pyqtgraph.units as units\nfrom pyqtgraph.parametertree.parameterTypes import SimpleParameter, GroupParameter\nimport pyqtgraph as pg\nimport numpy as np\nimport acq4.util.functions as fn\nimport sys, collections\n\n\nclass SequenceParamSet(GroupParameter):\n ## top-... | [
[
"numpy.random.shuffle",
"numpy.linspace"
],
[
"numpy.arange",
"numpy.array"
]
] |
zhuxinqimac/disentanglement_lib | [
"6620090e90ce935758cb607c01764ee404749e87"
] | [
"disentanglement_lib/data/ground_truth/shapes3d.py"
] | [
"# coding=utf-8\n# Copyright 2018 The DisentanglementLib 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/LICE... | [
[
"numpy.dot",
"numpy.cumprod",
"numpy.prod"
]
] |
lavanaythakral/Aspect-Based-Sentiment-Analysis | [
"1e2d57277b33778309131e69b69ead7afbd0dd59"
] | [
"test_file.py"
] | [
"import aspect_based_sentiment_analysis as absa\nimport pandas as pd\nimport time\nimport re \nimport csv\nimport logging\nimport os\n\ndef find_sentence(word,test_sentences):\n\tprint(\"Finding sentences\")\n\tsentence =[]\n\tfor sen in test_sentences:\n\t\tif(word in sen.lower()):\n\t\t\tsentence.append(sen.lower... | [
[
"pandas.read_csv"
]
] |
thortom/models | [
"57e263422b51032b424efd50e0501001052ea083"
] | [
"official/vision/beta/ops/mask_ops.py"
] | [
"# Copyright 2020 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... | [
[
"numpy.dot",
"numpy.maximum",
"numpy.array",
"numpy.zeros"
]
] |
yvonwin/lanenet-lane-detection-pytorch | [
"b1a14c3123e988069034eaa783a2dbc6bc509065"
] | [
"model/lanenet/loss.py"
] | [
"# coding: utf-8\n\"\"\"\nThis is the implementation of following paper:\nhttps://arxiv.org/pdf/1802.05591.pdf\n\"\"\"\nfrom torch.nn.modules.loss import _Loss\n# from torch.autograd import Variable\nimport torch\nimport torch.nn as nn\nfrom torch.functional import F\n\nDEVICE = torch.device('cuda:0' if torch.cuda.... | [
[
"torch.mean",
"torch.norm",
"torch.functional.F.softmax",
"torch.functional.F.relu",
"torch.sum",
"torch.zeros_like",
"torch.eye",
"torch.tensor",
"torch.unique",
"torch.log",
"torch.cuda.is_available",
"torch.stack"
]
] |
cjsyzwsh/South_Australia_Transport_Econ | [
"8c27f3015193113f8f479e7c0e0c3ff1ac42944e"
] | [
"src/d02_intermediate/preprocess_1_socioecon.py"
] | [
"# preprocessing the socioeconomic variables\n# inputs: five raw socio-demographcics data.\n# outputs: one combined socio-econ geopandas data frame.\n\n# import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport geopandas as gpd\n\n# system path\nimport sys\nimport os\n\n# util path\nutility_... | [
[
"pandas.read_csv"
]
] |
lingluodlut/BioCreativeVII_DrugProt | [
"b3ee015286d0168ccc30e62bdfaca5a341164401"
] | [
"src/represent_sl.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 30 19:54:17 2021\n\n@author: luol2\n\"\"\"\n\n\n\nimport os, sys\nimport numpy as np\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom transformers import AutoTokenizer\n \n\nclass Hugface_RepresentationLayer(object):\n \n \... | [
[
"numpy.expand_dims",
"tensorflow.keras.preprocessing.sequence.pad_sequences"
]
] |
juniors90/Flask-Plots | [
"1ab233217dc37b1cd2ea727af5d3a7433184863c"
] | [
"tests/tests_plots/test_render_img.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of the\n# Flask-Plots Project\n# https://github.com/juniors90/Flask-Plots/\n# Copyright (c) 2021, Ferreira Juan David\n# License: MIT\n# Full Text:\n# https://github.com/juniors90/Flask-Plots/blob/master/LICENSE\n\n# =... | [
[
"matplotlib.figure.Figure"
]
] |
plazmer/stm32f0_ARM | [
"26a81590875134d0752cead89e713bb22592e78b"
] | [
"labs/12_i2c_oled_display/convert.py"
] | [
"import imageio\nimport sys\nimport os\nimport numpy as np\n\nif (len(sys.argv) != 2):\n print(\"Format: python convert.py grayscale_image_name\")\n sys.exit(1)\n\ntry:\n data = imageio.imread(sys.argv[1])\nexcept:\n print(\"Wrong image name!\")\n sys.exit(1)\n\nif (len(data.shape) != 2):\n print(... | [
[
"numpy.array_split"
]
] |
abigailbishop/pyrex | [
"10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5",
"10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5",
"10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5"
] | [
"pyrex/kernel.py",
"pyrex/generation.py",
"analyses/ara_coincidences/missed_events_TD_plotsaver.py"
] | [
"\"\"\"\nModule for the simulation kernel.\n\nThe simulation kernel is responsible for running through the simulation\nchain by controlling classes and objects which will independently produce\nneutrinos, create corresponding signals, propagate the signals to antennas,\nand handle antenna processing of the signals.... | [
[
"numpy.radians",
"numpy.abs",
"numpy.linspace",
"numpy.degrees",
"numpy.vdot"
],
[
"numpy.sqrt",
"numpy.random.random_sample",
"numpy.cos",
"numpy.sin",
"numpy.all",
"numpy.random.rand",
"numpy.exp",
"numpy.random.uniform",
"numpy.array",
"numpy.sum"... |
vanashimko/digital-signals-modeling | [
"31ec88759194c332a5fffeeba4f41126f59f307d"
] | [
"main.py"
] | [
"from math import pi\n\nimport matplotlib.pyplot as plt\n\nimport drawer\nfrom signals import HarmonicParameters, harmonic_signal, polyharmonic_signal, polyharmonic_linear\n\n\ndef main():\n results = []\n for i, viewer in enumerate([show_phases, show_frequencies, show_amplitudes, show_polyharmonic_linear]):\... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
anqif/a2dr | [
"b101b13c17448f43c5c9bb3ec6bcdf18aca73a66"
] | [
"a2dr/tests/test_precondition.py"
] | [
"\"\"\"\nCopyright 2019 Anqi Fu, Junzi Zhang\n\nThis file is part of A2DR.\n\nA2DR is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\n... | [
[
"numpy.split",
"numpy.maximum",
"numpy.abs",
"numpy.random.seed",
"scipy.sparse.eye",
"numpy.eye",
"scipy.optimize.nnls",
"numpy.linalg.norm",
"scipy.sparse.linalg.norm",
"numpy.random.randn",
"scipy.sparse.hstack",
"numpy.zeros"
]
] |
tehunter/pandas | [
"c57f883e24405fb4ee561ded1612acf4f4f2bdef"
] | [
"pandas/core/reshape/reshape.py"
] | [
"from __future__ import annotations\n\nimport itertools\nfrom typing import TYPE_CHECKING\nimport warnings\n\nimport numpy as np\n\nimport pandas._libs.reshape as libreshape\nfrom pandas._libs.sparse import IntIndex\nfrom pandas._typing import (\n Dtype,\n npt,\n)\nfrom pandas.errors import PerformanceWarning... | [
[
"numpy.take",
"pandas.core.dtypes.common.is_extension_array_dtype",
"pandas._libs.sparse.IntIndex",
"numpy.dtype",
"pandas.core.sorting.get_group_index_sorter",
"pandas.core.dtypes.missing.notna",
"numpy.max",
"numpy.iinfo",
"pandas.core.sorting.get_group_index",
"pandas.co... |
johnson7788/MAAC | [
"466866534fc24ebfdc0968619f6ba7cabe0aac8b"
] | [
"main.py"
] | [
"import argparse\nimport torch\nimport os\nimport numpy as np\nfrom gym.spaces import Box, Discrete\nfrom pathlib import Path\nfrom torch.autograd import Variable\nfrom tensorboardX import SummaryWriter\nfrom utils.make_env import make_env\nfrom utils.buffer import ReplayBuffer\nfrom utils.env_wrappers import Subpr... | [
[
"torch.manual_seed",
"numpy.vstack",
"numpy.random.seed"
]
] |
alliedel/anomalyframework_python | [
"63c56d9fb2e1dc37dfca494805e7fa179e078623"
] | [
"anomalyframework/tests/test_full.py"
] | [
"import numpy as np\nimport unittest\nimport tempfile\n\nfrom anomalyframework import liblinear_utils\nfrom anomalyframework import run\n\nONE_BASED = 1\n\n\nclass TestFull(unittest.TestCase):\n def easy_2d_test(self):\n prediction, ground_truth = easy_2d_test()\n self.assertListEqual(prediction.to... | [
[
"numpy.arange",
"numpy.ones",
"numpy.random.normal",
"numpy.std",
"numpy.mean",
"numpy.zeros"
]
] |
bdevy/raspi-sump | [
"78d0101808e54ea091a43f9142cdc7d8c31804b0"
] | [
"raspisump/todaychart.py"
] | [
"'''Graph sump pit activity.'''\n\n# Raspi-sump, a sump pump monitoring system.\n# Al Audet\n# http://www.linuxnorth.org/raspi-sump/\n#\n# All configuration changes should be done in raspisump.conf\n# MIT License -- http://www.linuxnorth.org/raspi-sump/license.html\n\nimport time\nimport numpy as np\nimport matplot... | [
[
"matplotlib.pyplot.plot_date",
"matplotlib.dates.strpdate2num",
"matplotlib.pyplot.title",
"matplotlib.use",
"matplotlib.__version__.split",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.rcParams.update",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.s... |
BodenmillerGroup/pycytools | [
"a79ed661a672fa15831830efa9c4c3bb7018b29d"
] | [
"pycytools/plots.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.ndimage.filters import gaussian_filter\n\nimport pycytools.library as lib\n\n\ndef plot_rgb_imc(imc_img, metals, norm_perc=99.9, sigma=1, outlierthresh=30, saturation=1):\n plt.figure()\n imgstack = [imc_img.get_img_by_metal(m) for m in metals]\... | [
[
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"numpy.stack",
"numpy.percentile",
"scipy.ndimage.filters.gaussian_filter",
"matplotlib.pyplot.axis",
"numpy.sum",
"matplotlib.pyplot.figure"
]
] |
zhang-xin/ncappzoo | [
"3b46ae583556378eff27d08f545726507557cd38"
] | [
"apps/ssd-object-detector/ssd-object-detector.py"
] | [
"#!/usr/bin/python3\n\n# ****************************************************************************\n# Copyright(c) 2017 Intel Corporation. \n# License: MIT See LICENSE file in root directory.\n# ****************************************************************************\n\n# How to run Single Shot Multibox Dete... | [
[
"numpy.float16",
"numpy.sum"
]
] |
XuMengyaAmy/CIDACaptioning | [
"1b5446e9db1aaea524fe3645da947eb5c33413cf"
] | [
"models/transformer/encoders.py"
] | [
"from torch.nn import functional as F\nfrom models.transformer.utils import PositionWiseFeedForward\nimport torch\nfrom torch import nn\nfrom models.transformer.attention import MultiHeadAttention\nfrom models.transformer.gaussian_kernel import get_gaussian_filter\n\nclass EncoderLayer(nn.Module):\n def __init__... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.sum",
"torch.nn.LayerNorm",
"torch.nn.Linear"
]
] |
foreverxq/my_1conv | [
"a42390c3854fee7ba733b3a7d8872c0ae4112c6e"
] | [
"layers/modules/multibox_loss.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom data import coco as cfg\n# from ..box_utils import match, log_sum_exp\nfrom layers.box_utils import match, log_sum_exp\n\nclass MultiBoxLoss(nn.Module):\n \"\"\"SSD损失函数\n 计... | [
[
"torch.LongTensor",
"torch.Tensor",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.smooth_l1_loss",
"torch.autograd.Variable"
]
] |
JiaMingLin/tsn-pytorch | [
"d9173033900eb3fbda5aaf9478727e0673bc84b7"
] | [
"dataset.py"
] | [
"import torch.utils.data as data\n\nfrom PIL import Image\nimport os\nimport os.path\nimport numpy as np\nfrom numpy.random import randint\n\nclass VideoRecord(object):\n def __init__(self, row):\n self._data = row\n\n @property\n def path(self):\n return self._data[0]\n\n @property\n d... | [
[
"numpy.zeros",
"numpy.random.randint"
]
] |
JelleAalbers/plunc | [
"e70806b17c56dfb7ffa882faf6d61f1959d1ccca"
] | [
"tests/test_interval.py"
] | [
"import unittest\nimport numpy as np\n\nimport logging\nimport sys\n\nfrom plunc.intervals.basic import CentralCI\nfrom plunc.statistics import NumberOfEvents\nfrom plunc.exceptions import InsufficientPrecisionError\n\n# 90% confidence level on Poisson rate if n=20 or n=120 events observed.\n# Values taken from cal... | [
[
"numpy.arange",
"numpy.log10",
"numpy.ones"
]
] |
Keyrat06/Gaussian_Processes_Sampling | [
"50eac1163da001bf708470580750f55ca9709a98"
] | [
"example.py"
] | [
"import threading\nimport matplotlib.pyplot as plt\nimport pickle\nimport time\nimport numpy as np\nimport cv2\nimport GaussianProcess\nimport util\nfrom scipy import interpolate\nplt.ion()\n\nN = util.N\nM = util.M\nK = 2\n\n# MAP = np.ones((N,M,K))/float(K)\nMAP = lambda x, y: np.ones(K)/float(K)\n# np.random.see... | [
[
"matplotlib.pyplot.imshow",
"numpy.random.seed",
"numpy.linspace",
"matplotlib.pyplot.title",
"numpy.ones",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.clf",
"numpy.random.randint",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.ion",
"matplotlib... |
Renelvon/fsic | [
"24878074bb465f05bd0e0b1e9cff947dd73b391b"
] | [
"fsic/util.py"
] | [
"\"\"\"Convenient methods for general machine learning\"\"\"\n\nimport numpy as np\n\n\nclass NumpySeedContext:\n \"\"\"\n A context manager to reset the random seed by numpy.random.seed(..).\n Set the seed back at the end of the block.\n \"\"\"\n\n def __init__(self, seed):\n self.seed = seed... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.max",
"numpy.mean",
"numpy.divide",
"numpy.clip",
"numpy.tril_indices",
"numpy.full",
"numpy.real",
"numpy.random.set_state",
"numpy.std",
"numpy.isrealobj",
"numpy.outer",
"numpy.multiply",
"numpy.random.choice",
"n... |
pipekorsi/IsoMut2 | [
"f45f125f79e6ebef218be349aaf5897301e121d1"
] | [
"isomut2py/format.py"
] | [
"try:\n from isomut2py import ploidyestimation\n\n import pandas as __pd\n import numpy as __np\n import os as __os\n import subprocess as __subprocess\nexcept ImportError:\n print('ImportError in isomut2py.format, generating bed files will not work.')\n\n\ndef get_bed_format_for_sample(chromosome... | [
[
"pandas.read_csv",
"numpy.where",
"numpy.mean",
"pandas.DataFrame"
]
] |
czha5168/pytorch-semseg | [
"5cd845f1c911ab6ee4cbc6a3ce90f01229326fab"
] | [
"ptsemseg/models/unet.py"
] | [
"import torch.nn as nn\n\nfrom ptsemseg.models.utils import *\n\n\nclass unet(nn.Module):\n def __init__(\n self,\n feature_scale=4,\n n_classes=21,\n is_deconv=True,\n in_channels=3,\n is_batchnorm=True,\n ):\n super(unet, self).__init__()\n self.is_dec... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Conv2d"
]
] |
CompML/PRTS | [
"66db2ac5f83ac9182ce29dcd7afc0f678a678eed"
] | [
"tests/test_precision.py"
] | [
"import unittest\nimport numpy as np\n\nfrom prts.base.time_series_metrics import BaseTimeSeriesMetrics\nfrom prts.time_series_metrics.precision import TimeSeriesPrecision\nfrom prts import ts_precision\n\n\nclass TestPrecision(unittest.TestCase):\n def test_PrecisionClass_inherited_BaseTimeSeriesMetrics(self):\... | [
[
"numpy.array"
]
] |
jisunl23/wouldyouci | [
"1a896008487a979139596aa8aa8d108b740d95ef"
] | [
"wouldyouci_back/utils/update_train_data.py"
] | [
"import os\nimport surprise\nimport pymysql\nimport pandas as pd\nfrom decouple import config\n\n\ndef get_genre_info():\n BASE_DIR = os.path.dirname(os.path.abspath(__file__))\n conn = pymysql.connect(host=config('HOST'), port=3306, user=config('USER'),\n password=config('PASSWORD')... | [
[
"pandas.to_pickle",
"pandas.read_sql_query",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
synwalk/synwalk-analysis | [
"964aa5c1e1ee5596227264ab2f804b50bc458799"
] | [
"src/wrappers/metrics.py"
] | [
"import networkx as nx\nimport numpy as np\nfrom clusim.clustering import Clustering\nfrom networkx import Graph\nfrom sklearn.metrics import adjusted_mutual_info_score\n\n\ndef ami_score(clu_file_pred, clu_file_true, graph_file=None):\n \"\"\"Compute adjusted mutual (AMI) information between two clusterings.\n\... | [
[
"numpy.log2",
"numpy.zeros",
"sklearn.metrics.adjusted_mutual_info_score"
]
] |
josibake/pandas | [
"02675e3376fea7d3cd484ace874d676c142cf003"
] | [
"pandas/util/testing.py"
] | [
"import bz2\nfrom collections import Counter\nfrom contextlib import contextmanager\nfrom datetime import datetime\nfrom functools import wraps\nimport gzip\nimport os\nimport re\nfrom shutil import rmtree\nimport string\nimport tempfile\nfrom typing import Union, cast\nimport warnings\nimport zipfile\n\nimport num... | [
[
"pandas.core.computation.expressions.set_use_numexpr",
"pandas.Series",
"numpy.linspace",
"pandas.compat._get_lzma_file",
"pandas.RangeIndex",
"pandas.core.dtypes.common.is_extension_array_dtype",
"numpy.random.random_sample",
"pandas.DataFrame",
"pandas.core.dtypes.common.is_d... |
mesielepush/Demi | [
"c108d52c8e44949bc8bb67c0aef733a8772015f0"
] | [
"scripts/nn/simple_lstm/train_lstm.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport random\nimport numpy as np\nimport pandas as pd\nimport joblib\nimport tensorflow as tf\nfrom sklearn.metrics import confusion_matrix as cmx\nTOP_K = 20000\n\nos.environ['PYTHONHASHSE... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"numpy.random.seed",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"sklearn.metrics.confusion_matrix",
"tensorflow.keras.optimizers.Adam",
"tensorflow.compat.v2.keras.layers.LSTM",
"tensorflow.keras.layers.Dropou... |
hsnlab/annabellaDB | [
"daeaf394babd07b6d980a3eaa74be6614e7124b8"
] | [
"demo/demo_console.py"
] | [
"import shlex\nfrom cmd import Cmd\nimport subprocess\nimport time\nimport docker\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport copy\nimport _thread\nimport os\n\nG = nx.Graph()\nSERVER_IP = {\"kvs1\": \"172.17.0.2\", \"kvs2\": \"172.17.0.3\"}\nnf_server_assignment = {}\nclient = docker.from_env(t... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.savefig"
]
] |
willemolding/JointGaussianChangeDetector | [
"6f67d479a08999cc6427658c64591bf639e67689"
] | [
"jointcd/change_point_estimator.py"
] | [
"from change_detector import ChangeDetector\nimport numpy as np\nfrom functools import partial\nfrom scipy.spatial.distance import mahalanobis\nfrom scipy.linalg import pinvh\n\n\ndef partition(sigma, k):\n \"\"\"\n Partitions a covariance matrix by zeroing out off diagonal blocks to create independence\n ... | [
[
"numpy.copy",
"scipy.spatial.distance.mahalanobis",
"numpy.argmin"
]
] |
richpsharp/ecoshard | [
"4f5e15835160901b83001e82496576236b2328e5"
] | [
"src/ecoshard/geoprocessing/geoprocessing.py"
] | [
"# coding=UTF-8\n\"\"\"A collection of raster and vector algorithms and utilities.\"\"\"\nimport collections\nimport functools\nimport logging\nimport math\nimport os\nimport pprint\nimport queue\nimport shutil\nimport sys\nimport tempfile\nimport threading\nimport time\n\nfrom . import geoprocessing_core\nfrom .ge... | [
[
"numpy.linspace",
"numpy.in1d",
"numpy.ndarray",
"numpy.dtype",
"numpy.max",
"numpy.broadcast",
"numpy.where",
"numpy.unique",
"numpy.finfo",
"numpy.ceil",
"numpy.copy",
"numpy.count_nonzero",
"numpy.fft.irfftn",
"numpy.zeros",
"numpy.isclose",
"nump... |
micheleantonazzi/gibson-dataset | [
"cb5fc81061bbda1a653d6fc7b625b14c8a517f3c"
] | [
"tests/test_sample_generator.py"
] | [
"import numpy as np\nimport pytest\n\nfrom generic_dataset.data_pipeline import DataPipeline\nfrom generic_dataset.generic_sample import GenericSample, AnotherActivePipelineException, FieldHasIncorrectTypeException\nfrom generic_dataset.sample_generator import SampleGenerator, FieldNameAlreadyExistsException, \\\n ... | [
[
"numpy.array"
]
] |
calofmijuck/pytorch-bert-fine-tuning | [
"9ef6454352ec4d25e1f33ce62b26f579dc5a406d"
] | [
"pytorch_pretrained_bert/modeling.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may ... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.sigmoid",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.load",
"torch.zeros",
"torch.sqrt",
"torch.zeros_like",
"torch.nn.Embedding",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.matmul",
"torch.arange",
"... |
lcarde/pymanip | [
"d6f0b90b678d6f508d86d2d3ba3b580615c9566f",
"d6f0b90b678d6f508d86d2d3ba3b580615c9566f"
] | [
"samples/pymba_acquisition_continuous.py",
"samples/essai_andor.py"
] | [
"from pathlib import Path\nimport time\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport png\n\nfrom pymba import *\nfrom pymba.vimbaexception import VimbaException\nfrom pymba.vimbainterface import VimbaInterface\nfrom pymanip import Session\n\n# Paramètres de l'acquisition\ndestination_dir = Path(r'C... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.mean",
"matplotlib.pyplot.figure"
],
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.clim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
BaiYuhaoSpiceeYJ/SEGAN_denoise | [
"5bf65ae72b9f0a996ae338c53c68c4967e08cd59"
] | [
"segan/models/generator.py"
] | [
"import torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.nn.utils as nnu\nimport torch.nn as nn\nimport random\nimport numpy as np\ntry:\n from core import *\n from modules import *\nexcept ImportError:\n from .core import *\n from .modules import *\n\n# BEWARE: ... | [
[
"torch.nn.Dropout",
"scipy.signal.cheby1",
"torch.max",
"torch.ones",
"torch.cat",
"torch.nn.LSTM",
"torch.randn",
"torch.nn.ModuleList",
"torch.min",
"torch.zeros",
"torch.nn.PReLU",
"torch.nn.Tanh",
"scipy.signal.dimpulse",
"torch.FloatTensor",
"torch.... |
virajmehta/vae-training | [
"dc99fea6f012b7256ad65f65972183fc22e82c8e"
] | [
"utils.py"
] | [
"import os\nimport jax\nimport jax.numpy as jnp\nfrom jax import lax\nimport jax.nn.initializers as initializers\nimport flax\nimport numpy as np\nimport cv2\nimport json\n\nDATA_DIR = 'data/'\n\n\n\nclass Constants:\n \"\"\"\n Recommended hyperparameters (Feel free to add/remove/modify these values).\n \"... | [
[
"numpy.array",
"numpy.sqrt",
"numpy.empty"
]
] |
jairideout/astropy | [
"2534a2dd747da3d50644812ce4faab6d909e7f36",
"2534a2dd747da3d50644812ce4faab6d909e7f36"
] | [
"astropy/convolution/kernels.py",
"astropy/coordinates/tests/test_funcs.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport math\n\nimport numpy as np\n\nfrom .core import Kernel1D, Kernel2D, Kernel\nfrom .utils import KernelSizeError\nfrom ..modeling import models\nfrom ..modeling.core import Fittable1DModel, Fittable2DModel\nfrom ..utils.decorators import depre... | [
[
"numpy.logical_or",
"numpy.max",
"numpy.array",
"numpy.sqrt"
],
[
"numpy.ones",
"numpy.abs",
"numpy.testing.assert_allclose"
]
] |
j40903272/bottom-up-attention-py3 | [
"cceb719133023895a4b63569c5ba9a25fcd2c86b"
] | [
"lib/datasets/vg.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# -------... | [
[
"numpy.argmax",
"numpy.mean",
"numpy.average",
"numpy.array",
"numpy.zeros"
]
] |
jinliangwei/tensor2tensor-1.11 | [
"bfca92e0c48956ad5be987b25b4309a59ff61bb5"
] | [
"tensor2tensor/models/research/moe.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"tensorflow.logging.info"
]
] |
naseemap47/GestureVolumeControl-ComputerVision-python | [
"17f7b1aa6528d5a0701e49ce294708ccd5d574b0"
] | [
"gesture_control.py"
] | [
"import cv2\nimport mediapipe as mp\nimport time\nimport math\nimport numpy as np\nfrom change_vol import set_master_volume\n\ncap = cv2.VideoCapture(0)\np_time = 0\n\nmp_hand = mp.solutions.hands\nhand = mp_hand.Hands(max_num_hands=1)\nmp_draw = mp.solutions.drawing_utils\n\nvol = 0\nvol_bar = 400\n\nwhile True:\n... | [
[
"numpy.interp"
]
] |
nickleus27/pandas | [
"e892d46598d303530519dde7e00b69e549a3d7ea"
] | [
"pandas/tests/generic/test_duplicate_labels.py"
] | [
"\"\"\"Tests dealing with the NDFrame.allows_duplicates.\"\"\"\nimport operator\n\nimport numpy as np\nimport pytest\n\nimport pandas as pd\nimport pandas._testing as tm\n\nnot_implemented = pytest.mark.xfail(reason=\"Not implemented.\")\n\n# -------------------------------------------------------------------------... | [
[
"numpy.array",
"pandas.CategoricalIndex",
"pandas.concat",
"pandas.merge",
"pandas.Series",
"pandas.Timestamp",
"pandas.Index",
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"pandas.Timedelta",
"pandas.MultiIndex.from_product",
"pandas._testing.round_trip_pic... |
wordsand/fsgan | [
"dabfc28afda0463100f37c48fd6dfed308e6e2b0"
] | [
"train_blending.py"
] | [
"import os\nimport itertools\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.utils as tutils\nimport torch.nn.functional as F\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm\nfrom fsgan.utils.obj_factory import obj_factory\nfrom fsgan.utils.tensorboard_logger import TensorBoardLo... | [
[
"numpy.log2",
"torch.load",
"torch.cat",
"numpy.min",
"torch.utils.data.DataLoader",
"numpy.max",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.nn.DataParallel",
"torch.utils.data.sampler.WeightedRandomSampler",
"numpy.where",
"torch.as_tensor"
]
] |
fameyer/pymorWin | [
"b449a38754fddb719d554f1aacf9280a585f1168"
] | [
"src/pymor/algorithms/ei.py"
] | [
"# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\n\"\"\"This module contains algorithms for the empirical interpolation of operators.\n\nThe main work for ... | [
[
"numpy.hstack",
"scipy.linalg.cho_factor",
"numpy.argmax",
"numpy.zeros",
"numpy.tril"
]
] |
krishna-aditi/Big-Data-Systems-Assignment-2 | [
"a7e02b4588e9609c6a9ff12e04169ca042300950"
] | [
"src/losses/vggloss.py"
] | [
"\"\"\"\nVarious loss functions for training \n\n\"\"\"\nimport os\nimport tensorflow as tf\n\n# Global vars for VGG19 loss\nglobal vggfull\nglobal vggfeats\nglobal vggfeats_l\nglobal vggfeats_seq\nglobal vggfeats_seq_l\nglobal vgginput_shape\nglobal vgginit\n\n# Download this file using keras first.\n_default_vgg_... | [
[
"tensorflow.concat",
"tensorflow.keras.layers.Lambda",
"tensorflow.reduce_mean",
"tensorflow.keras.layers.TimeDistributed",
"tensorflow.reshape",
"tensorflow.exp",
"tensorflow.keras.Model",
"tensorflow.keras.applications.VGG19",
"tensorflow.image.resize",
"tensorflow.contri... |
huangzhii/biolearns | [
"95d58d55690e550fff94730f34ed7c0fb96f12af"
] | [
"build/lib/biolearns/coexpression/lmQCM.py"
] | [
"# Copyright 2020 Zhi Huang. All rights reserved\n# Created on Mon Feb 10 17:57:08 2020\n# Author: Zhi Huang, Purdue University\n# ___ ___ ___ ___ ___ \n# /\\__\\ /\\__\\ /\\ \\ /\\ \\ /\\__\\ \n# /:/ / /::| | /::\\ \\... | [
[
"numpy.sqrt",
"pandas.DataFrame",
"numpy.max",
"numpy.fill_diagonal",
"numpy.nanmean",
"scipy.stats.spearmanr",
"numpy.nanstd",
"numpy.linalg.svd",
"numpy.arange",
"numpy.stack",
"numpy.intersect1d",
"numpy.argmax",
"numpy.multiply",
"numpy.isnan",
"nump... |
jackharmer/agency | [
"5a78dd23e14c44c4076e49ea44b83ab1697e51c8"
] | [
"tests/short/discount_test.py"
] | [
"import torch\nfrom agency.tools.gamma_matrix import make_gamma_matrix, discount\nfrom pytest import approx\n\n\ndef simple_discount(rewards, gamma, value, masks):\n discounts = []\n V = value\n for cc in reversed(range(len(rewards))):\n V = rewards[cc] + gamma * masks[cc] * V\n discounts.app... | [
[
"torch.tensor"
]
] |
SheffieldChemoinformatics/molsg | [
"13c2edfce84539266e344119316b29a070816afc"
] | [
"scripts/compute_covariance_descriptor.py"
] | [
"\"\"\"Compute example WKS compute_WKS_descriptor.\"\"\"\nfrom __future__ import print_function, absolute_import\nimport numpy as np\nfrom molsg.laplacemesh import compute_lb_fem\nfrom molsg.localgeometry import WKS_descriptor\nfrom molsg.covariance import covariance_descriptor\n\nevals = 100\n\nmol = np.load('data... | [
[
"numpy.load"
]
] |
chlorophyll-zz/qiskit-ibmq-provider | [
"ee2b326b0a07dba132cca4f85fe700f030b5880f"
] | [
"test/ibmq/test_ibmq_job.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE... | [
[
"scipy.stats.chi2_contingency"
]
] |
vandedok/dlcourse_ai | [
"b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f"
] | [
"assignments/assignment2/.ipynb_checkpoints/gradient_check-checkpoint.py"
] | [
"import numpy as np\n\n\ndef check_gradient(f, x, delta=1e-5, tol=1e-4):\n \"\"\"\n Checks the implementation of analytical gradient by comparing\n it to numerical gradient using two-point formula\n\n Arguments:\n f: function that receives x and computes value and gradient\n x: np array, initi... | [
[
"numpy.ones_like",
"numpy.nditer",
"numpy.random.randn",
"numpy.sum",
"numpy.isclose"
]
] |
pauxy-qmc/pauxy | [
"1da80284284769b59361c73cfa3c2d914c74a73f",
"1da80284284769b59361c73cfa3c2d914c74a73f"
] | [
"pauxy/estimators/mixed.py",
"pauxy/estimators/tests/simple_3d.py"
] | [
"import h5py\nimport numpy\ntry:\n from mpi4py import MPI\n mpi_sum = MPI.SUM\nexcept ImportError:\n mpi_sum = None\nimport scipy.linalg\nimport time\nfrom pauxy.estimators.utils import H5EstimatorHelper\nfrom pauxy.estimators.ci import get_hmatel\nfrom pauxy.estimators.thermal import particle_number, one_... | [
[
"numpy.array",
"numpy.zeros"
],
[
"matplotlib.pyplot.legend",
"numpy.dot",
"numpy.maximum",
"numpy.linspace",
"numpy.random.seed",
"scipy.fftpack.helper.next_fast_len",
"numpy.fft.fftn",
"numpy.fft.ifftn",
"matplotlib.pyplot.plot",
"numpy.prod",
"numpy.array... |
minhnd3796/facenet | [
"2951cf3ef8065a238876ba6c18d34f40cc389b13"
] | [
"src/create_frt_pairs_file_new_test_classes.py"
] | [
"import os\nimport random\nimport numpy as np\n\ndata_dir = '/ditmemay/raid/fti/vision.minhnd/datasets/frt/cropped_face'\ntest_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 548, 2874, 558, 1753, 2270], dtype=np.int32)\nsecond_test_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 5... | [
[
"numpy.array"
]
] |
samsammurphy/sat-stac-sentinel | [
"2ffbcc8e47cec32809e9661995c6e157b034fb26"
] | [
"satstac/sentinel/main.py"
] | [
"import boto3\nimport gzip\nimport json\nimport logging\nimport requests\nimport sys\n\nimport numpy as np\nimport os.path as op\n\nfrom shapely.geometry import MultiPoint, Point\nfrom shapely import geometry\n\nfrom datetime import datetime, timedelta\nfrom dateutil.parser import parse\nfrom pyproj import Proj, tr... | [
[
"numpy.std",
"numpy.mean"
]
] |
SamChen/DeepSpeech2_Pytorch_TransferLearning | [
"8c2cf0437f4facd3f5fc282f33b359873d3c5541"
] | [
"data_utils/audio.py"
] | [
"\"\"\"Contains the audio segment class.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport io\nimport struct\nimport re\nimport soundfile\nimport resampy\nfrom scipy import signal\nimport random\nimport copy\n\n\nclass... | [
[
"numpy.linspace",
"scipy.signal.fftconvolve",
"numpy.arange",
"numpy.cumsum",
"numpy.dtype",
"numpy.finfo",
"numpy.concatenate",
"numpy.frombuffer",
"numpy.log10",
"numpy.mean",
"numpy.interp",
"numpy.any",
"numpy.iinfo"
]
] |
Kguo-cs/TDOR | [
"c538ccb99e6b981c5d09bfc451c2a207449a3f64"
] | [
"model/transformer.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math, copy, time\n\n\ndef clones(module, N):\n \"Produce N identical layers.\"\n return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])\n\nclass Encoder(nn.Module):\n \"Core encoder is a stack of N layers\"\n\n def __... | [
[
"torch.nn.Dropout",
"torch.nn.functional.softmax",
"torch.nn.LayerNorm",
"torch.matmul",
"torch.nn.Linear"
]
] |
DimitriosDelikonstantis/RoughML | [
"31a06db4b295a64af11c6cfa264563f61b52f772"
] | [
"src/roughml/scripts/image_fft2d.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom skimage.color import rgb2gray\nimport cv2\nimport argparse\n\n\ndef get_image_fft(image_filename, show_original=False, show_grayscale=False, show_fft=False):\n # load image\n original_image = cv2.imread(image_filename)\n if show_original:\n ... | [
[
"numpy.fft.fft2",
"matplotlib.pyplot.show",
"matplotlib.pyplot.title"
]
] |
uber/pyro | [
"e2aad5ed70d20709bfdd7bc3f50eb7f87577081b"
] | [
"tests/distributions/conftest.py"
] | [
"# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport math\nfrom math import pi\n\nimport numpy as np\nimport pytest\nimport scipy.stats as sp\n\nimport pyro.distributions as dist\nfrom pyro.distributions.testing.naive_dirichlet import NaiveBeta, NaiveDirichlet\nfrom py... | [
[
"numpy.array"
]
] |
dspftw/dspftw | [
"14de953f95e3a0710f10ee76d012c52ab12d6467"
] | [
"dspftw/root_raised_cosine_filter_generator.py"
] | [
"# vim: expandtab tabstop=4 shiftwidth=4\n\nfrom numpy import pi, sin, ceil, append, arange, zeros\nfrom numpy import array as nparray\n\nfrom .root_raised_cosine import root_raised_cosine\n\ndef root_raised_cosine_filter_generator(symbol_width: int, symbol_rate: float, sample_rate: float, beta: float=0.25) -> npar... | [
[
"numpy.ceil",
"numpy.arange",
"numpy.zeros",
"numpy.sin"
]
] |
gfngoncalves/foam_graph | [
"b1b735aef3eeaa6e9b8430c5520abff871ce3ffb"
] | [
"test/test_plot.py"
] | [
"import torch\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torch_geometric.data import Data\nfrom foam_graph.visualization.graph_plotting import plot_graph, plot_graph_contour\nfrom foam_graph.visualization.graph_3d_plotting import plot_3d_graph\n\n\ndef test_plot_2d():\n edge_index = torch.tensor(... | [
[
"numpy.testing.assert_equal",
"matplotlib.pyplot.subplots",
"torch.tensor"
]
] |
JiajunSong629/download-project | [
"83e31b3db18b83add4c7293a3375adb61b0c59c3"
] | [
"src/data/load_weight_sensor.py"
] | [
"\"\"\"\nload_weight_sensor.py\nget the raw seat and foot weight data, and get\nthe clean total weight\n\"\"\"\n\nimport warnings\nimport sqlite3\nimport os\nimport pandas as pd\nimport numpy as np\nfrom typing import Optional, List\nfrom src.data import load_water_distance\nimport config\n\n\nwarnings.filterwarnin... | [
[
"numpy.ceil",
"numpy.mean",
"pandas.Series",
"numpy.floor"
]
] |
vicFigure/tf-ssd-mobilenetv1 | [
"9adf4f821f5ddeb45c973dd52a440cfabc09c9fd"
] | [
"train_ssd_network.py"
] | [
"# Copyright 2016 Paul Balanca. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic... | [
[
"tensorflow.Graph",
"tensorflow.summary.histogram",
"tensorflow.python.ops.control_flow_ops.with_dependencies",
"tensorflow.get_collection",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.ConfigProto",
"tensorflow.nn.zero_fraction",
"tensorflow.train.ExponentialMovingAverage",
... |
zapatacomputing/z-quantum-core | [
"456f5d83ba641982e710e2abe19afa4e266ab4a8"
] | [
"src/python/zquantum/core/openfermion/_utils.py"
] | [
"import itertools\nimport random\nfrom typing import Iterable, List, Optional\n\nimport numpy as np\nfrom openfermion import (\n FermionOperator,\n InteractionOperator,\n InteractionRDM,\n PolynomialTensor,\n QubitOperator,\n count_qubits,\n)\nfrom openfermion import expectation as openfermion_exp... | [
[
"numpy.log2",
"numpy.copy",
"numpy.real",
"numpy.array",
"numpy.zeros",
"numpy.conjugate"
]
] |
lsc25846/R | [
"9712203f264f8a487c56135cdc4359d4e022f991"
] | [
"train_refinedet.py"
] | [
"import os\nimport time\nimport argparse\nimport torch\nimport _init_paths\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data as data\nfrom libs.utils.augmentations import SSDAugmentation\nfrom libs.networks.vgg_refinedet import VGGRefine... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.nn.DataParallel",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.cuda.device_count",
"torch.autograd.Variable"
]
] |
junjihashimoto/vision | [
"791c172a337d98012018f98ffde93b1020ba3ed5"
] | [
"test/test_models.py"
] | [
"from common_utils import TestCase, map_nested_tensor_object, freeze_rng_state\nfrom collections import OrderedDict\nfrom itertools import product\nimport torch\nimport numpy as np\nfrom torchvision import models\nimport unittest\nimport traceback\nimport random\n\n\ndef set_rng_seed(seed):\n torch.manual_seed(s... | [
[
"torch.jit.script",
"torch.nn.Sequential",
"torch.mean",
"numpy.random.seed",
"torch.manual_seed",
"torch.std",
"torch.rand",
"torch.cuda.is_available"
]
] |
wzhlifelover/JengaBot | [
"eb161c7e0222c4f09f0d4c95b7650e4c2574e39e"
] | [
"arm control/locate_jenga.py"
] | [
"import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport arm_camera_calibrate\nimport Calibration\n\ndef saveImage(labeled_img1, fname1, labeled_img2, fname2):\n # show image for down camera\n plt.imshow(cv2.cvtColor(labeled_img1, cv2.COLOR_BGR2RGB))\n ... | [
[
"numpy.ones_like",
"matplotlib.pyplot.title",
"numpy.linalg.norm",
"matplotlib.pyplot.savefig",
"numpy.max",
"numpy.append",
"numpy.argmax",
"matplotlib.pyplot.axis",
"numpy.array"
]
] |
msk-access/sequence_qc | [
"a90ecd70c402472078b2a0a2ed20fc9727551ddd"
] | [
"sequence_qc/plot_noise_by_tlen.py"
] | [
"import numpy as np\nimport pandas as pd\n\nimport plotly.figure_factory as ff\n\n\nSUBSTITUTION_TYPES_COMBINED = [\n [[\"G>T\", \"C>A\"], \"C>A\"],\n [[\"C>G\", \"G>C\"], \"C>G\"],\n [[\"G>A\", \"C>T\"], \"C>T\"],\n [[\"T>A\", \"A>T\"], \"T>A\"],\n [[\"A>G\", \"T>C\"], \"T>C\"],\n [[\"T>G\", \"A>... | [
[
"pandas.concat",
"pandas.to_numeric"
]
] |
dk-wei/GCP-code-snippets | [
"c23ca7f2981b5df946448b20a54f823ce52bba05"
] | [
"ml/kubeflow-argo/components/kubeflow/taxi_model/trainer/taxi.py"
] | [
"# Copyright 2018 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"tensorflow.FixedLenFeature"
]
] |
Collebt/LoFTR_implement | [
"f63c3fe08a1868380ed9a20dcddf4e8949a816e4"
] | [
"src/datasets/megadepth.py"
] | [
"import os.path as osp\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\nfrom loguru import logger\n\nfrom src.utils.dataset import read_megadepth_gray, read_megadepth_depth\n\n\nclass MegaDepthDataset(Dataset):\n def __init__(self,\n root_d... | [
[
"numpy.random.choice",
"numpy.linalg.inv",
"torch.tensor",
"torch.stack",
"numpy.load"
]
] |
punch872/EyeWarnYou | [
"71ea21a8b3f1ae213478d735a10a240524b89702"
] | [
"allinone/geo8_choropleth.py"
] | [
"#1.0 Import Library\nimport json\nimport folium\nimport pandas as pd\nfrom folium.plugins import MarkerCluster\n\n#Load Data\ngeo_data = json.load(open(\"thailand.json\"))\nemp_data = pd.read_csv(\"us-unemployment.csv\")\n\ndata = pd.read_csv(\"data/output-2015.csv\")\nlat = data['latitude']\nlon = data['longitude... | [
[
"pandas.read_csv"
]
] |
chokobole/felicia-examples | [
"83303cf0f4bf688e9794ee574394d98619a16007"
] | [
"examples/deep_learning/object_detection/object_detection_from_camera.py"
] | [
"# Copyright (c) 2019 The Felicia Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nimport sys\n\nimport numpy as np\n\nimport import_order_resolver # Should be before import felicia_py\nimport felicia_py as fel\nimport felicia_... | [
[
"numpy.array"
]
] |
PolasekT/ICTree | [
"d13ad603101805bcc288411504ecffd6f2e1f365"
] | [
"PerceptualMetric/psrc/perceptree/test/data/dummy_tree_image.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nWrapper for testing tree file.\n\"\"\"\n\n\nfrom typing import Tuple\n\nimport base64\nimport numpy as np\nimport struct\n\n\ndef dummy_tree_image_dict(shape: Tuple[int, int, int]) -> dict:\n data = np.random.random_sample(size=shape).flatten()\n pack_format = f\"{len(data)... | [
[
"numpy.random.random_sample"
]
] |
vanthaiunghoa/ourBlock | [
"c106ddc030707c91af1e4ceff6b3a6086f727d8d"
] | [
"classification/tflearn-stuff/run-prediction.py"
] | [
"# restore all of our data structures\nimport pickle\nimport nltk\nfrom nltk.stem.lancaster import LancasterStemmer\nstemmer = LancasterStemmer()\n\n# things we need for Tensorflow\nimport numpy as np\nimport tflearn\nimport tensorflow as tf\nimport random\n\ndata = pickle.load( open( \"training_data\", \"rb\" ) )\... | [
[
"numpy.array"
]
] |
ArashAhmadian/AirTrafficSTGCN | [
"ae705d14f6aace31633bd26cfd69b227c6596fe0"
] | [
"STGCN/models/base_model.py"
] | [
"# @Time : Jan. 12, 2019 19:01\n# @Author : Veritas YIN\n# @FileName : base_model.py\n# @Version : 1.0\n# @IDE : PyCharm\n# @Github : https://github.com/VeritasYin/Project_Orion\n\nfrom models.layers import *\nfrom os.path import join as pjoin\nimport tensorflow as tf\nimport sys\n\n\ndef build_model(... | [
[
"tensorflow.train.Saver",
"tensorflow.nn.l2_loss",
"tensorflow.add_to_collection",
"tensorflow.losses.mean_squared_error"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.