repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
billgoo/Rutgers-CS527-Database-Systems-for-Data-Science-Information | [
"13994f4139ba22dd0ed5b84b35d3240d1e1c06f3"
] | [
"Assignment/4 MongoDB assignment/MongoDB_assignment_Group5/transpose.py"
] | [
"import pandas as pd\n\nfile=open('C:\\\\Users\\\\95236\\\\Desktop\\\\MongoDB_assignment_Group5\\\\GSE13355_expr_transpose.csv','w')\n\ndf = pd.read_csv('C:\\\\Users\\\\95236\\\\Desktop\\\\MongoDB_assignment_Group5\\\\GSE13355_expr.csv',header= None)\ndata = df.values\n# data = df.as_matrix()\ndata = list(map(list,... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
cristianopris/tf-models | [
"b7dd462d553d868dfe446b3d6d467935333647d3"
] | [
"official/transformer/translate.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.data.Dataset.from_tensors",
"tensorflow.TensorShape",
"tensorflow.estimator.Estimator",
"tensorflow.gfile.Open",
"tensorflow.gfile.Exists",
"tensorflow.logging.warn",
"tensorflow.logging.info",
"tensorflow.logging.set_verbosity",
"tensorflow.gfile.IsDirectory"
]
] |
leelew/AttConvLSTM | [
"62f614efa8654125014e3e31efd309a946f23b6c"
] | [
"plot/figure12.py"
] | [
"import sys\nsys.path.append('../')\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.basemap import Basemap\nplt.rc('font', family='Times New Roman')\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score\nimport matplotlib.colors as mcolors\n\nfrom figure11 import g... | [
[
"numpy.nanpercentile",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.savefig",
"numpy.full",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.subplots_adjust",
"numpy.load",
"matplotlib.pyplot.text",
"matplo... |
nukui-s/mlens | [
"4133c6f6654dd785399bb068c6a6ac727a88bb92"
] | [
"mlens/ensemble/tests/test_a_sklearn.py"
] | [
"\"\"\"\nTest Scikit-learn\n\"\"\"\nimport numpy as np\nfrom mlens.ensemble import SuperLearner, Subsemble, BlendEnsemble\nfrom mlens.testing.dummy import return_pickled\ntry:\n from sklearn.utils.estimator_checks import check_estimator\n from sklearn.linear_model import Lasso, LinearRegression\n from skle... | [
[
"sklearn.ensemble.RandomForestRegressor",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.ensemble.GradientBoostingRegressor",
"sklearn.neighbors.KNeighborsRegressor",
"sklearn.linear_model.Lasso",
"sklearn.svm.SVR",
"numpy.testing.assert_array_equal",
"sklearn.linear_model.Li... |
guodashun/soft-catching | [
"ffe876ab57eed053427d9719aaf7dbe8f6ad9aa6"
] | [
"utils.py"
] | [
"import numpy as np\nfrom scipy.spatial.transform import Rotation as R\n\ndef quat2rotvec(quat):\n r = R.from_quat(quat)\n return r.as_rotvec()\n\ndef quat2matrix(quat):\n r = R.from_quat(quat)\n return r.as_matrix()\n\ndef rotvec2quat(vec):\n r = R.from_rotvec(vec)\n return r.as_quat()\n\n# def q... | [
[
"numpy.linalg.inv",
"scipy.spatial.transform.Rotation.from_rotvec",
"scipy.spatial.transform.Rotation.from_quat"
]
] |
zachlewis/aces-dev | [
"596dfaf71f858a5b1210f7823c83552cee02842f"
] | [
"transforms/python/ssts_sliderPlot.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.widgets import Slider, Button\nfrom ssts import ssts, TsPoint\nfrom math import log10, log\n\ndef aces2stops( aces):\n return np.log2(aces)-np.log2(0.18)\n\nhgt = 0.04\nwdt = 0.23\nhspc = 0.1\nledge = 0.05\n\nfig, ax = plt.subplots( figsize=(1... | [
[
"numpy.log2",
"matplotlib.widgets.Button",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"matplotlib.widgets.Slider",
"numpy.log10",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axi... |
ilyakava/sumproduct | [
"4a58e12d8ed1dc9b9706649c1d751b182e5199c9"
] | [
"sumproduct.py"
] | [
"import numpy as np\n\n\nclass Node:\n def __init__(self, name):\n self.connections = []\n self.inbox = {} # messages recieved\n self.name = name\n\n def append(self, to_node):\n \"\"\"\n Mutates the to AND from node!\n \"\"\"\n self.connections.append(to_node)\n ... | [
[
"numpy.log",
"numpy.absolute",
"numpy.squeeze",
"numpy.nan_to_num",
"numpy.ones",
"numpy.max",
"numpy.delete",
"numpy.ndindex",
"numpy.exp",
"numpy.zeros"
]
] |
imsb-uke/ecarenet | [
"ffbf24e740d9154312d02b9f775816ed4b3d4691"
] | [
"unittests/unittest_helpers.py"
] | [
"import tensorflow as tf\nimport os\n\n\ndef get_data_directory(examples='color'):\n if 'color' in examples:\n e = 'example_colors'\n elif 'circle' in examples:\n e = 'example_circles'\n directory = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..', 'unittest_data', e))\n... | [
[
"tensorflow.cast",
"tensorflow.image.decode_image",
"tensorflow.image.resize"
]
] |
kamilc/fiftyone | [
"031de565cfd1a6ce234920515138362884800cf6"
] | [
"fiftyone/utils/cvat.py"
] | [
"\"\"\"\nUtilities for working with datasets in\n`CVAT format <https://github.com/opencv/cvat>`_.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nfrom collections import defaultdict\nfrom copy import copy, deepcopy\nfrom datetime import datetime\nimport itertools\nimport... | [
[
"numpy.reshape",
"numpy.subtract",
"numpy.sqrt",
"numpy.asarray"
]
] |
lindenmp/NormativeNeuroDev_CrossSec | [
"f5a05dd869b9190e52620db70953e1cdf5150d7d"
] | [
"code/results_s1.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Results, section 1:\n\n# In[1]:\n\n\nimport os, sys\nimport pandas as pd\nimport numpy as np\nimport scipy as sp\nfrom scipy import stats\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n# In[2]:\n\n\nsys.path.append('/Users/lindenmp/Dropbox/Work/ResProject... | [
[
"pandas.concat",
"numpy.logical_and",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.image.imread",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show"
]
] |
RuslanAgishev/crazyflie_ros | [
"892426ce70cdb4708dacd1933877a6e8f66c9286",
"892426ce70cdb4708dacd1933877a6e8f66c9286"
] | [
"crazyflie_demo/scripts/adaptive_formation_control/gradient_interactive.py",
"crazyflie_demo/scripts/imp_cargo.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nfrom numpy.linalg import norm\nimport matplotlib.pyplot as plt\nfrom matplotlib import collections\nfrom scipy.ndimage.morphology import distance_transform_edt as bwdist\nfrom math import *\nimport random\nfrom impedance_modeles import *\nimport time\n\nfrom progress.ba... | [
[
"numpy.dot",
"matplotlib.pyplot.plot",
"numpy.roll",
"numpy.arange",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.append",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"scipy.ndim... |
Huzzi-Aliaas/Internship_HB2021 | [
"f33bbc1fcee22b54b55d94eba166c9e409e103f9"
] | [
"results/numExp00_NSE/main_NSE_test.py"
] | [
"import sys; sys.path.append('../../')\nimport numpy as np\nfrom gnse.solver import SolverBaseClass, SimpleSplitStepSolver\nfrom gnse.tools import plot_evolution\nfrom gnse.config import FTFREQ\n\n\ndef main():\n # -- SET PARAMETERS FOR COMPUTATIONAL DOMAIN\n tMax = 40.0 # (fs) bound for time mesh\n Nt = ... | [
[
"numpy.sqrt",
"numpy.exp",
"numpy.cosh",
"numpy.linspace"
]
] |
robotics-4-all/tektrain-robot-sw | [
"3a420f1c47e1cdcca76361c0a921a678f31e1ec1"
] | [
"pidevices/sensors/sharp_gp20axxx0f.py"
] | [
"from ..exceptions import OutOfRange\nfrom .distance_sensor import DistanceSensor\nfrom scipy import interpolate\nimport numpy\nimport time\n\n\nclass GP2Y0AxxxK0F(DistanceSensor):\n \"\"\"Sharp gp2y0axxxk0f family of ir distance sensors extends \n :class:`DistanceSensor`.\n \n Args:\n datasheet_... | [
[
"numpy.array",
"scipy.interpolate.interp1d"
]
] |
qhduan/zhtts | [
"25d707a8496920055b21e0514e138b728f34d3be"
] | [
"app.py"
] | [
"\nfrom zhtts import TTS\n\ntts = TTS()\n\nimport io\nimport time\nfrom pathlib import Path\nimport scipy\nfrom scipy.io import wavfile\n\nfrom flask import Flask, Response, render_template, request\n# from flask_cors import CORS\n\napp = Flask(\"zhtts\")\n# CORS(app)\n\n@app.route(\"/api/tts\")\ndef api_tts():\n ... | [
[
"scipy.io.wavfile.write"
]
] |
SiyanZhou97/VAE | [
"6e19f9dc865155f45554a462f4599f7ebc6a40db"
] | [
"autoencodercmp/model_eval.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.decomposition import FactorAnalysis, PCA\nimport tensorly as tl\nfrom tensorly import unfold as tl_unfold\nfrom tensorly.decomposition import parafac,non_negative_parafac\nfrom sklearn.preprocessing import scale\nfrom sklearn.... | [
[
"numpy.isnan",
"tensorflow.keras.losses.MeanSquaredError"
]
] |
drawsky/tensorflow1 | [
"152a180c64a9142294ca634a0a4c241e0e436fb0"
] | [
"tensorflow/contrib/autograph/impl/api.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.autograph.pyct.compiler.ast_to_object",
"tensorflow.python.util.tf_inspect.getcallargs",
"tensorflow.python.util.tf_inspect.ismethod",
"tensorflow.python.util.tf_inspect.isclass",
"tensorflow.contrib.autograph.pyct.inspect_utils.getnamespace",
"tensorflow.contrib.autogr... |
rastringer/trax | [
"80f80f0e5c99966942e72942463880731dc9fbf2"
] | [
"trax/data/text_encoder.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... | [
[
"tensorflow.write_file",
"tensorflow.Graph",
"tensorflow.constant",
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.GFile",
"numpy.squeeze",
"tensorflow.reshape",
"numpy.full",
"tensorflow.image.encode_png",
"matplotlib.image.imread",
"tensorflow.Session"
]
] |
alowet/spikeextractors | [
"3e5a175a5523a3eb3578f96b0fffebee54108d9f"
] | [
"spikeextractors/extractors/intanrecordingextractor/intanrecordingextractor.py"
] | [
"from spikeextractors import RecordingExtractor\nfrom spikeextractors.extraction_tools import check_get_traces_args, check_get_ttl_args\nimport numpy as np\nfrom pathlib import Path\nfrom distutils.version import StrictVersion\n\ntry:\n import pyintan\n if StrictVersion(pyintan.__version__) >= '0.2.1':\n ... | [
[
"numpy.sign",
"numpy.where",
"numpy.unique"
]
] |
Attolab/pymodaq_femto | [
"2f63132c0e9097c92c33db9bce6e2f168009c744"
] | [
"src/pymodaq_femto/simulation.py"
] | [
"from PyQt5.QtCore import QObject\nfrom PyQt5 import QtWidgets\n\nfrom pathlib import Path\nfrom pyqtgraph.parametertree import Parameter, ParameterTree\nfrom pymodaq.daq_utils.parameter import pymodaq_ptypes\nfrom pypret.frequencies import om2wl, wl2om, convert\nfrom pypret import FourierTransform, Pulse, PNPS, li... | [
[
"numpy.log",
"numpy.maximum",
"numpy.min",
"numpy.genfromtxt",
"numpy.max",
"numpy.zeros_like",
"numpy.interp",
"numpy.exp"
]
] |
DarioHett/entsoe-client | [
"bb424fa54966d3be49daa1edb9e0fd40ed00ac15"
] | [
"entsoe_client/Parsers/Parser.py"
] | [
"from io import BytesIO\nfrom typing import List\nfrom zipfile import ZipFile\n\nimport pandas as pd\nimport requests\nfrom lxml import etree, objectify\n\nfrom entsoe_client.Parsers.Balacing_MarketDocument_Parser import (\n Balancing_MarketDocument_Parser,\n Balancing_MarketDocument_FinancialExpensesAndIncom... | [
[
"pandas.concat"
]
] |
ProtikAcharjay/Python-ML | [
"27b4a010c463c13e42ac8109bfa587fc5fd15374"
] | [
"Mean_Median_Mode.py"
] | [
"import numpy\r\nimport statistics\r\n\r\ndataset1= [1,3,8,9,11,15,17]\r\n\r\n#Mean\r\nmean1= numpy.mean(dataset1)\r\nprint(\"Mean using numpy: \", mean1)\r\nmean2= statistics.mean(dataset1)\r\nprint(\"Mean using statistics: \", mean2)\r\n\r\n#Median\r\nmedian1= numpy.median(dataset1)\r\nprint(\"Median using numpy:... | [
[
"numpy.median",
"numpy.mean"
]
] |
frzfrsfra4/phylanx | [
"001fe7081f3a24e56157cdb21b2d126b8953ff5d"
] | [
"tests/unit/python/execution_tree/parallel.py"
] | [
"# Copyright (c) 2017-2018 Hartmut Kaiser\n# Copyright (c) 2018 Steven R. Brandt\n# Copyright (c) 2018 R. Tohid\n#\n# Distributed under the Boost Software License, Version 1.0. (See accompanying\n# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n\nimport numpy as np\nfrom phylanx import ... | [
[
"numpy.zeros"
]
] |
Mnsy-Syl/new_20201103 | [
"9ee39f1c69a4cba896b30f007560fcbe8ac89c02"
] | [
"networks/deeplab_xception.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\n\n\n\nclass SeparableConv2d(nn.Module):\n def __init__(self, inplanes, planes, kernel_size=3, stride=1, padding=0, dilation=1, bias=False):\n super(SeparableConv2d, self).__init__... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.no_grad",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url",
"torch.nn.functional.pad",
"torch.nn.init.kaiming_normal_"
]
] |
Sleepychord/cogdata | [
"529892512b11bac3e765490e46876bea88c14179"
] | [
"cogdata/utils/cogview/vqvae_zc.py"
] | [
"import warnings\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n# import distributed as dist_fn\n\n# Copyright 2018 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 th... | [
[
"torch.nn.Sequential",
"torch.nn.init.calculate_gain",
"torch.empty_like",
"torch.nn.ConvTranspose2d",
"torch.zeros",
"torch.randn",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch._overrides.handle_torch_function",
"torch._overrides.has_torch_function",
"torch.log",
... |
x1155665/VGG16-Visualizer | [
"d2febaefb7cb5c0bf759880cf20a97141a8c5070"
] | [
"CNN_Vis_Demo_Model.py"
] | [
"import numpy as np\nfrom PyQt5.QtCore import Qt, pyqtSignal, QObject\nfrom PyQt5.QtGui import QPixmap\nimport os, sys\nimport cv2\nfrom enum import Enum\nimport time\nfrom Settings import Settings\n\n\n# TODO: Improve the notification mechanism between model and view\nclass CNN_Vis_Demo_Model(QObject):\n # Thes... | [
[
"numpy.expand_dims",
"numpy.loadtxt",
"numpy.transpose"
]
] |
hendrycks/error-detection | [
"276d605bfa9a9bd7701bd88937c537c3fcab94cf"
] | [
"ASR/CTC/CTC_eval.py"
] | [
"from tensorflow.python.ops import ctc_ops as ctc\n# from tensorflow.contrib.ctc import ctc_ops as ctc # depreciated in future\nimport tensorflow as tf\nimport numpy as np\nfrom utils import load_batched_data, target_list_to_sparse_tensor\nimport pickle\nimport sklearn.metrics as sk\nimport gc\n\n####Learning Par... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.sqrt",
"tensorflow.zeros",
"numpy.max",
"tensorflow.tanh",
"numpy.mean",
"tensorflow.python.ops.ctc_ops.ctc_loss",
"tensorflow.pack",
"tensorflow.Graph",
"tensorflow.Variable",
"tensorflow.gradients",
"numpy.std",
"tensorf... |
unicoooon/Image-Segmentation-for-Keras | [
"6906706b4c9e51152e4482ede1a29b63822660d6"
] | [
"model/deeplabv3p.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\nfrom keras.models import Model\nfrom keras import layers\nfrom keras.layers import Input\nfrom keras.layers import Activation\nfrom keras.layers import Concatenate\nfrom keras.lay... | [
[
"numpy.ceil"
]
] |
archanatikayatray/Learn-Discrete-Mathematics-1 | [
"9b180a7fba574b39f859c7e5a16def989d13d111"
] | [
"Chapter 5/TossingManyCoinsExample.py"
] | [
"# Import packages with the functions we need\nimport scipy.special\nimport matplotlib.pyplot as plt\n\nprobabilities = []\n\nfor n in range(51):\n # Calculate probability of n heads\n probability = scipy.special.binom(50, n) / (2 ** 50)\n\n # Convert to a string with 6 decimal places\n probString = \"{... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
saadlabyad/aslsd | [
"95a1cc660079972b45a77ec6dc587d9225489212"
] | [
"events/time_ordering.py"
] | [
"# License: BSD 3 clause\r\n\r\nimport bisect\r\nimport itertools\r\n\r\nimport numpy as np\r\n\r\n\r\ndef get_kappa_varpi(list_times, T_f):\r\n \"\"\"\r\n Compute the functions :math:`\\\\kappa` and :math:`\\\\varpi`, needed for\r\n chronological ordering of event times across dimensions, and return them ... | [
[
"numpy.arange",
"numpy.array"
]
] |
ady95/EfficientDet | [
"3f2fc8b9717ebd6e3cbf853dc4c28da3a4e1cdc6"
] | [
"generators/common.py"
] | [
"import numpy as np\nimport random\nimport warnings\nimport cv2\nfrom tensorflow import keras\n\nfrom utils.anchors import anchors_for_shape, anchor_targets_bbox, AnchorParameters\n\n\nclass Generator(keras.utils.Sequence):\n \"\"\"\n Abstract generator class.\n \"\"\"\n\n def __init__(\n sel... | [
[
"numpy.pad",
"numpy.clip",
"numpy.min",
"numpy.max",
"numpy.delete",
"numpy.array",
"numpy.where",
"numpy.zeros"
]
] |
trinh-hoang-hiep/iching | [
"e1feae5741c3cbde535d7a275b01d4f0cf9e21ed"
] | [
"fas/bktr/bktr_engine.py"
] | [
"#\r\nimport datetime as dt\r\nimport pandas as pd\r\nimport sys\r\nfrom fas.bktr.position import Position\r\nfrom fas.bktr.mean_reverting_strategy import MeanRevertingStrategy\r\nfrom fas.bktr.order import Order\r\nfrom fas.bktr.market_data import MarketData\r\nfrom fas.bktr.market_data_source import MarketDataSou... | [
[
"pandas.DataFrame"
]
] |
AlastairMelville/machine_learning | [
"a2bcb78de9b235faf49cabb1bd38bbed08b04f42"
] | [
"Experiments/FindSceneDepth.py"
] | [
"import numpy as np\r\nimport cv2\r\nfrom matplotlib import pyplot as plt\r\nfrom win32 import win32gui\r\nimport win32ui, win32con, win32api\r\n\r\n\r\n\r\ndef grab_screen(region=None):\r\n hwin = win32gui.GetDesktopWindow()\r\n if region:\r\n left,top,x2,y2 = region\r\n width = x2 - le... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.draw",
"numpy.fromstring",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ion"
]
] |
IntheGrass/citeomatic_learning | [
"b0fee3c2c9b6462e1878eb5aa3060bee8c86f923"
] | [
"tests/test_corpus.py"
] | [
"#!/usr/bin/env python\nimport json\nimport logging\nimport os\nimport random\nimport time\n\nimport numpy as np\n\nfrom citeomatic import features\nfrom citeomatic.common import FieldNames\nfrom citeomatic.corpus import Corpus\n\n\ndef _time(op):\n st = time.time()\n r = op()\n ed = time.time()\n print... | [
[
"numpy.all",
"numpy.max",
"numpy.unique"
]
] |
denred0/pytorchvideo | [
"366138bc36e636816e28a4204d9c2c38285128c1"
] | [
"pytorchvideo/transforms/functional.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport math\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\n\n\ntry:\n import cv2\nexcept ImportError:\n _HAS_CV2 = False\nelse:\n _HAS_CV2 = True\n\n\ndef uniform_temporal_subsample(\n x: torch.Tensor, num_sample... | [
[
"torch.linspace",
"numpy.expand_dims",
"torch.max",
"torch.full",
"numpy.ascontiguousarray",
"torch.nn.functional.interpolate",
"torch.clamp",
"torch.index_select"
]
] |
james-s-willis/kotekan | [
"155e874bb039702cec72c1785362a017548aa00a"
] | [
"tests/test_replacevis.py"
] | [
"# === Start Python 2/3 compatibility\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nfrom future.builtins import * # noqa pylint: disable=W0401, W0614\nfrom future.builtins.disabled import * # noqa pylint: disable=W0401, W0614\n\n# === End Python 2/3 compatibility\n\nimport... | [
[
"numpy.arange",
"numpy.array"
]
] |
green-cabbage/dilepton_transformer | [
"d8a74630386040b97dccc57c0cbe17f43bbd4fea"
] | [
"DileptonMLInput.py"
] | [
"#!/usr/bin/env python\n\"\"\"\ntaken from \nhttps://github.com/jthiema/Dilepton_PyROOT\nauthor: Jason Thema\n\"\"\"\nimport ROOT\nimport math\nimport numpy as np\n\ndef deltaPhi(phi1, phi2):\n dphi = phi1 - phi2\n if dphi > math.pi:\n dphi = dphi - 2*math.pi \n if dphi < -math.pi:\n d... | [
[
"numpy.vstack",
"numpy.save",
"numpy.zeros",
"numpy.empty"
]
] |
Beckschen/TransMix | [
"cda9c7657d73dc8d2abfbd92054a8fae448aac19"
] | [
"transmix.py"
] | [
"import torch\nimport torch.nn as nn\nimport math\nfrom timm.data.mixup import Mixup, cutmix_bbox_and_lam, one_hot\n\ndef mixup_target(target, num_classes, lam=1., smoothing=0.0, device='cuda', return_y1y2=False):\n off_value = smoothing / num_classes\n on_value = 1. - smoothing + off_value\n y1 = one_hot(... | [
[
"torch.sum",
"torch.zeros"
]
] |
JasonGUTU/EasySR | [
"6662d03b7499382b45feb481a1139de10d4e9049"
] | [
"srdata/data_utils.py"
] | [
"import os\nfrom PIL import Image\nimport torchvision\nimport cv2\nimport numpy as np\nimport torch\nimport pickle\n\nIMG_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.ppm', '.bmp', '.pgm']\n\n\ndef mkdir(path):\n if not os.path.exists(path):\n os.makedirs(path)\n\n\ndef pil_loader(path, mode='RGB'):\n \"\"... | [
[
"numpy.frombuffer",
"numpy.dot",
"numpy.expand_dims",
"numpy.transpose"
]
] |
kavehmahdavi/KAVICA | [
"226860d2a6c5b949e3b69e7121d92bc01b6ed3c8"
] | [
"kavica/feature_selector/feature_analysis.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nFeature selection by leverage of Feature Analysis that include PFA and IFA.\n\n------------------------------------------------------------------------------------------------------------------------\n References:\n - Y. Lu, I. Cohen, XS. Zhou, and Q. Ti... | [
[
"pandas.read_csv",
"pandas.notnull",
"sklearn.cluster.KMeans",
"sklearn.decomposition.FastICA",
"pandas.DataFrame",
"sklearn.preprocessing.scale",
"scipy.cluster.hierarchy.linkage",
"sklearn.cluster.AgglomerativeClustering",
"numpy.array"
]
] |
scottcohn97/labor_empirical_pset | [
"81785b834e6c2001d525dc1b9d7da8675dd281bd"
] | [
"ipums_clean.py"
] | [
"import pandas as pd\nimport numpy as np\n\n# load data\nipums = pd.read_csv(\"data/ipums_FL_raw.csv\")\n\n# Map the lowering function to all column names\nipums.columns = map(str.lower, ipums.columns)\n\n# recode sex\nipums['sex'] = ipums['sex'].map(lambda x: \"male\" if x == 1 else \"female\")\nipums['female'] = ... | [
[
"numpy.errstate",
"pandas.read_csv",
"numpy.where"
]
] |
badulion/code-2021-soilnet | [
"2a20f30707a7d9d121c32a18eb72e04895d7b458"
] | [
"utils/geometric_median.py"
] | [
"\nimport numpy as np\nfrom scipy.optimize import minimize\nfrom scipy.spatial.distance import cdist\n\n\ndef geometric_median(points, method='auto', options={}):\n \"\"\"\n Calculates the geometric median of an array of points.\n\n method specifies which algorithm to use:\n * 'auto' -- uses a heuri... | [
[
"numpy.asarray",
"numpy.where",
"scipy.optimize.minimize",
"scipy.spatial.distance.cdist"
]
] |
karthiksekaran/crypto-price-prediction | [
"04756eaa7f4d6f71ddffee277c9fcf0c3005a872"
] | [
"cryptocurrency-prediction.py"
] | [
"from keras.layers.core import Dense, Activation, Dropout\nfrom keras.layers.recurrent import LSTM\nfrom keras.layers import Bidirectional\nfrom keras.models import Sequential\nfrom tensorflow.contrib.keras.preprocessing.text import Tokenizer\n\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimpo... | [
[
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.reshape",
"matplotlib.pyplot.savefig",
"numpy.random.shuffle",
"matplotlib.pyplot.plot",
"numpy.zeros_like",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.empty",
"matplotlib.pyplot.y... |
VITA-Group/Ultra-Data-Efficient-GAN-Training | [
"11267b560a3a285582eae40d0bdcba87168f679f"
] | [
"SNGAN/train_with_masks_less.py"
] | [
"import cfg\nimport models\nimport datasets\nimport random\nfrom functions import train, validate, LinearLrDecay, load_params, copy_params\nfrom utils.utils import set_log_dir, save_checkpoint, create_logger\nfrom utils.inception_score import _init_inception\nfrom utils.fid_score import create_inception_graph, chec... | [
[
"numpy.random.seed",
"torch.cuda.manual_seed",
"torch.manual_seed",
"numpy.random.normal",
"torch.nn.utils.prune.custom_from_mask"
]
] |
luispedro/SemiBin_benchmark | [
"4b16a7076c803a4c0996d22ef6f8ab9fdbe79a64"
] | [
"benchmark/gen_kmer.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import print_function\nimport os\nimport numpy as np\nimport pandas as pd\nfrom itertools import product\nfrom Bio import SeqIO\n# optimized sliding window function from\n# http://stackoverflow.com/a/7636587\nfrom itertools import tee\nfrom collections import Counter, Ordered... | [
[
"numpy.array",
"pandas.DataFrame.from_dict"
]
] |
ajgallego/Mask_RCNN-Cleansea | [
"b0f79c0bac2206ada1e4416a4e41e192f60f5852"
] | [
"test.py"
] | [
"from audioop import add\nimport os\nimport sys\nfrom numpy import random\nimport math\nimport re\nimport time\nimport numpy as np\nimport cv2\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport json\nimport pandas as pd\nfrom PIL import Image, ImageDraw\nfrom tensorflow.python.framework.versions import VER... | [
[
"tensorflow.config.experimental.set_memory_growth",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.dstack",
"numpy.append",
"tensorflow.config.list_physical_devices",
"numpy.mean",
"sklearn.metrics.ConfusionMatrixDisplay.from_predictions",
"numpy.array",
"matplotl... |
douglasrizzo/ELF | [
"1f790173095cd910976d9f651b80beb872ec5d12"
] | [
"rlpytorch/methods/policy_gradient.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport math\nfrom ..args_provider ... | [
[
"torch.nn.NLLLoss",
"torch.autograd.Variable"
]
] |
philopon/datapane | [
"c440eaf07bd1c1f2de3ff952e0fd8c78d636aa8f"
] | [
"tests/resources/samples/dp_complex_report.py"
] | [
"\"\"\"datapane script\"\"\"\nimport altair as alt\nimport pandas as pd\nimport datapane as dp\nfrom bokeh.plotting import figure\nfrom pathlib import Path\nimport folium\nimport plotly.graph_objects as go\nfrom matplotlib.collections import EventCollection\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n... | [
[
"numpy.random.random",
"matplotlib.collections.EventCollection",
"numpy.random.seed",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.figure"
]
] |
Ema93sh/pytorch-saliency | [
"419cc0c0665d5764e9a721776615a61835e1be18"
] | [
"saliency/guided/saliency.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom saliency.saliency import Saliency\n\nclass GuidedSaliency(Saliency):\n \"\"\"Class for computing guided saliency\"\"\"\n def __init__(self, model):\n super(GuidedSaliency, self).__init__(model)\n\n\n def guided_relu_hook(self, module, grad_in, grad_out):\... | [
[
"torch.clamp",
"torch.zeros_like"
]
] |
tataudat/jax | [
"62862267e416ec4e053cca91a1376f1ac2ad7b72"
] | [
"jaxlib/cusolver.py"
] | [
"# Copyright 2019 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.issubdtype",
"numpy.dtype"
]
] |
paulaWesselmann/testing_pydial | [
"bf4fd0c99242e49d67895d92c6cfc3dc31084182"
] | [
"curiosity_module.py"
] | [
"###############################################################################\n# idea adapted from:\n# Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, Trevor Darrell\n# University of California, Berkeley\n# Curiosity-driven Exploration by Self-supervised Prediction\n\n# added by Paula\n##########################... | [
[
"tensorflow.get_collection_ref",
"tensorflow.global_variables_initializer",
"tensorflow.reset_default_graph",
"tensorflow.variable_scope",
"tensorflow.Session",
"tensorflow.train.AdamOptimizer",
"tensorflow.train.Saver"
]
] |
DanMitroshin/tensorflow | [
"74aa353842f1788bdb7506ecceaf6ba99140e165"
] | [
"tensorflow/python/data/experimental/kernel_tests/serialization/rebatch_dataset_serialization_test.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.python.data.kernel_tests.test_base.default_test_combinations",
"tensorflow.python.platform.test.main",
"tensorflow.python.data.ops.dataset_ops.Dataset.range"
]
] |
smrtnrd/001-BB-DL-ILI | [
"ee62f0351697ce93de809f9796d58890af7f9cda"
] | [
"src/models/model.3.py"
] | [
"import os, sys, errno\nimport warnings\n\nfrom math import sqrt\nimport numpy\n\nimport pydot\nimport graphviz\n\n# Take a look at the raw data :\nimport pandas as pd\nfrom pandas import DataFrame\nfrom pandas import read_csv\n\nfrom sklearn import preprocessing\nfrom sklearn.metrics import mean_squared_error\n\ni... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.use",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.close",
... |
JiaweiZhao-git/DASNet | [
"6097ba4a75cf928556434a1b7a81fc00e7c7c100"
] | [
"src/train.py"
] | [
"#!/usr/bin/python3\n# coding=utf-8\n\nimport sys\nimport datetime\nimport os\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = '0'\nsys.path.insert(0, '../')\nsys.dont_write_bytecode = True\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nimport dataset\nfro... | [
[
"torch.sigmoid",
"torch.max",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.utils.data.DataLoader",
"torch.log",
"torch.optim.SGD",
"torch.nn.MSELoss"
]
] |
goktuggokmen/cnn-registration-fixed | [
"eec6efa355bc5089f3d4909e4af75c27a907d481"
] | [
"src/demo.py"
] | [
"from __future__ import print_function\nimport Registration\nimport matplotlib.pyplot as plt\nfrom utils.utils import *\nimport cv2\n\n# designate image path here\nIX_path = '../img/1a.jpg'\nIY_path = '../img/1b.jpg'\n\nIX = cv2.imread(IX_path)\nIY = cv2.imread(IY_path)\n\n#initialize\nreg = Registration.CNN()\n#re... | [
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.title"
]
] |
MahmudulAlam/Object-Detection-Using-GPM | [
"52662eb9f8bf98fc8b2282bb8edd409a49e99bf9"
] | [
"draw.py"
] | [
"import cv2\nimport pickle\nimport numpy as np\nfrom flag import Flag\nimport tensorflow as tf\nfrom utils_draw import paint\nfrom utils.gaussian import pdf\nimport matplotlib.pyplot as plt\n\nflag = Flag()\n\nwith open('label.txt', 'r') as f:\n classes = f.readlines()\n\nwith open('assets/colors.h5', 'rb') as f... | [
[
"tensorflow.reduce_max",
"tensorflow.range",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.axes",
"tensorflow.meshgrid",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
georgios-ts/toqito | [
"d9379fb267a8e77784b97820c3131522d384f54d"
] | [
"toqito/matrix_props/is_diagonal.py"
] | [
"\"\"\"Is matrix a diagonal matrix.\"\"\"\nimport numpy as np\nfrom toqito.matrix_props import is_square\n\n\ndef is_diagonal(mat: np.ndarray) -> bool:\n r\"\"\"\n Determine if a matrix is diagonal [WikDiag]_.\n\n A matrix is diagonal if the matrix is square and if the diagonal of the matrix is non-zero,\n... | [
[
"numpy.any"
]
] |
RLGraph/RLGraph | [
"428fc136a9a075f29a397495b4226a491a287be2",
"428fc136a9a075f29a397495b4226a491a287be2",
"428fc136a9a075f29a397495b4226a491a287be2",
"428fc136a9a075f29a397495b4226a491a287be2"
] | [
"rlgraph/tests/agent_learning/long_tasks/test_impala_agent_long_task_learning.py",
"rlgraph/tests/components/test_string_layers.py",
"rlgraph/tests/components/test_ppo_loss_functions.py",
"rlgraph/tests/component_test.py"
] | [
"# Copyright 2018/2019 The RLgraph 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.mean"
],
[
"numpy.array"
],
[
"numpy.expand_dims",
"numpy.minimum",
"numpy.clip",
"numpy.squeeze",
"numpy.array",
"numpy.exp"
],
[
"numpy.random.seed"
]
] |
jshannon-usbr/usbr_temperature_ann | [
"b630b8bde17ae07329df1bba6df21690a372bc56"
] | [
"__models/HEC5Q/HEC5Q/HEC5Q.py"
] | [
"r\"\"\"\nSummary\n-------\nThis Python module executes the Simulation Protocols outlined by David\nJulian/CH2M HILL, dated 2015-05-26. The following Temperature Model Simulation\nProtocols, with a common directory of ./_Tools/HEC5Q_Toolkit, were delivered to\nReclamation on 2016-01-13:\n - American_River/HEC5Q_... | [
[
"pandas.DataFrame",
"pandas.date_range"
]
] |
johnzero7/blender-plugin | [
"e8448b0ef7d4d64d75db5b262511f2e2bf9b7ef4"
] | [
"addons/io_sketchfab_plugin/blender/imp/gltf2_blender_mesh.py"
] | [
"# Copyright 2018-2021 The glTF-Blender-IO 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.trunc",
"numpy.unique",
"numpy.power",
"numpy.arange",
"numpy.divide",
"numpy.linalg.norm",
"numpy.dtype",
"numpy.full",
"numpy.concatenate",
"numpy.logical_or",
"numpy.zeros",
"numpy.repeat",
"numpy.array",
"numpy.where",
"numpy.sum",
"numpy.... |
LucasFDutra/engenharia-eletrica | [
"33e21910aea4b2a839dd374ab493fb89a80edfb8"
] | [
"Algoritmo Multi-Agente Aplicado a Entrega e Coleta de Objetos/traveling_Q.py"
] | [
"import numpy as np\n\ndef traveling_Q(Q_, sequences, dim_env, n_repositories, n_agents):\n Q = Q_.copy()\n states_x = np.arange(n_agents, dtype = int)\n states_y = np.zeros(n_agents, dtype = int)\n\n steps = [states_x]\n\n for choice_order in sequences:\n for i in choice_order:\n i... | [
[
"numpy.arange",
"numpy.max",
"numpy.zeros",
"numpy.random.choice"
]
] |
Irvinfaith/numpy_neural_network | [
"46c86884611d0174e6ab96eb70d1f4ebec8caafb"
] | [
"core/optimizer.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2020/12/22 13:04\n\n@author: Irvinfaith\n\n@email: Irvinfaith@hotmail.com\n\"\"\"\nimport numpy as np\n\n\nclass Optimizer:\n def __init__(self):\n pass\n\n def update_target(self, *args, **kwargs):\n pass\n\n\nclass SGD(Optimizer):\n def __init__(... | [
[
"numpy.linalg.norm",
"numpy.sqrt",
"numpy.power"
]
] |
reillysiemens/resolving-a-dns-issue | [
"0772b173f63836a8281887389dadf718a400dd54"
] | [
"chart.py"
] | [
"#!/usr/bin/env python3.6\n\nimport sys\nfrom typing import Iterator\n\nimport pandas as pd\nfrom pygal import Line\nfrom pygal.style import Style\n\n\nclass GruvboxStyle(Style):\n \"\"\" A gruvbox-inspired Pygal style. \"\"\"\n\n background = '#282828'\n plot_background = '#1d2021'\n foreground = '#fdf... | [
[
"pandas.read_csv"
]
] |
JesterOrNot/python_calc | [
"3e939046930eca2204f8354d9f221f6127d2db91"
] | [
"algeb/graph/graphQuadMod.py"
] | [
"import numpy as np\nimport numpy\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport matplotlib.axis\nfrom sympy import *\n\n\ndef standard():\n a = input(\"What is a?: \")\n b = input(\"What is b?: \")\n c = input(\"What is c?: \")\n formula = '{}*x**2 + {}*x + {}'.for... | [
[
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.axvline",
"numpy.linspace",
"matplotlib.use",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.show"
]
] |
jessiesrr/VTdyn | [
"6f71ef94525d95221f5bd5e5290f4df10648cd18"
] | [
"run_files/ddalpharun/multirun_mutant.py"
] | [
"from multiprocessing import Process,Pool,Lock #parallel processing\nimport multiprocessing as mp\nfrom itertools import repeat\nfrom functools import partial\nimport sys\n\nimport os\nimport numpy as np\nimport libs.run_lib as lib\nimport libs.data as data\nimport libs.plot as vplt\n\nrand = np.random.RandomState... | [
[
"numpy.random.RandomState",
"numpy.where",
"numpy.sqrt"
]
] |
aliostad/hexagon-rl | [
"cd4180bda26f92c0bde11a08aa13c825cd151a10"
] | [
"dqn_centaur_ai_gym.py"
] | [
"from keras.layers import Flatten, Conv2D, Dense, Activation\nfrom keras.optimizers import Adam\nfrom keras import Sequential\nfrom rl.agents import DQNAgent, CEMAgent\nfrom rl.memory import SequentialMemory, EpisodeParameterMemory\nfrom rl.policy import EpsGreedyQPolicy\n\n\nfrom hexagon_agent import *\nfrom rando... | [
[
"numpy.random.seed",
"numpy.reshape",
"numpy.copy",
"numpy.argmax",
"numpy.random.uniform"
]
] |
bingqingchen/PROF | [
"be7f77f606d8c7d6505d4b2bad2d09760e9bafe9"
] | [
"utils/network.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.utils.data as data\nimport numpy as np\n \n# Implement a vanilla MLP here\nclass MLP(nn.Module):\n def __init__(self, input_size, hiddens, output_size):\n super(MLP, self).__init__()\n self.n_layers = len(hiddens)\n self.layers = []\n ... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.ReLU",
"torch.nn.LSTM"
]
] |
AIIP-DEV/pycaret | [
"0e09cd065f5927f120d7c8a9356f95974bfaea01"
] | [
"pycaret/internal/pipeline.py"
] | [
"# Module: internal.pipeline\n# Author: Antoni Baum (Yard1) <antoni.baum@protonmail.com>\n# License: MIT\n\n# Provides a Pipeline supporting partial_fit (needed for tune warm start)\n# and copying over fit attributes from the final estimator, so that it can be plotted directly\n# and is considered fitted.\n\n# This... | [
[
"sklearn.base.clone",
"sklearn.utils.metaestimators.if_delegate_has_method"
]
] |
JelleAalbers/strax | [
"423225e9d07b62ac0c28a5e39d45dbf5e2f62b3d"
] | [
"strax/processing/peak_building.py"
] | [
"import numpy as np\nimport numba\n\nimport strax\nfrom strax import utils\nfrom strax.dtypes import peak_dtype, DIGITAL_SUM_WAVEFORM_CHANNEL\nexport, __all__ = strax.exporter()\n\n\n@export\n@utils.growing_result(dtype=peak_dtype(), chunk_size=int(1e4))\n@numba.jit(nopython=True, nogil=True, cache=True)\ndef find_... | [
[
"numpy.int8",
"numpy.ones",
"numpy.all",
"numpy.ceil",
"numpy.floor",
"numpy.zeros"
]
] |
piyushkrmaurya/pinn | [
"76fb07567d224d9381fc4e5957137feccf44e7eb"
] | [
"pinn/models.py"
] | [
"import numpy as np\r\n\r\nnp.random.seed(0)\r\n\r\n\r\nclass Model:\r\n def __init__(self):\r\n self.compiled = False\r\n\r\n def __call__(self):\r\n raise NotImplementedError\r\n\r\n def compile(self, optimizer, loss):\r\n self.optimizer = optimizer\r\n self.loss_object = loss... | [
[
"numpy.dot",
"numpy.array",
"numpy.sum",
"numpy.random.seed"
]
] |
aibhleog/Keck-Visiting-Scholar | [
"79205d94a97b4d452edae0599182f1e7c1bcd969"
] | [
"engineering_time/test_cross_correlations.py"
] | [
"#!/usr/bin/env python\n\nimport image_registration as ir # github.com/keflavich/image_registration\nimport astropy.io.fits as fits\nimport numpy as np\nd0 = fits.getdata('test.fits')\n\n# this test just makes sure that the cross_correlation_shifts is working\n# correctly for the MOSFIRE data\ndef test_cross_correl... | [
[
"numpy.zeros"
]
] |
cgosmeyer/photutils_plus | [
"9d97dc77c8df5302667b1aa6566df31c88467fbb"
] | [
"photutils_plus/phot_tools.py"
] | [
"\n\"\"\"\nModule for Python photomtery assisting functions.\n\nAuthor: \n\n C.M. Gosmeyer, March 2016\n\"\"\"\n\n\nimport getpass\nimport numpy as np\nimport os\nimport platform \nimport shutil\nimport socket\nimport time\n\nfrom astropy.io import ascii\nfrom astropy.io import fits\nfrom collections import Orde... | [
[
"numpy.ndarray.flatten",
"numpy.round",
"numpy.ceil",
"numpy.where",
"numpy.zeros"
]
] |
Seb-Good/haifa-net | [
"d16bc8a6317778cb459ab752fcbc679912567ef9"
] | [
"haifanet/networks/haifanet_v1.py"
] | [
"\"\"\"\nhaifanet_v1.py\n--------------\nThis module provides a class and methods for building a convolutional neural network with tensorflow.\nBy: Sebastian D. Goodfellow, Ph.D., 2018\n\"\"\"\n\n# Compatibility imports\nfrom __future__ import absolute_import, division, print_function\n\n# 3rd party imports\nimport... | [
[
"tensorflow.nn.relu",
"tensorflow.matmul",
"tensorflow.multiply",
"tensorflow.concat",
"tensorflow.get_variable",
"tensorflow.reduce_mean",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.placeholder",
"tensorflow.add",
"sklearn.metrics.f1_s... |
xpertdev/NeoFinRL | [
"e36958fd832c9ef972b0b6d742ebf5c4f4d14957"
] | [
"finrl_meta/data_processors/processor_tusharepro.py"
] | [
"\nfrom email.policy import default\nimport numpy as np\nimport pandas as pd\nimport tushare as ts\nfrom tqdm import tqdm\nfrom stockstats import StockDataFrame as Sdf\nimport stockstats\nfrom finrl_meta.data_processors.basic_processor import BasicProcessor\nfrom typing import List\nimport time\nimport copy\nimport... | [
[
"matplotlib.pyplot.legend",
"pandas.merge",
"pandas.to_datetime",
"pandas.concat",
"pandas.Series",
"matplotlib.pyplot.title",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
PaccMann/paccmann_polymer | [
"3b39536fcde2f71ff76f822849f094489907e58b"
] | [
"paccmann_polymer/topologically_regularized_models/experiments/cora/run_vae.py"
] | [
"\"\"\"Most of the code of this script has been adapted from the original repo\nof pytorch-geometric: \nhttps://github.com/rusty1s/pytorch_geometric/blob/master/examples/infomax.py\n\"\"\"\nimport os\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch_geometric.datasets import Planetoid\nfrom tor... | [
[
"numpy.isinf",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available"
]
] |
imsb-uke/podometric_u_net | [
"a33afcc186d618889df73c7ab2941dfbb63574ac"
] | [
"network/image_generator.py"
] | [
"import os\nimport numpy as np\nimport random\nfrom skimage.io import imread, imsave, imshow, show\nfrom skimage.transform import resize, rescale, rotate, warp, SimilarityTransform\nfrom skimage.exposure import rescale_intensity, equalize_hist\nfrom skimage.util import crop\nimport time\n\nfrom network.dataset.imag... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.expand_dims",
"numpy.random.choice"
]
] |
ArtistVan1/Robot_control | [
"ab942c4774dba9bd874811e954b2ff0251233e4a"
] | [
"test2.py"
] | [
"import matplotlib.pyplot as plt\r\nimport csv\r\nimport numpy as np\r\n\r\n\r\ndata = []\r\nwith open('C:\\\\Users\\\\ytjun\\\\Desktop\\\\kubo\\\\kubo\\\\data\\\\data0.csv','r') as csvfile:\r\n reader = csv.reader(csvfile)\r\n for row in reader:\r\n data.append(row)\r\ndatas = np.array(data,dtype=\"fl... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.imread",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show"
]
] |
Gopal-Dahale/deep-sym-math | [
"7618b1e667d0f392a92872490f7aadf520dfdf4a"
] | [
"deep_sym_math/lit_models/base.py"
] | [
"import pytorch_lightning as pl\nimport torch\nimport torchmetrics\nimport torch.nn.functional as F\n\nOPTIMIZER = \"Adam\"\nLR = 1e-4\nONE_CYCLE_TOTAL_STEPS = 100\n\n\nclass Accuracy(torchmetrics.Metric):\n \"\"\"Accuracy Metric with a hack.\"\"\"\n\n def __init__(self, dist_sync_on_step=False):\n sup... | [
[
"torch.optim.lr_scheduler.OneCycleLR",
"torch.zeros",
"torch.nn.functional.cross_entropy",
"torch.zeros_like",
"torch.ones_like"
]
] |
tulcod/PyBRML | [
"55357ef60e394d7146af037dbfcab97f7b29d44b"
] | [
"brml/ismember.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nsame as ismember() in MATLAB\ntf: TRUE or FALSE\nindex: the index for each A in B\nA[tf] == B[index]\n\"\"\"\nimport numpy as np\n\ndef ismember(a, b):\n #print(\"judge ismember......\")\n#FIXME: data format needed to be unified\n aa = a\n a = np.array(a)\n b = np.array... | [
[
"numpy.in1d",
"numpy.array",
"numpy.where",
"numpy.unique"
]
] |
franneck94/UdemyTF | [
"23d287b9f30ecb409a41f85f8154174c2a34ad03"
] | [
"Chapter5_DNN/Chapter5_3_MNISTClassification/mnistKerasOverUnderfitting.py"
] | [
"from typing import Tuple\n\nimport numpy as np\nfrom tensorflow.keras.datasets import mnist\nfrom tensorflow.keras.initializers import Constant\nfrom tensorflow.keras.initializers import TruncatedNormal\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.kera... | [
[
"tensorflow.keras.initializers.Constant",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.keras.initializers.TruncatedNormal",
"tensorflow.keras.models.Sequential",
... |
go-jugo/ml_event_prediction_trainer | [
"0d644b737afdef078ad5b6fc2b7e2549b964b56f"
] | [
"data_cleansing/one_hot_encode_categories.py"
] | [
"import pandas as pd\r\nimport dask.dataframe as dd\r\nfrom ..monitoring.time_it import timing\r\nfrom ..tools.dask_repartition import dask_repartition\r\nfrom ..logger import get_logger\r\n\r\nlogger = get_logger(__name__.split(\".\", 1)[-1])\r\n\r\n\r\n@timing\r\ndef one_hot_encode_categories(df, errorcode_col, v... | [
[
"pandas.concat"
]
] |
gcgs1/phonopy | [
"6a194a2d9514646b61a5f87168107d4c6b0d570d"
] | [
"test/phonopy/structure/test_cell.py"
] | [
"import unittest\n\nimport os\nimport numpy as np\nfrom phonopy.structure.atoms import PhonopyAtoms as Atoms\nfrom phonopy.structure.cells import get_supercell\nfrom phonopy.interface.phonopy_yaml import get_unitcell_from_phonopy_yaml\n\ndata_dir = os.path.dirname(os.path.abspath(__file__))\n\nclass TestSupercell(u... | [
[
"numpy.diag",
"numpy.rint",
"numpy.testing.assert_allclose"
]
] |
AnjaliRuban/babyai | [
"882feaa6e388ef2274ccebf0ec15c58966fc37ba"
] | [
"babyai/rl/algos/cpv_reward.py"
] | [
"import torch\nimport revtok\nimport numpy as np\nfrom torch import nn\nfrom vocab import Vocab\nimport matplotlib.pyplot as plt\nimport pdb\nfrom torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence\n\nclass CPV(nn.Module):\n def __init__(self, primed_model='models/cpv_model.pth'):\... | [
[
"torch.norm",
"torch.transpose",
"torch.full",
"torch.nn.LSTM",
"torch.load",
"torch.zeros",
"torch.sum",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.tensor",
"torch.nn.Linear",
"torch.no_grad",
"torch.split",
"torch.device"
]
] |
stefanh-it/pyaudiodsptools | [
"3836117b02b43acb14488d7c8b3718a270c527be"
] | [
"pyAudioDspTools/EffectEQ3BandFFT.py"
] | [
"import numpy\nfrom .config import chunk_size, sampling_rate\n#import matplotlib.pyplot as pyplot\n\n\n\"\"\"########################################################################################\nCreating a 3 Band FFT Equalizer class/device.\nInit Parameters: \n lowshelf_frequency: Shelving frequency in Hert... | [
[
"numpy.kaiser",
"numpy.fft.fft",
"numpy.arange",
"numpy.int16",
"numpy.concatenate",
"numpy.fft.ifft",
"numpy.zeros",
"numpy.sum"
]
] |
yisheng822/faiss | [
"e5fa6cf58b436450c129bf5724e26b45eae267c1"
] | [
"tests/test_fast_scan.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport unittest\nimport time\n\nimport numpy as np\nimport faiss\n\nfrom faiss.contrib import datasets\nimport platform\n\n\nclass... | [
[
"numpy.unique",
"numpy.testing.assert_array_equal",
"numpy.all",
"numpy.uint16",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.testing.assert_array_almost_equal"
]
] |
satvikshukla/ds-demo | [
"40f3d1c4d2b85df84ade5667aa05bea49641611a"
] | [
"plot.py"
] | [
"import time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom tqdm import trange\n\n\ndef get_data():\n df = pd.read_csv(\n 'https://query.data.world/s/ydtlqistcr56h7xx36ltobnvtsazvt')\n print(df.head())\n # print(df.describe())\n print(df.s... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"numpy.random.RandomState",
"matplotlib.pyplot... |
ThisIsPIRI/python-tools | [
"1dea3d44bd4259b02b2c7e78ca09e1b072711ece"
] | [
"randomImage.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport random\nimport struct\n\ndef writeImage(mat, width, height):\n\twriteAs = 'c'\n\twith open(\"test.ppm\", 'wb') as f:\n\t\tf.write(bytes(f\"P6\\n{width} {height}\\n255\\n\", 'utf-8'))\n\t\tfor i in np.nditer(mat, order='C'):\n\t\t\tf.write(struct.pack(writ... | [
[
"matplotlib.pyplot.imshow",
"numpy.nditer",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.close",
"numpy.transpose",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.pause",
"numpy.empty",
"matplotlib.pyplot.figure"
]
] |
izumiya-keisuke/pytorch-example | [
"3fa9a531bccc9ce95e0e0e8222de24ed1af35e34"
] | [
"pytorch_example/lightning/train.py"
] | [
"\"\"\"\nCopyright 2022 Keisuke Izumiya\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to ... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.functional.cross_entropy",
"torch.nn.Flatten",
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
TeamPMG/CuteGirlsGenerator-Organized- | [
"22c684ab144ec77c14b6860cb87ad4974d24f7c8"
] | [
"models/beta/model2web.py"
] | [
"import numpy as np\nimport chainer\nfrom chainer import Chain, Variable\nimport chainer.functions as F\nimport chainer.links as L\nfrom chainer import serializers,cuda\n\nimport math\nimport os\nimport glob\nimport pickle\nfrom PIL import Image\n\nNUMBER_OF_TAG = 1539\nxp = np\n\n#network\n\nclass EqualizedConv2d(... | [
[
"numpy.random.normal",
"numpy.zeros",
"numpy.sqrt"
]
] |
Singularity-AI/FasterRCNN | [
"6ade7f987b64a2f7f5307ea024d1e3e764628fda"
] | [
"lib/model/rpn/proposal_layer.py"
] | [
"from __future__ import absolute_import\n# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n# ---... | [
[
"numpy.arange",
"numpy.array",
"numpy.meshgrid",
"torch.sort"
]
] |
YQ-Wang/mlflow | [
"5508e6784afe0442705471bf4c10cd1ca13bafe3"
] | [
"tests/pyfunc/test_model_export_with_loader_module_and_data_path.py"
] | [
"import os\nimport pickle\nimport yaml\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport sklearn.datasets\nimport sklearn.linear_model\nimport sklearn.neighbors\n\nimport mlflow\nimport mlflow.pyfunc\nfrom mlflow.pyfunc import PyFuncModel\nimport mlflow.pyfunc.model\nimport mlflow.sklearn\nfrom mlfl... | [
[
"numpy.array_equal",
"numpy.ndarray",
"numpy.dtype",
"pandas.DataFrame",
"numpy.array"
]
] |
Sepidak/spikeGUI | [
"25ae60160308c0a34e7180f3e39a1c4dc6aad708"
] | [
"analysis_guis/threads/thread_workers.py"
] | [
"# module import\r\nimport gc\r\nimport os\r\nimport copy\r\nimport random\r\nimport platform\r\nimport numpy as np\r\nimport pickle as p\r\nimport pandas as pd\r\nimport multiprocessing as mp\r\nfrom numpy.matlib import repmat\r\n\r\n# scipy module imports\r\nfrom scipy.stats import norm, linregress\r\nfrom scipy.... | [
[
"scipy.stats.norm.ppf",
"numpy.polyfit",
"scipy.signal.find_peaks",
"numpy.sqrt",
"numpy.linspace",
"numpy.cumsum",
"pandas.DataFrame",
"numpy.all",
"numpy.max",
"numpy.concatenate",
"numpy.round",
"numpy.argmin",
"numpy.any",
"numpy.mean",
"numpy.nanmea... |
nilsmeyerkit/meshio | [
"51d30fbffadc91425d64417e2ee977ec04669e83"
] | [
"src/meshio/ply/_ply.py"
] | [
"\"\"\"\nI/O for the PLY format, cf.\n<https://en.wikipedia.org/wiki/PLY_(file_format)>.\n<https://web.archive.org/web/20161221115231/http://www.cs.virginia.edu/~gfx/Courses/2001/Advanced.spring.01/plylib/Ply.txt>.\n\"\"\"\nimport collections\nimport datetime\nimport re\nimport sys\nimport warnings\n\nimport numpy ... | [
[
"numpy.uint8",
"numpy.rec.fromarrays",
"numpy.dtype",
"numpy.genfromtxt",
"numpy.full",
"numpy.frombuffer",
"numpy.diff",
"numpy.column_stack",
"numpy.array"
]
] |
betefaber/tracking-simulator | [
"a53bdabce55cac617e45417ca54f8b51a34c2547"
] | [
"trackingsim/sim.py"
] | [
"import threading\nimport logging\nimport time\nimport json\nimport numpy as np\nimport paho.mqtt.client as mqtt\nfrom geopy import Point\nfrom geopy import distance\n\n\nclass Simulator:\n MIN_SLEEP_TIME = 2 # 2 second\n MAX_SLEEP_TIME = 10 # 10 seconds\n MIN_DISPLACEMENT = 0 # 0 Km\n MAX_D... | [
[
"numpy.random.uniform",
"numpy.random.normal"
]
] |
RikilG/Geometry-Algorithms | [
"7bdf25e425b93dc6955331a48980a4b4d8051a6d"
] | [
"DCEL/plot.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\nimport random\nimport argparse\nimport traceback\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import Polygon\n\nf, ax = plt.subplots()\n\ndef plotPoly(file):\n lines = []\n lines = file.readlines()\n n = int(lines[0].strip().split()[0].strip());\... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
obliviateandsurrender/namd2helper | [
"392403f0fca3a2a69913a866240e7f27d991c324"
] | [
"plotter.py"
] | [
"import matplotlib.pyplot as plt\nf = open('da_us.psf',\"r\")\na = f.read().split('#')[1]\na = a.split('\\n')[1:-1]\nx = []\ny = []\nfor i in a:\n b = i.split('\\t')\n x.append(float(b[0]))\n y.append(float(b[1]))\nplt.plot(x,y)\nplt.xlabel(\"Distance (A)\")\nplt.ylabel(\"Free Energy (kcal/mol)\")\nplt.sho... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
MartaYang/SEGA | [
"ad843b51508e87c0b181a01a397f12b13d5ccbbb"
] | [
"data/mini_imagenet.py"
] | [
"# Dataloader of Gidaris & Komodakis, CVPR 2018\r\n# Adapted from:\r\n# https://github.com/gidariss/FewShotWithoutForgetting/blob/master/dataloader.py\r\nfrom __future__ import print_function\r\n\r\nimport os\r\nimport os.path\r\nimport numpy as np\r\nimport random\r\nimport pickle\r\nimport json\r\nimport math\r\n... | [
[
"torch.LongTensor",
"numpy.random.seed",
"numpy.unique",
"numpy.asarray",
"numpy.concatenate",
"torch.stack"
]
] |
pyMatJ/pymeasure | [
"cf790b00e37bc574b356de4f7eaf9466ffa3710d"
] | [
"pymeasure/instruments/keithley/keithley2600.py"
] | [
"# This file is part of the PyMeasure package.\n#\n# Copyright (c) 2013-2020 PyMeasure Developers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including wi... | [
[
"numpy.linspace"
]
] |
bla1089/pandas | [
"9ea49653a621002f222f93edcbcbf5239d1afb2d"
] | [
"pandas/tests/reshape/test_tile.py"
] | [
"import os\nimport pytest\n\nimport numpy as np\nfrom pandas.compat import zip\n\nimport pandas as pd\nfrom pandas import (DataFrame, Series, isna, to_datetime, DatetimeIndex, Index,\n Timestamp, Interval, IntervalIndex, Categorical,\n cut, qcut, date_range, timedelta_range, Na... | [
[
"pandas.tseries.offsets.Day",
"pandas.to_datetime",
"pandas.Series",
"numpy.linspace",
"numpy.asarray",
"numpy.round",
"pandas.util.testing.assert_index_equal",
"numpy.random.randn",
"pandas.isna",
"pandas.util.testing.assert_numpy_array_equal",
"numpy.allclose",
"p... |
Zotkin/incremental_learning.pytorch | [
"6a0d7385d209abcd40a402dcad42293dd4e8b362"
] | [
"inclearn/lib/vizualization.py"
] | [
"import torch\n\n\ndef grad_cam(spatial_features, selected_logits):\n batch_size = spatial_features.shape[0]\n assert batch_size == len(selected_logits)\n\n formated_logits = [selected_logits[i] for i in range(batch_size)]\n\n import pdb\n pdb.set_trace()\n grads = torch.autograd.grad(\n fo... | [
[
"torch.autograd.grad"
]
] |
CMU-IDS-2021/fp--zixuc-jiajunb | [
"f2b751cc6c46f4fc8d8da822898c32b129d75992"
] | [
"app.py"
] | [
"import os\nimport math\nimport numpy as np\nimport pandas as pd\n\nimport streamlit as st\nimport altair as alt\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torchvision\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save_image\nfrom matplotlib import image\nfrom torch.auto... | [
[
"torch.LongTensor",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"matplotlib.image.imread",
"numpy.random.normal",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.figure"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.