repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
aethersoft/textkit-learn | [
"8b25b19d394fb361dde4427ed3b84d63552b7cc8"
] | [
"examples/neural_network/example_kim2014conv.py"
] | [
"from nltk import TweetTokenizer\nfrom sklearn.datasets import fetch_20newsgroups\nfrom sklearn.preprocessing import LabelBinarizer\n\nfrom tklearn import embedding\nfrom tklearn.datasets.base_alt import TextDataset\nfrom tklearn.neural_network.models import Kim2014ConvModel\nfrom tklearn.preprocessing import Tweet... | [
[
"sklearn.preprocessing.LabelBinarizer",
"sklearn.datasets.fetch_20newsgroups"
]
] |
happpyosu/reflection-enhancement-gan | [
"0622b98f37abe6dda53207327bc53ac3af56e862"
] | [
"utils/metricUtils.py"
] | [
"import numpy as np\nimport math\n\n\nclass MetricUtils:\n \"\"\"\n This class offers common utils for computing the image metrics.\n \"\"\"\n\n @staticmethod\n def compute_psnr(img1, img2):\n \"\"\"\n Compute the Peak Signal to Noise Ratio (PSNR).\n PSNR is a metric that determi... | [
[
"numpy.mean"
]
] |
poentes/PITrabalho1 | [
"5aca30dd956b3b33d7a0aa22119bbebf7cdbfde9"
] | [
"InterpolacaoBilinear.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*\n\nfrom PIL import Image\nimport numpy as np\n\nclass InterpolacaoBilinear():\n\n\tdef __init__(self, nome_imagem):\n\t\tself.nome_imagem = nome_imagem\n\t\tself.m = 0\n\t\tself.n = 0\n\t\tself.matriz = []\n\t\tself.img = []\n\n\t'''\n\tAbrindo o arquivo e pegando dim... | [
[
"numpy.size",
"numpy.zeros"
]
] |
guybuk/skorch | [
"0f186aea9da37a37860f1c447980d030c2506823"
] | [
"skorch/dataset.py"
] | [
"\"\"\"Contains custom skorch Dataset and CVSplit.\"\"\"\nimport warnings\nfrom functools import partial\nfrom numbers import Number\n\nimport numpy as np\nfrom scipy import sparse\nfrom sklearn.model_selection import ShuffleSplit\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.model_selection im... | [
[
"scipy.sparse.issparse",
"torch.Tensor",
"numpy.arange",
"sklearn.model_selection.check_cv",
"torch.utils.data.Subset"
]
] |
tanviroy/fed-ml | [
"1a5973b4fa731bbda120e5a0873106d680e69c7f"
] | [
"server.py"
] | [
"import socket\nimport json\nimport numpy as np\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tqdm import tqdm\n\n# instantiate server's socket\nserversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n\n# define address params\nIP = '127.0.0.1'\nPORT = 5005\n\n# bind server\nser... | [
[
"numpy.expand_dims",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dropout",
"numpy.array",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.utils.to_categorical"... |
frgfm/sdcnd-p3-traffic-sign-classification | [
"fe230e5b4c008ff711730370a20541f929a89bce"
] | [
"test/test_models.py"
] | [
"import unittest\nimport numpy as np\nfrom tensorflow.keras.models import Sequential\nfrom src.models import lenet5\n\n\nclass Tester(unittest.TestCase):\n\n def test_lenet5(self):\n\n # Create a model\n model = lenet5()\n self.assertIsInstance(model, Sequential)\n\n # Shape test\n ... | [
[
"numpy.all",
"numpy.random.rand"
]
] |
budmonde/redner | [
"a028ed011ac3bf916eb39a42ab8aa0a0453e1620"
] | [
"pyredner/shape.py"
] | [
"import pyredner\nimport torch\nimport math\n\ndef compute_vertex_normal(vertices, indices):\n def dot(v1, v2):\n return torch.sum(v1 * v2, dim = 1)\n def squared_length(v):\n return torch.sum(v * v, dim = 1)\n def length(v):\n return torch.sqrt(squared_length(v))\n # Nelson Max, \"... | [
[
"torch.sin",
"torch.zeros",
"torch.reshape",
"torch.sum",
"torch.cross"
]
] |
brandontan99/D2HC-RMVSNet | [
"c4615c2d7c212b9b247da6fc0e0e110344b1b0ce"
] | [
"datasets/data_eval_transform.py"
] | [
"from torch.utils.data import Dataset\nimport numpy as np\nimport os\nfrom PIL import Image\nfrom datasets.data_io import *\n\nfrom datasets.preprocess import *\n\n# Test any dataset with scale and center crop\n\nclass MVSDataset(Dataset):\n def __init__(self, datapath, listfile, mode, nviews, ndepths=192, inter... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.arange",
"numpy.matmul",
"numpy.stack",
"numpy.mean",
"numpy.var",
"numpy.array"
]
] |
johan12345/sunpy | [
"56e1ab0c2c992f99e0fe3e6bff468b731a51228c"
] | [
"examples/units_and_coordinates/planet_locations.py"
] | [
"\"\"\"\n===================================\nGetting the location of the planets\n===================================\n\nHow to get the position of planetary bodies im the solar system using\n`astropy's solar system ephemeris <http://docs.astropy.org/en/stable/coordinates/solarsystem.html#solar-system-ephemerides>... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
]
] |
liushuigs/jina | [
"b3550e901b2a340924330b5ba2801603e493c933"
] | [
"jina/drivers/predict.py"
] | [
"from typing import List, Any, Union, Tuple, Optional\n\nimport numpy as np\n\nfrom . import BaseExecutableDriver, FlatRecursiveMixin\nfrom ..helper import typename\n\nif False:\n from ..types.sets import DocumentSet\n\n\nclass BasePredictDriver(FlatRecursiveMixin, BaseExecutableDriver):\n \"\"\"Drivers inher... | [
[
"numpy.squeeze",
"numpy.argmax"
]
] |
kaayra2000/Robot_Operating_System | [
"a77964572abf4603734993fd3e8d33dfe5064920"
] | [
"mapping_tb3_node.py"
] | [
"#!/usr/bin/env python3\n\nimport rospy\nimport math\nimport numpy as np\nimport cv2 as cv\nfrom sensor_msgs.msg import LaserScan\ndef callback(data):\n\tprint(data.pose.pose.position.x)\n\t\ndef cb_scan(data):\n\tdizi=[]\n\tresim=np.zeros((360,360),dtype=np.uint8)\n\tfor i,cor in enumerate(data.ranges):\n\t\tif no... | [
[
"numpy.zeros"
]
] |
makermotion/turkish-asr | [
"05b7fe51f27c17bce2a392ffad1a6f34bc7ad0be"
] | [
"train_and_test.py"
] | [
"import json\nimport random\nimport torch\nimport torchaudio\nimport librosa\nimport pandas as pd\nimport numpy as np\n\nfrom IPython.display import display, HTML\n\nfrom datasets import ClassLabel, Audio\nfrom datasets import load_dataset, load_metric\nfrom dataclasses import dataclass, field\nfrom typing import A... | [
[
"numpy.asarray",
"numpy.argmax",
"pandas.DataFrame"
]
] |
Cameron30/ExtremeLearningMachine | [
"2a7e48755b9aad5416c8416358eb9b96549ab067"
] | [
"ELM.py"
] | [
"import numpy as np\n\nclass ELMNetwork():\n def __init__(self, numNeurons):\n #set number of hidden neurons\n self.numNeurons = numNeurons\n\n def sigmoid(self, x):\n return 1.0 / (1.0 + np.exp(-0.1 * x)) - 0.5\n\n def fit(self, X, trueVals):\n #combine into 2D array\n X... | [
[
"numpy.linalg.pinv",
"numpy.exp",
"numpy.random.randn",
"numpy.ones"
]
] |
AcerNoobchio/CSCI5957MachineLearningPhase1 | [
"a90d28b2013f4f94870efd2e160f57e6aac88069"
] | [
"classifier.py"
] | [
"import pandas as pd\nfrom ClassifierUtil import ClassifierUtil\nfrom FeatureUtil import FeatureUtil as Feature\nfrom FileReaderUtil import FileReader\nfrom SupportVector import SVM\nfrom LogisticRegression import LogReg\nfrom NeuralNetwork import NeuralNetwork as NN\nfrom GraphUtil import GraphUtil as Graph\nimpor... | [
[
"pandas.read_csv"
]
] |
SR42-dev/path-following-robot-color-detection-plus-gsheets-api-comms | [
"8b0c5d1f6d96091353ba69ff7b588b1af703e553"
] | [
"week2/testing_session1_draft/ballDetection1.py"
] | [
"# Ball following logic by bounding rectangle calculations\r\n\r\nimport cv2\r\nimport numpy as np\r\nimport serial\r\n\r\n#######################################################################################################################\r\n# Arduino communication\r\n###########################################... | [
[
"numpy.array",
"numpy.ones"
]
] |
pkoprov/Vibration_Patterns | [
"1b9d340065717839a55b45021d53c238b96174cb"
] | [
"analysis/signal_Analysis.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author: bstarly\n\n\"\"\"\n\nimport scipy\nimport matplotlib.pyplot as plt\nfrom scipy.fft import fft\nimport numpy as np\nimport pandas as pd\n\n\nsignal_length = 20 #[ seconds ]\n\ndef calc_euclidean(x, y):\n return np.sqrt(np.sum((x - y) ** 2))\n\ndef calc_mape(x,y):\n re... | [
[
"pandas.read_csv",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.figure"
]
] |
matajoh/fourier_feature_nets | [
"784140f01464e34a0dd4b813c50d20c4c15a8a59"
] | [
"figures/near_orbit.py"
] | [
"\"\"\"Produces images from a dataset near the orbit positions.\"\"\"\n\nimport argparse\n\nimport cv2\nimport fourier_feature_nets as ffn\nimport numpy as np\nimport scenepic as sp\n\n\ndef _parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"data_path\")\n parser.add_argument(\"mp4... | [
[
"numpy.square",
"numpy.load",
"numpy.stack"
]
] |
saransh738/ELL409-IMPLEMENTING-LINEAR-REGRESSION-FROM-SCRATCH | [
"7db452e6775650bfd003da8382ec40d3993b8e48"
] | [
"part2.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\n\r\n#Reading Csv file\r\ndata_points_train = pd.read_csv('train.csv', header=None, nrows=111)\r\n#converting the dataframe into a matrix\r\ntrain = np.array(data_points_train.values)[1:,:]\r\n\r\n#matrix to store values of month and ye... | [
[
"pandas.read_csv",
"numpy.matmul",
"numpy.subtract",
"numpy.cos",
"numpy.ones",
"numpy.sin",
"numpy.identity",
"numpy.transpose",
"numpy.ravel",
"numpy.array",
"numpy.sum"
]
] |
jakekali/LinearAlgebra | [
"8d572c5b55d25ed55eae7ba264c771be97e55c29"
] | [
"matrices/multiplyingMartices.py"
] | [
"import numpy as np\n\n\ndef martixMultiply(martix1, martix2):\n # check if the two martixs can be multiplied together\n\n if martix1.shape[1] != martix2.shape[0]:\n return bool(0)\n martix2 = np.swapaxes(martix2,0,1)\n\n vals = np.array([])\n for row1 in martix1:\n for col2 in martix2:... | [
[
"numpy.swapaxes",
"numpy.array",
"numpy.append"
]
] |
dl4fugaku/chainer | [
"34655eff5986522eae56f47fc82a8cc2b78e1617"
] | [
"chainer/optimizers/adam.py"
] | [
"from __future__ import division\nimport math\nimport warnings\n\nimport numpy\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer.backends import intel64\nfrom chainer import optimizer\nfrom chainer import types\n\n\nif types.TYPE_CHECKING:\n import typing_extensions as tpe\n\n class AdamHyper... | [
[
"numpy.maximum",
"numpy.sqrt",
"numpy.clip"
]
] |
prabhakar267/gluon-nlp | [
"76fdafbebbbb8f4a09fb82a032b2bdd17ef86287"
] | [
"tests/unittest/test_datasets.py"
] | [
"# coding: utf-8\n\n# 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... | [
[
"numpy.savez",
"numpy.isfinite",
"numpy.arange",
"numpy.save",
"numpy.all"
]
] |
MambaWong/depthai-python-1 | [
"0d15abd77fd82b4a70e096ea5bb99237a17c9862"
] | [
"examples/mixed/mono_depth_mobilenetssd.py"
] | [
"#!/usr/bin/env python3\n\nfrom pathlib import Path\nimport sys\nimport cv2\nimport depthai as dai\nimport numpy as np\n\n# Get argument first\nnnPath = str((Path(__file__).parent / Path('../models/mobilenet-ssd_openvino_2021.4_6shave.blob')).resolve().absolute())\nif len(sys.argv) > 1:\n nnPath = sys.argv[1]\n\... | [
[
"numpy.array"
]
] |
jsalt2019-diadet/hyperion | [
"14a11436d62f3c15cd9b1f70bcce3eafbea2f753",
"14a11436d62f3c15cd9b1f70bcce3eafbea2f753"
] | [
"hyperion/torch/archs/etdnn.py",
"hyperion/calibration/unsup_gauss_calibration.py"
] | [
"\"\"\"\n Copyright 2019 Johns Hopkins University (Author: Jesus Villalba)\n Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\nfrom six.moves import xrange\n\nimport numpy as np\n\nimport... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"numpy.array",
"torch.nn.BatchNorm1d"
],
[
"numpy.expand_dims",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.array",
"numpy.vstack"
]
] |
niuwk/infonets | [
"274e97c9a86144dd52cbe90caffff578a2f5d178"
] | [
"code/learn/srelu2_grad.py"
] | [
"# srelu2_grad.py\n\"\"\"\nCreated on Thu May 31 12:49:01 2018\n\n@author: Wentao Huang\n\"\"\"\nimport ipdb\nimport torch as tc\nfrom .grad import Grad\nfrom ..utils.methods import get_diag_e\n\nclass SReLU2Grad(Grad):\n\n @staticmethod\n def forward(ctx, input, C, bias=None, beta=1.0, isorth=True, eps=1e-6,... | [
[
"torch.slogdet",
"torch.tensor"
]
] |
vpereira/covid-19 | [
"bff527b618f8c7c32c64d4b52809df5b757c2acc"
] | [
"web/app/tests/test_plot_cummulative.py"
] | [
"import os\nimport pandas as pd\nimport unittest\n\nfrom covid19.expogo.core import PlotCummulative\n\n\nclass BasicTests(unittest.TestCase):\n def setUp(self):\n self.df = pd.DataFrame(columns=[\"Province/State\", \"Country/Region\", \"Lat\", \"Long\", \"1/22/20\", \"1/23/20\"],\n ... | [
[
"pandas.DataFrame"
]
] |
EddieNewcastle/QML_Conformers | [
"16e067942b4a75c775e106180e343fe54724eb88"
] | [
"machine.py"
] | [
"\nimport json\nimport re\n\nimport numpy as np\nimport qml\nimport qml.fchl as qml_fchl\nimport qml.math as qml_math\nimport qml.representations as qml_representations\nimport qml.kernels.distance as qml_distance\n\n\nglobal __ATOM_LIST__\n__ATOM_LIST__ = [ x.strip() for x in ['h ','he', \\\n 'li','be','b ','... | [
[
"numpy.square",
"numpy.dot",
"numpy.exp",
"numpy.load",
"numpy.array"
]
] |
aTamaz/pytorch_geometric | [
"8bf6edf423fef012281d82f8a90e9d7f731485b4"
] | [
"torch_geometric/nn/conv/point_conv.py"
] | [
"from typing import Optional, Callable, Union\nfrom torch_geometric.typing import OptTensor, PairOptTensor, PairTensor, Adj\n\nimport torch\nfrom torch import Tensor\nfrom torch_sparse import SparseTensor, set_diag\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.utils import remove_self_lo... | [
[
"torch.cat"
]
] |
Jintao-Huang/course_homework | [
"d886550baea78c38afdb4b3a40d82d2c862dbdcf"
] | [
"suanfa/hw5/ex p83.py"
] | [
"# Author: Jintao Huang\n# Email: hjt_study@qq.com\n# Date: \n\nfrom typing import Optional, List, Set, Tuple\nimport random\nimport time\nfrom numba import njit\nimport numpy as np\n\n\n@njit\ndef QueensLV(n: int, k: int) -> Optional[Tuple[List[int], Set[int], Set[int], Set[int]]]:\n \"\"\"若成功(未失败)返回解. 失败返回None... | [
[
"numpy.argmin"
]
] |
Niekvdplas/ktrain | [
"808a212a9b8ebddd4e2d75eaca2e54a7ea990b4e"
] | [
"ktrain/tests/test_qa.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nTests of ktrain text classification flows\n\"\"\"\nfrom unittest import TestCase, main, skip\n\nimport IPython\nimport numpy as np\nimport testenv\n\nimport ktrain\nfrom ktrain import text\nfrom ktrain.imports import ACC_NAME, VAL_ACC_NAME\n\n\nclass TestQA(TestCase):\n\n # @skip... | [
[
"pandas.set_option",
"pandas.DataFrame",
"sklearn.datasets.fetch_20newsgroups"
]
] |
Guo-Jian-Wang/ReFANN | [
"e985358d1c805f4f46499d5ffa92ba06ba7cff38"
] | [
"refann/sequence.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom . import element\nimport torch.nn as nn\n\nclass SeqName(object):\n \"\"\" The name of sequence, to be used by class LinearSeq \"\"\"\n def __init__(self, module_name):\n self.moduleName = module_name\n \n def seq_name(self):\n self.moduleName = str(eval(se... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.BatchNorm1d"
]
] |
anatoly-khomenko/text-to-text-transfer-transformer | [
"2e707da4b46236c7056999d6857d71e25a5c0c77"
] | [
"t5/data/utils.py"
] | [
"# Copyright 2019 The T5 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 applicable law or agr... | [
[
"tensorflow.compat.v1.io.FixedLenFeature",
"tensorflow.compat.v1.io.gfile.exists",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.data.get_output_types",
"tensorflow.compat.v1.data.get_output_shapes",
"tensorflow.compat.v1.compat.as_bytes",
"tensorflow.compat.v1.io.gfile.GFile",
... |
2019ZSS/FER | [
"49b8b400680bb1c6723394a7fc1396e55d643315"
] | [
"trainers/tta_trainer.py"
] | [
"\"\"\"this class build and run a trainer by a configuration\"\"\"\nimport os\nimport sys\nimport shutil\nimport datetime\nimport traceback\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision\nimport matplotlib.pypl... | [
[
"torch.LongTensor",
"torch.nn.functional.softmax",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.distributed.init_process_group",
"torch.nn.CrossEntropyLoss",
"numpy.random.seed",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.unsqueeze",
"torch.no_grad",
"to... |
WMD-group/PyTASER | [
"12b4e3203698b7e6f03457022897405023d6f239"
] | [
"pytaser/kpoints.py"
] | [
"import numpy as np\nfrom pymatgen.core import Structure\n\n\ndef get_kpoint_weights(bandstructure, time_reversal=True, symprec=0.1):\n \"\"\"\n Function to calculate the kpoint_weights for non-magnetic materials (non-metals).\n\n Args:\n bandstructure: PMG bandstructure object\n time_reversa... | [
[
"numpy.dot",
"numpy.product",
"numpy.abs",
"numpy.unique",
"numpy.min",
"numpy.eye",
"numpy.rint",
"numpy.linalg.norm",
"numpy.concatenate",
"numpy.diff",
"numpy.array",
"numpy.sum"
]
] |
rvk007/Monocular-Depth-Estimation | [
"c53b89a74cad5554bde7944357d6026e64c7dcdd"
] | [
"deepnet/model/models/masknet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom deepnet.model.learner import Model\n\nclass MaskNet3(nn.Module):\n def __init__(self):\n \"\"\"Creates Masknet-3\"\"\"\n super(MaskNet3, self).__init__()\n\n self.layer1 = nn.Sequential(\n nn.Conv2d(3, 3... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.cat"
]
] |
euikook/python-moving-average-examples | [
"d721fdb8a49faa6e9cf84ded3510185b42e7d8dc"
] | [
"weight.py"
] | [
"import numpy as np\n\nimport pandas as pd\n\nfrom matplotlib import rcParams\nrcParams['font.family'] = 'monospace'\nrcParams['font.sans-serif'] = ['Tahoma']\nimport matplotlib.pyplot as plt\n\nfrom matplotlib.ticker import (MultipleLocator, AutoMinorLocator)\n\n\n# smoothing factor and number of data points\nN = ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylabel"
]
] |
pbmanis/pylibrary | [
"d6cb41386cd39b7a1b6678a71a704f3b9d09faef"
] | [
"pylibrary/plotting/colormaps/PuBuGnYl_r.py"
] | [
"\nfrom matplotlib.colors import LinearSegmentedColormap\nfrom numpy import nan, inf\n\n# Used to reconstruct the colormap in pycam02ucs.cm.viscm\nparameters = {'xp': [22.674387857633945, 11.221508276482126, -14.356589454756971, -47.188177587392218, -34.590010048125208, 0.15039134803535603],\n 'yp': [-... | [
[
"matplotlib.colors.LinearSegmentedColormap.from_list",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
surasakcho/zkyhaxpy | [
"4d3114b0cce9b19cc92c4e7b1b6aa59f3c7a88f5"
] | [
"zkyhaxpy/colab_tools.py"
] | [
"import os\r\nfrom google.colab import auth\r\nfrom google.colab import drive\r\nfrom zkyhaxpy.io_tools import get_list_files_re, filepaths_to_df\r\nimport pandas as pd\r\nimport re\r\n\r\n\r\ndef check_dup_files(folder, file_nm_prefix=None, file_nm_extension=None, remove=False):\r\n if file_nm_prefix==None:\r\n... | [
[
"pandas.DataFrame"
]
] |
dzzxjl/DeepCTR | [
"ec3fa832865c14aa2cc843be2b1eab1bfa7b3e4e"
] | [
"deepctr/models/fwfm.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"\nAuthor:\n Harshit Pande\n\nReference:\n [1] Field-weighted Factorization Machines for Click-Through Rate Prediction in Display Advertising\n (https://arxiv.org/pdf/1806.03514.pdf)\n\n\"\"\"\n\nfrom itertools import chain\n\nimport tensorflow as tf\n\nfrom ..feature_column i... | [
[
"tensorflow.keras.initializers.glorot_normal",
"tensorflow.keras.models.Model"
]
] |
RLReed/unotran | [
"b317107e1a39490dda732f86a731872f5207a167"
] | [
"src/test/test_mesh.py"
] | [
"import sys\nsys.path.append('../')\n\nimport unittest\nimport pydgm\nimport numpy as np\n\n\nclass TestMESH(unittest.TestCase):\n\n def test_mesh_create_mesh_1D(self):\n ''' \n Test the mesh initialization for 1D\n '''\n\n # Set the variables for the test\n pydgm.control.spati... | [
[
"numpy.testing.assert_array_equal",
"numpy.testing.assert_array_almost_equal"
]
] |
chaselee/autokeras | [
"6e0ae127810c353722669b897f17ee3ca9ce2ee2"
] | [
"autokeras/nodes.py"
] | [
"# Copyright 2020 The AutoKeras 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 applicable law... | [
[
"tensorflow.expand_dims",
"tensorflow.keras.utils.serialize_keras_object",
"tensorflow.python.util.nest.flatten",
"tensorflow.keras.Input"
]
] |
mbonto/fewshot_neuroimaging_classification | [
"2ff0aab6d2c7991e566200d8e4da4b2cbf025a4a"
] | [
"MAML_plus_plus/meta_neural_network_architectures.py"
] | [
"import numbers\nfrom copy import copy\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nimport numpy as np\nfrom scipy import io as sio\n\n\n\ndef extract_top_level_dict(current_dict):\n \"\"\"\n Builds a graph dictionary from the passed depth_keys, value pair. Useful for dynamically pas... | [
[
"torch.mean",
"torch.ones",
"torch.empty",
"torch.zeros",
"torch.nn.ModuleDict",
"torch.nn.functional.conv1d",
"torch.sum",
"torch.from_numpy",
"torch.eye",
"scipy.io.loadmat",
"torch.matmul",
"torch.nn.functional.relu",
"torch.nn.init.xavier_uniform_",
"tor... |
cheinger/cudf | [
"f33130152eb325fe123be2f91ed8a9ac0dc28d0c"
] | [
"python/cudf/cudf/core/index.py"
] | [
"# Copyright (c) 2018-2022, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport math\nimport pickle\nimport warnings\nfrom functools import cached_property\nfrom numbers import Number\nfrom typing import (\n Any,\n Dict,\n List,\n MutableMapping,\n Optional,\n Tuple,\n Type,\n ... | [
[
"pandas.RangeIndex",
"numpy.asarray",
"numpy.issubdtype",
"pandas.io.formats.printing.default_pprint",
"pandas._config.get_option",
"numpy.min_scalar_type",
"numpy.array"
]
] |
hllj/fsdl-text-recognizer-2021-labs | [
"c9b5fb64cf90ba79844e0b58d2ac776e1e4349c3"
] | [
"lab1/text_recognizer/models/mlp.py"
] | [
"from typing import Any, Dict\nimport argparse\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nFC1_DIM = 1024\nFC2_DIM = 128\nFC3_DIM = 128\n\n\nclass MLP(nn.Module):\n \"\"\"Simple MLP suitable for recognizing single characters.\"\"\"\n\n def __init__(\n ... | [
[
"torch.nn.Dropout",
"torch.nn.Linear",
"torch.nn.functional.relu",
"numpy.prod",
"torch.flatten"
]
] |
dgketchum/pymetric | [
"f08a7e4fd12196be59f424e4a8a11448d8e805a1"
] | [
"code/support/et_common.py"
] | [
"#--------------------------------\n# Name: et_common.py\n# Purpose: Common ET support functions\n#--------------------------------\n\nfrom calendar import monthrange\nfrom collections import defaultdict\nimport datetime as dt\nimport logging\nimport math\nimport os\nimport re\nimport sys\n\nimport dri... | [
[
"numpy.array",
"numpy.power",
"numpy.clip",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.cos",
"numpy.genfromtxt",
"numpy.full",
"numpy.sin",
"numpy.copy",
"numpy.tan",
"numpy.any",
"numpy.interp",
"numpy.mod",
"numpy.reciprocal",
"numpy.exp",
"nump... |
ohadoh-math/invertible-resnet | [
"4f05b9d1761c2d46cc05d9748ef3e690f8b9c0b2"
] | [
"design-experiments-digest.py"
] | [
"#!/usr/bin/env python3\n\n\nimport os\nimport json\nimport logging\nimport numpy\nfrom pathlib import Path\nfrom argparse import ArgumentParser\nfrom collections import defaultdict\nfrom matplotlib import pyplot\n\n\ndef main():\n arg_parser = ArgumentParser(description=\"Generate output digest from a design ex... | [
[
"numpy.array",
"matplotlib.pyplot.subplots"
]
] |
cdchushig/imbalanced-learn | [
"f02e7c7c2c021c85823cace405ca2c58ad4ff147"
] | [
"imblearn/under_sampling/_prototype_selection/tests/test_condensed_nearest_neighbour.py"
] | [
"\"\"\"Test the module condensed nearest neighbour.\"\"\"\n# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>\n# Christos Aridas\n# License: MIT\n\nimport pytest\nimport numpy as np\n\nfrom sklearn.utils._testing import assert_array_equal\nfrom sklearn.neighbors import KNeighborsClassifier\n\nfrom imbl... | [
[
"numpy.array",
"sklearn.utils._testing.assert_array_equal",
"sklearn.neighbors.KNeighborsClassifier"
]
] |
fuz-woo/jpype | [
"3ffb1e7a75402545c1d669f4bc5836b08b76b6ae"
] | [
"test/jpypetest/test_conversionShort.py"
] | [
"# *****************************************************************************\n# Copyright 2017 Karl Einar Nelson\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# ... | [
[
"numpy.uint32",
"numpy.uint8",
"numpy.int32",
"numpy.int8",
"numpy.int16",
"numpy.int",
"numpy.int64",
"numpy.uint16",
"numpy.uint64",
"numpy.float64",
"numpy.float32",
"numpy.float"
]
] |
rgrumbine/seaice-concentration | [
"80449bb23028c8a211fd050ff694b52eb5fc6bde"
] | [
"sorc/filter/version3.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport numpy.ma as ma\nimport netCDF4\nfrom netCDF4 import Dataset\n\n#----------------------------------------------\ndef oiv2(lat, lon):\n dlat = 0.25\n dlon = 0.25\n firstlat = -89.875\n firstlon = 0.125\n if (lon < 0):\n lon += 360.\n j = round( (lat - firstl... | [
[
"numpy.logical_not",
"numpy.ma.logical_or",
"numpy.ma.logical_not",
"numpy.ma.masked_array",
"numpy.ma.logical_and",
"numpy.logical_and",
"numpy.zeros"
]
] |
whatbeg/DataScienceTools | [
"64398cf97cbe9a8d5bf15c10f8e48cdd34324492"
] | [
"src/main/plot_log.py"
] | [
"# ==================================\n# Author: whatbeg (Qiu Hu)\n# Created by: 2017. 5\n# Personal Site: http://whatbeg.com\n# ==================================\n\n\"\"\"Plot Log files on different forms\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef analyse_bigdl(files, title):\n \"\"\... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
unanan/face-parsing.PyTorch | [
"85e66d30014efdbe5a3440250a310e8281fd6040"
] | [
"test.py"
] | [
"#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nfrom model import BiSeNet\n\nimport torch\nimport argparse\nimport os\nimport os.path as osp\nimport numpy as np\nfrom PIL import Image\nimport torchvision.transforms as transforms\nimport cv2\n\n\ndef vis_parsing_maps(im, parsing_anno, stride, save_im=False, save_pa... | [
[
"torch.load",
"numpy.unique",
"torch.unsqueeze",
"numpy.max",
"torch.no_grad",
"torch.device",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
chapochn/ORN-LN_circuit | [
"42e0ee5e81a8f711564f45e21d3b4e3ce3e02f69"
] | [
"bin/functions/plotting.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Nikolai M Chapochnikov\n\"\"\"\n\n# #############################################################################\n# ################################# IMPORTS ###################################\n# #########################################################################... | [
[
"matplotlib.pyplot.axes",
"numpy.max",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.gcf",
"scipy.linalg.norm",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.close",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"pandas.concat",
"numpy.log10",
... |
ikim-quantum/er_noise | [
"1e577ff75f8d3141116e37e11d22b516a9e38a24"
] | [
"pcc/spacetime_1d.py"
] | [
"from D1 import width_pcc_dmera_1d, depth_pcc_dmera_1d, width_pcc_dmera_1d_nocompression\nimport numpy as np\n\n\nn=8\nD=5\nwidths = []\nwidths_nc = []\ndepths = []\nvols = []\n\nfor x in range(2**n):\n print(\"x={}/{}\".format(x+1, 2**n))\n supp = [x, (x+1)%(2**n)]\n width = width_pcc_dmera_1d(n,D, supp)\... | [
[
"numpy.std",
"numpy.mean"
]
] |
prachigaikwad201994/https-github.com-prachi12345-MIRNet | [
"c6812f5bc4ac87e4e63af21aa4e0db84597a17c8"
] | [
"mirnet/model/dual_attention_unit/attention_blocks.py"
] | [
"import tensorflow as tf\n\n\ndef spatial_attention_block(input_tensor):\n \"\"\"Spatial Attention Block\"\"\"\n average_pooling = tf.reduce_max(input_tensor, axis=-1)\n average_pooling = tf.expand_dims(average_pooling, axis=-1)\n max_pooling = tf.reduce_mean(input_tensor, axis=-1)\n max_pooling = tf... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.reduce_max",
"tensorflow.nn.sigmoid",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.ReLU",
"tensorflow.reduce_mean",
"tensorflow.reshape",
"tensorflow.keras.layers.Conv2D",
"tensorflow.expand_dims"
... |
PepperBurst/DSP | [
"5a078c494a53bf22dc387a532acc5151b13d0fa3"
] | [
"Scripts/lab3b/Main.py"
] | [
"from aSurnameFilters import *\nimport numpy as np\nimport matplotlib.pyplot as plt\n#Plot of all graphs\n#There will be a total of 6 plots\ndef plotlab3b(code, date):\n n = np.arange(-10, 10 + 1)\n x = 1*(n==0)\n y = [s1(x), s2(x), s2(s1(x)), s1(s2(x))]\n # we are using object oriented programming\n ... | [
[
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
shineyruan/incubator-mxnet | [
"5964d519fb1b178cd7d4e532eaf208605dd68095"
] | [
"python/mxnet/numpy/multiarray.py"
] | [
"#!/usr/bin/env python\n\n# 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.... | [
[
"numpy.array",
"numpy.dtype"
]
] |
VITA-Group/Audio-Lottery | [
"98ed7b34858469b5c8594c92c45f0602e14c1806"
] | [
"CNN_LSTM/deepspeech_pytorch/prune.py"
] | [
"import json\nimport os\nimport random\nimport time\nimport logging\nimport copy\nimport glob\n\nimport numpy as np\nimport torch.distributed as dist\nimport torch.utils.data.distributed\nfrom apex import amp\nfrom hydra.utils import to_absolute_path\nfrom omegaconf import OmegaConf\nfrom torch.nn.parallel import D... | [
[
"torch.nn.parallel.DistributedDataParallel",
"torch.distributed.init_process_group",
"numpy.random.seed"
]
] |
Matgenix/pysisso | [
"b619c297a6892cfeb6068ca4d84e0cf079da3ecc"
] | [
"pysisso/tests/test_sklearn.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2020, Matgenix SRL, All rights reserved.\n# Distributed open source for academic and non-profit users.\n# Contact Matgenix for commercial usage.\n# See LICENSE file for details.\n\n\nimport datetime\nimport os\nimport shutil\n\nimport joblib\nimport numpy as np\nimport pand... | [
[
"numpy.array",
"pandas.DataFrame"
]
] |
MinorDudle/nasa_hack | [
"6ac146936a479a440ea235ee3656a15b8d66cd00"
] | [
"app/utils/transformer.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport PIL.Image\nimport cv2 as cv\n\n\nclass FullTransformation:\n\n def __init__(self, original_path, style_path, output_path, params, model):\n self.original_path = original_path\n self.style_path = style_path\n self.output_path = output_path\... | [
[
"tensorflow.constant",
"tensorflow.shape",
"tensorflow.cast",
"numpy.ndim",
"tensorflow.image.resize",
"tensorflow.image.decode_image",
"tensorflow.image.convert_image_dtype",
"tensorflow.io.read_file",
"numpy.array"
]
] |
HenryLittle/OpenPCDet-HL | [
"7dba01750e10d170849314723ec0665782236a70"
] | [
"pcdet/datasets/processor/data_processor.py"
] | [
"from functools import partial\n\nimport numpy as np\nfrom skimage import transform\n\nfrom ...utils import box_utils, common_utils\n\ntv = None\ntry:\n import cumm.tensorview as tv\nexcept:\n pass\n\n\n\nclass VoxelGeneratorWrapper():\n \"\"\"\n A wrapper around the [spconv VoxelGenerator]\n\n ... | [
[
"numpy.random.choice",
"numpy.linalg.norm",
"numpy.random.shuffle",
"numpy.concatenate",
"numpy.round",
"numpy.random.permutation",
"numpy.array",
"numpy.where"
]
] |
ansonb/RECON | [
"1a0c21479f017a05d86b27f56e3d60bd9bf4a191"
] | [
"semanticgraph/vis_utils.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib.lines as mlines\nimport matplotlib.patches as mpatches\n\nimport numpy as np\nfrom .graph_utils import vertex_by_token_position\n\n\ndef show_relation_graph(g):\n \"\"\"\n Displays the relation graph using matplotlib.\n\n :param g: input graph.\n \"\"\... | [
[
"matplotlib.lines.Line2D",
"matplotlib.patches.Circle",
"matplotlib.pyplot.subplots",
"numpy.average",
"numpy.sin",
"numpy.cos",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"matplotlib.pyplot.show"
]
] |
tapper/Tapper | [
"f104ee44ad1f83b9367e2fcd1f0b4f5e54bfc84d"
] | [
"examples/dpath/python_mason.py"
] | [
"#!/usr/bin/env python\n\n#############\n# Author : Conny Seidel <conny.seidel@amd.com>\n#############\n\n'''\nThis is a testscript to gather the needed information in Python via socket and\nmason template.\n'''\nimport sys\nimport re\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom socket import *\n\n\nm... | [
[
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
mvinyard/genomeIO | [
"e905966e95d6ba06748ca836d420d938dcaa3add"
] | [
"genomeIO/_read_macs2/_read_narrowPeak.py"
] | [
"\nimport glob\nimport os\nimport pandas as pd\n\ndef _return_narrowPeak_columns():\n\n \"\"\"\"\"\"\n\n return [\n \"chrom\",\n \"chromStart\",\n \"chromEnd\",\n \"name\",\n \"score\",\n \"strand\",\n \"signalValue\",\n \"pValue\",\n \"qValue\",\... | [
[
"pandas.read_csv"
]
] |
ngachung/incubator-sdap-nexus | [
"38e768694fcc142e2d88283cb1e44e05f88da847"
] | [
"climatology/clim/util/array.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you m... | [
[
"numpy.ones"
]
] |
FoteiniD/inter-rel-net | [
"09a27cc7ea71c26ea719e3bb5f6830acf622faef"
] | [
"src/misc/data_io.py"
] | [
"import numpy as np\nimport pandas as pd\nimport json, glob\nimport linecache\nimport h5py\n\nfrom keras.utils import to_categorical\n\nTORSO, LEFT_HAND, RIGHT_HAND, LEFT_LEG, RIGHT_LEG = 0,1,2,3,4\n\n# OpenPose body parts\n\n# POSE_BODY_25_BODY_PARTS = [\"Nose\",\"Neck\",\"RShoulder\",\"RElbow\",\"RWrist\",\"LShou... | [
[
"numpy.isin",
"numpy.dot",
"numpy.pad",
"numpy.unique",
"numpy.median",
"numpy.average",
"numpy.linalg.norm",
"numpy.ceil",
"numpy.fromstring",
"numpy.mean",
"numpy.zeros_like",
"numpy.cross",
"numpy.load",
"numpy.array",
"numpy.empty"
]
] |
OOXXXXOO/XCloud | [
"239115558c50f62947679dbcf01852684a3656ac"
] | [
"research/iqa/lean_detector.py"
] | [
"# a class wrapper for Lean Detection\nimport math\n\nimport cv2\nimport numpy as np\n\n\nclass LeanDetector:\n def __init__(self, lean_degree_threshold=5):\n # the hyper-param lean_degree_threshold should be tuned according to your application scene\n self.lean_degree_threshold = lean_degree_thres... | [
[
"numpy.array",
"numpy.arctan"
]
] |
Iwvvwl/MSMARCO-Passage-Ranking-Submissions | [
"0118ed3c55e75a8783a83356a2e0afb0fe242443"
] | [
"analysis/plot_leaderboard_over_time.py"
] | [
"# MS MARCO Passage: Script for plotting leaderboard over time scatter plots\n\nimport pandas as pd\nimport datetime\nimport matplotlib.dates as mdates\nimport matplotlib.pyplot as plt\nplt.switch_backend('agg')\n\n# Solution to use Type 1 fonts:\n# https://stackoverflow.com/questions/13132194/type-1-fonts-with-log... | [
[
"pandas.to_datetime",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.switch_backend",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
Bill13579/furry | [
"3336ccd88996494c8bf0b8445bf7e7058a5f3397"
] | [
"furry/optimizer/optimizer.py"
] | [
"import torch\nfrom furry.data.utils import float32\nfrom furry.dev import default_device\n\nclass Optimizer:\n def __init__(self, module=None, dtype=float32, dev=None):\n if dev is None:\n dev = default_device()\n self.__module = None\n self.__dtype = dtype\n self.__dev = ... | [
[
"torch.no_grad"
]
] |
cgroeneveld/amuse | [
"9684fd22ce8293b837d2c78f56948e3ec3d04032"
] | [
"src/amuse/community/sse/interface.py"
] | [
"import numpy\nfrom operator import itemgetter\nfrom amuse.community import *\nfrom amuse.units import units\nfrom amuse.units import constants\nfrom amuse.support.interface import InCodeComponentImplementation\nfrom amuse.community.interface import common\n\nfrom amuse.datamodel import Particles\nfrom amuse.datamo... | [
[
"numpy.logical_not"
]
] |
wadzaw/text-classification | [
"1be6dc653c1d5fb386c3edb7da3e15cbf15cd4c1"
] | [
"Text+Classification+using+python,+scikit+and+nltk.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n#Loading the data set - training data.\nfrom sklearn.datasets import fetch_20newsgroups\ntwenty_train = fetch_20newsgroups(subset='train', shuffle=True)\n\n\n# In[4]:\n\n\n# You can check the target names (categories) and some data files by following commands... | [
[
"sklearn.model_selection.GridSearchCV",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.mean",
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.linear_model.SGDClassifier",
"sklearn.datasets.fetch_20newsgroups"
]
] |
tsia/c3nav | [
"18fdb34b3fbcf7eb4617794750494cfa16428c54"
] | [
"src/c3nav/mapdata/render/renderdata.py"
] | [
"import operator\nimport os\nimport pickle\nimport threading\nfrom collections import deque\nfrom itertools import chain\n\nimport numpy as np\nfrom django.conf import settings\nfrom scipy.interpolate import NearestNDInterpolator\nfrom shapely import prepared\nfrom shapely.geometry import GeometryCollection\nfrom s... | [
[
"numpy.array",
"numpy.vstack",
"numpy.full"
]
] |
CyberFlameGO/AE-WTN | [
"1a4b4bfbc4d6255dfc58c89a059f8e25ca3478e8"
] | [
"maskrcnn_benchmark/modeling/roi_heads/box_head/inference.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\nfrom maskrcnn_benchmark.structures.boxlist_ops import boxlist_nms\nfrom maskrcnn_benchmark.structures.boxli... | [
[
"torch.sigmoid",
"torch.nonzero",
"torch.full",
"torch.cat"
]
] |
swaitw/EasyRec | [
"1a44891c557935eec29c6dc0d4dfc4a543fbd39a"
] | [
"easy_rec/python/model/esmm.py"
] | [
"# -*- encoding:utf-8 -*-\n# Copyright (c) Alibaba, Inc. and its affiliates.\nimport logging\n\nimport tensorflow as tf\n\nfrom easy_rec.python.layers import dnn\nfrom easy_rec.python.model.multi_task_model import MultiTaskModel\nfrom easy_rec.python.protos.esmm_pb2 import ESMM as ESMMConfig\nfrom easy_rec.python.p... | [
[
"tensorflow.keras.backend.binary_crossentropy",
"tensorflow.boolean_mask",
"tensorflow.losses.mean_squared_error",
"tensorflow.multiply",
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.layers.dense",
"tensorflow.nn.sigmoid_cross_entropy_with_logits... |
meteoNL/CM1_experiments | [
"49e3f471845cd821fa5e5bf92a3f37227ede9e68"
] | [
"cm1r19.8/run/scripts/read_nc_CM1.py"
] | [
"#!/usr/bin/env python3\n###### -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 14 17:29:45 2019\n\n@author: egroot\n\"\"\"\n#imports\nimport matplotlib.pyplot as pl\nfrom preparation_script import *\n#import numpy.ma as ma\n\nfnames=[] #initialise list\n\n## distinction for legend between integrated/surface and ... | [
[
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.text",
... |
nordme/nordme_work_repo | [
"950a5077730885330a4975c4ca1bd3c51903a1a6"
] | [
"indv_movies.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport os.path as op\nimport mne\nimport numpy as np\n\n# set variables\n\nsigned = False\ninv_method = 'dSPM'\nsubj_dir = '/data/acdc/'\nsubjects = ['erica_peterson']\nbackend = 'mavayi'\n\nif signed:\n tag = '/signed/'\n clim = {'kind': 'percent', 'pos_lims': np.arange... | [
[
"numpy.arange"
]
] |
briansp2020/courses | [
"7849aaff37518dd31eb22266e8453ecb469b1f90"
] | [
"deeplearning1/nbs/vgg16.py"
] | [
"from __future__ import division, print_function\n\nimport os, json\nfrom glob import glob\nimport numpy as np\nfrom scipy import misc, ndimage\nfrom scipy.ndimage.interpolation import zoom\n\nfrom keras import backend as K\n\nfrom keras.layers.normalization import BatchNormalization\nfrom keras.utils.data_utils im... | [
[
"numpy.array",
"numpy.argmax"
]
] |
world-admin/folium | [
"1b775f63fb3fcda385348bcbabe82d1915091c62"
] | [
"tests/test_folium.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nFolium Tests\n-------\n\n\"\"\"\nimport pytest\n\nimport os\nimport json\ntry:\n from unittest import mock\nexcept ImportError:\n import mock\n\nimport pandas as pd\nimport jinja2\nfrom jinja2 import Environment, PackageLoader\n\nfrom six import PY3\nimport branca.element\n... | [
[
"pandas.merge",
"pandas.DataFrame"
]
] |
etetteh/covidECTRA | [
"66adcbe4e2217f3eea9e279bda2626936cde3d73"
] | [
"electra_small/finetune/qa/qa_tasks.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google Research 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 requ... | [
[
"tensorflow.compat.v1.nn.log_softmax",
"tensorflow.compat.v1.nn.softmax",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.expand_dims",
"tensorflow.compat.v1.nn.top_k",
"tensorflow.compat.v1.reduce_sum",
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.one_hot",
"tensor... |
Turtlesyu-27/qlib | [
"cb2c3028b8cabfca909f22890c9b126a18a35daf"
] | [
"qlib/contrib/report/analysis_model/analysis_model_performance.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nimport pandas as pd\n\nimport plotly.tools as tls\nimport plotly.graph_objs as go\n\nimport statsmodels.api as sm\nimport matplotlib.pyplot as plt\n\nfrom scipy import stats\n\nfrom ..graph import ScatterGraph, SubplotsGraph, BarGraph, He... | [
[
"pandas.to_datetime",
"matplotlib.pyplot.subplots",
"pandas.MultiIndex.from_arrays",
"pandas.DataFrame"
]
] |
rstoneback/pysatCDF | [
"0d0d0fa843e26d269b17591fd27e4561bb32d40f"
] | [
"pysatCDF/_cdf.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\nimport copy\nimport numpy as np\nimport string\nimport sys\n\nimport pandas\nimport pysat\n\nfrom pysatCDF import fortran_cdf\n\n\nclass CDF(object):\n \"\"\"Reads data from NASA Common Data Format (CDF) files.\n\n pysatCDF presen... | [
[
"pandas.concat",
"pandas.Series",
"numpy.arange",
"pandas.DataFrame",
"numpy.shape",
"pandas.DataFrame.from_dict",
"numpy.array",
"numpy.where"
]
] |
Near32/comaze_gym | [
"296ae8295ffac5222f085e3482d0b976ea987d66"
] | [
"comaze_gym/metrics/message_policy.py"
] | [
"from typing import List, Dict, Optional\n\nimport torch\nimport torch.nn as nn\n\nclass MessagePolicy(nn.Module):\n def __init__(self, model:nn.Module):\n super(MessagePolicy, self).__init__()\n self.model = model\n\n def parameters(self):\n return self.model.parameters()\n\n def save... | [
[
"torch.zeros"
]
] |
tacohen125/chachies | [
"fb850757414408e7bff1342edd785db578502429"
] | [
"examples/Images/chachifuncs_sepcd.py"
] | [
"import glob \nfrom math import isclose \nimport numpy as np\nimport os \nimport pandas as pd\nfrom pandas import ExcelWriter\nimport requests\nimport scipy.io\nimport scipy.signal\n\n################################\n### OVERALL Wrapper Function ###\n################################\n\ndef get_all_data(rootdir, pa... | [
[
"pandas.concat",
"pandas.read_excel",
"pandas.DataFrame",
"numpy.sign",
"pandas.ExcelWriter"
]
] |
dajebbar/Reproductible-Jupyter-Workflow | [
"180a5b800c79127507fa66a744d8e5600573afce"
] | [
"jupyterworkflow/tests/test_data.py"
] | [
"from jupyterworkflow.data import check_fremont_data\nimport pandas as pd\nimport numpy as np\n\n\ndef test_fremont_data():\n data = check_fremont_data()\n assert all(data.columns == ['Total', 'East', 'West'])\n assert isinstance(data.index, pd.DatetimeIndex)\n assert len(np.unique(data.index.time) == 2... | [
[
"numpy.unique"
]
] |
MakeBigBigMoney/czsc | [
"8450c8912904b1d66a5c6e78d42c1b7d4b3d1777"
] | [
"examples/third_buy_use_tdxfile.py"
] | [
"# coding: utf-8\n\nimport pandas as pd\nfrom datetime import datetime\nfrom typing import List\nfrom czsc.analyze import CZSC, RawBar\nfrom czsc.enum import Signals\nimport struct\nimport os\n\n\nTDX_DIR = r\"D:\\new_jyplug\" # 首先要设置通达信的安装目录\n\n# 从通达信目录读入数据\ndef get_data_from_tdxfile(stock_code, type) -> List[Ra... | [
[
"pandas.to_datetime"
]
] |
an99990/SeMask-Segmentation | [
"786f395fab4e156970628134cb49eb3547d7287b"
] | [
"SeMask-FPN/mmseg/models/segmentors/base.py"
] | [
"import logging\nimport warnings\nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport mmcv\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom mmcv.runner import auto_fp16\nimport os\nimport matplotlib.pyplot as plt\n\nignore_label= 255... | [
[
"matplotlib.pyplot.imsave",
"numpy.sqrt",
"torch.max",
"numpy.asarray",
"torch.min",
"numpy.rint",
"torch.distributed.is_initialized",
"torch.distributed.is_available",
"torch.distributed.get_world_size",
"numpy.array",
"numpy.zeros"
]
] |
QuinnQiao/pytorch-cnn-visualizations | [
"bcbaf39899a976eb80ff2cc2f078c1445f2fa6a4"
] | [
"src/misc_functions.py"
] | [
"\"\"\"\nCreated on Thu Oct 21 11:09:09 2017\n\n@author: Utku Ozbulak - github.com/utkuozbulak\n\"\"\"\nimport os\nimport copy\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.cm as mpl_color_map\n\nimport torch\nfrom torch.autograd import Variable\nfrom torchvision import models\n\n\ndef convert_to_gr... | [
[
"numpy.expand_dims",
"numpy.maximum",
"numpy.abs",
"numpy.clip",
"numpy.min",
"numpy.uint8",
"torch.from_numpy",
"numpy.percentile",
"numpy.round",
"numpy.max",
"numpy.float32",
"matplotlib.cm.get_cmap",
"numpy.repeat",
"torch.autograd.Variable"
]
] |
dgrinwald93/pytorch_bnns | [
"09bf7504f30373229579f15e847f1a7f87cf6ef0"
] | [
"scripts/train_mcdo_places365.py"
] | [
"import argparse\r\nimport os\r\nimport sys\r\nimport random\r\nimport json\r\nimport shutil\r\nimport time\r\nimport warnings\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.parallel\r\nimport torch.backends.cudnn as cudnn\r\nimport torch.distributed as dist\r\nimport torch.optim\r\nimport torch.mu... | [
[
"torch.nn.CrossEntropyLoss",
"torch.distributed.init_process_group",
"torch.multiprocessing.spawn",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.manual_seed",
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.DataParallel",
"torch.... |
MadElf1337/Enquiry_bot | [
"707edcde0bd6e4f35611626faebe1a894f6d0b4b"
] | [
"predict_bot.py"
] | [
"import nltk\r\nfrom nltk.stem import WordNetLemmatizer\r\nimport pickle\r\nimport numpy as np\r\nfrom keras.models import load_model\r\nimport json\r\nimport random\r\n\r\nintents = json.loads(open('intents.json', encoding=\"utf8\").read())\r\nwords = pickle.load(open('words.pkl', 'rb'))\r\nclasses = pickle.load(o... | [
[
"numpy.array"
]
] |
research-manuscripts/MA_Felix_Rittler | [
"b5f7305e7a0c4bbbfe500df86ffce620e8a6822a"
] | [
"autoencoder/test_performance.py"
] | [
"import torch\nfrom autoencoder import Autoencoder\nimport time\nimport numpy as np\n\n# Begin of variables that can be edited by the user\ntrained_models = [\n (Autoencoder.Autoencoder1(), \"trained_autoencoders/a1.pt\"),\n (Autoencoder.Autoencoder2(), \"trained_autoencoders/a2.pt\"),\n (Autoencoder.Autoe... | [
[
"torch.cuda.synchronize",
"torch.load",
"torch.randn",
"torch.cuda.Event",
"numpy.std",
"torch.no_grad",
"numpy.zeros",
"numpy.sum",
"torch.save"
]
] |
FoolMasque/LBPH-FaceNet-Face-Recognition | [
"6bf1c9a0b010f1528ce478cf7951b56e50aee429"
] | [
"devtube/LBPHRecognizer/faces-train.py"
] | [
"import cv2\nimport os\nimport numpy as np\nfrom PIL import Image\nimport pickle\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nimage_dir = os.path.join(BASE_DIR, \"images\")\n\nface_cascade =cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')\nrecognizer = cv2.face.LBPHFaceRecognizer... | [
[
"numpy.array"
]
] |
Preeti240/DoctorBOT | [
"16242441ae8de79542747d0d20ad40cc9aa0300b"
] | [
"Question_Maker.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom pandas import DataFrame\nimport prediction2\n\ndef fillter1(s):\n nt_data = pd.read_csv(\"Scraped-Data/test2.csv\", encoding =\"ISO-8859-1\",)\n df = pd.DataFrame(nt_data)\n \n try: \n df_filtered = df[ (df[s[0]]== 1) & (df[s[1]]== 1) ]\n m... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
csachs/mfisp | [
"90251933aa4b15d910ef076550d111c075d358be"
] | [
"mfisp/boxcrop/__main__.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nautomatically registers, derotates and box-crops images,\nby Christian C. Sachs, uses molyso's registration functionality ( https://github.com/modsim/molyso )\nhttps://dx.doi.org/10.1371/journal.pone.0163453\nand a boxdetection routine from https://github.com/csachs/mfisp-boxdetect... | [
[
"numpy.zeros"
]
] |
borg-project/cargo | [
"79e5ac3a6f267dcdc2179fc1a7c49504bafb6e0f"
] | [
"src/python/cargo/plot.py"
] | [
"\"\"\"\n@author: Bryan Silverthorn <bcs@cargo-cult.org>\n\"\"\"\n\ndef get_color_list(n, saturation = 1.0, value = 0.75):\n \"\"\"\n Get an optimally-spaced list of (RGB) color values.\n \"\"\"\n\n import numpy\n\n from matplotlib.colors import hsv_to_rgb\n\n hsv_colors = numpy.empty((1, n, 3))\n... | [
[
"matplotlib.colors.hsv_to_rgb",
"numpy.empty"
]
] |
evelynpurse/CTA_summart | [
"90bc2b59f45d0e9d02b4c2b5986b21d7781c3908"
] | [
"check_vol/check_vol.py"
] | [
"import pandas as pd\nimport numpy as np\n\n#####if 20-day volume avg >10000,can be traded in the next period\n\nfuture_price=pd.read_csv(\"../data_extraction/future_price.csv\")\nfuture_info=pd.read_csv(\"../data_extraction/future_info.csv\")\ncombined=future_price.set_index(['order_book_id'])[['date','volume']].j... | [
[
"pandas.read_csv"
]
] |
inspo13/ML-Reserve | [
"26b583f58135fcabb65e815c85760c5eea70f2a0"
] | [
"Noise Suppression/app.py"
] | [
"# Importing project dependencies\r\n\r\nimport streamlit as st\r\nimport tensorflow as tf\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom scipy.io.wavfile import write\r\nimport util_functions as ufs\r\nimport time\r\n\r\n# Setting config option for deployment\r\n\r\nst.set_option('deprecation.sho... | [
[
"matplotlib.pyplot.legend",
"scipy.io.wavfile.write",
"tensorflow.reshape",
"matplotlib.pyplot.subplots",
"tensorflow.expand_dims",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
felipevicens/tng-probes | [
"ec27bf95a975f20edf0f17660d9c1b07dc0609ef"
] | [
"probe_moongen/plot-bat-csv.py"
] | [
"import plotly\n# from plotly.graph_objs import Scatter, Layout\nimport pandas as pd\nimport numpy as np\nimport plotly.plotly as py\nimport plotly.graph_objs as go\nimport socket\nimport os\nimport time\n\n#UDP_IP = \"10.10.1.15\"\n#UDP_PORT = 55555\n#sock = socket.socket(socket.AF_INET, # Internet\n# ... | [
[
"pandas.read_csv"
]
] |
Tony607/keras_mixup_generator | [
"a510b3f7f909055b64a308bb8e94dc9e0d66e29c"
] | [
"mixup_generator.py"
] | [
"import numpy as np\n\n\nclass MixupImageDataGenerator():\n def __init__(self, generator, directory, batch_size, img_height, img_width, alpha=0.2, subset=None):\n \"\"\"Constructor for mixup image data generator.\n\n Arguments:\n generator {object} -- An instance of Keras ImageDataGenera... | [
[
"numpy.random.beta"
]
] |
Nitin-Mane/MMDET | [
"7410b25f27c200719482955cb4a8a1c381e67e04"
] | [
"mmdet/datasets/imagenet.py"
] | [
"import numpy as np\n\nfrom .custom import CustomDataset\nfrom .custom_pair import CustomPairDataset\nfrom .custom_block import CustomBlockDataset\nfrom .registry import DATASETS\n\n\n@DATASETS.register_module\nclass ImageNetDETVIDDataset(CustomDataset):\n\n CLASSES = ('airplane','antelope','bear','bicycle','bir... | [
[
"numpy.array"
]
] |
YuJiang01/n2nnmn | [
"f0d751313ca756fe40ece1a7bbb0205ab899adf8"
] | [
"exp_clevr/train_clevr_rl_gt_layout.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport argparse\nparser = argparse.ArgumentParser()\nparser.add_argument('--gpu_id', type=int, default=0)\nparser.add_argument(\n '--pretrained_model',\n default='./exp_clevr/tfmodel/clevr_gt_layout/00050000')\nargs = parser.parse_args()\n\n... | [
[
"tensorflow.control_dependencies",
"tensorflow.global_variables",
"numpy.all",
"numpy.mean",
"tensorflow.GPUOptions",
"tensorflow.train.AdamOptimizer",
"tensorflow.get_default_graph",
"tensorflow.summary.scalar",
"tensorflow.add_n",
"tensorflow.assign_add",
"tensorflow.... |
bgraille/pylbm | [
"fd4419933e05b85be364232fddedfcb4f7275e1f"
] | [
"demo/2D/lid_driven_cavity_2.py"
] | [
"# Authors:\n# Loic Gouarin <loic.gouarin@polytechnique.edu>\n# Benjamin Graille <benjamin.graille@math.u-psud.fr>\n#\n# License: BSD 3 clause\n\n\"\"\"\nSimulate the lid driven cavity\n\ndt rho + dx qx + dy qy = 0\ndt qx + dx (qx^2/rho + c^2 rho) + dy (qx*qy/rho) = 0\ndt qy + dx (qx*qy/rho) + dy (qy^2/rho ... | [
[
"numpy.abs",
"numpy.sqrt",
"numpy.random.rand",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
rddy/ReQueST | [
"fffe8e60eae1550843da3e32ff1a0e81ef35938a"
] | [
"rqst/envs.py"
] | [
"# python3\n# Copyright 2019 DeepMind Technologies Limited\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 ... | [
[
"numpy.sqrt",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"numpy.concatenate",
"numpy.arctan2",
"numpy.exp",
"numpy.unique",
"numpy.arange",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.sin",
"numpy.argmax",
"numpy.zeros",
"numpy.random.choice",
"numpy.array",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.