repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tsbiosky/Cascade-point-rcnn | [
"ab9f7559e2f91cea00fb98cdc20e33accadc0f14"
] | [
"tools/kitti_object_eval_python/eval.py"
] | [
"import numpy as np\nimport numba\nimport io as sysio\nfrom tools.kitti_object_eval_python.rotate_iou import rotate_iou_gpu_eval\n\n\n@numba.jit\ndef get_thresholds(scores: np.ndarray, num_gt, num_sample_pts=41):\n scores.sort()\n scores = scores[::-1]\n current_recall = 0\n thresholds = []\n for i, ... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.stack",
"numpy.cos",
"numpy.linspace"
]
] |
nicoladimauro/GPU | [
"43a2743d1cca4a9517b1f8b53018fca9d62816f6"
] | [
"gpu.py"
] | [
"import os\nimport csv \nimport numpy as np\n\nimport arff\nfrom sklearn.svm import SVC\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.metrics import precision_score, recall_score, f1_score, make_scorer\nfrom sklearn.model_selection import StratifiedKFold, StratifiedShuffleSplit\nfrom sklearn.model_... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.mean",
"sklearn.svm.SVC",
"numpy.loadtxt",
"numpy.argsort",
"sklearn.metrics.make_scorer",
"sklearn.model_selection.StratifiedShuffleSplit",
"sklearn.metrics.precision_score",
"sklearn.metrics.f1_score",
"skl... |
ian-r-rose/visualization | [
"ed6d9fab95eb125e7340ab3fad3ed114ed3214af"
] | [
"docker/src/clawpack-5.3.1/pyclaw/src/pyclaw/classic/setup.py"
] | [
"#!/usr/bin/env python\n\nimport os\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('classic', parent_package, top_path)\n\n config.add_extension('classic1',\n ['limiter.f90','philim.f90','step1.f9... | [
[
"numpy.distutils.misc_util.Configuration"
]
] |
gmum/uncertainty-baselines | [
"63df2e5f29cdaefe49626439bbe13289f37eed36"
] | [
"uncertainty_baselines/models/models_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Uncertainty Baselines 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# Unles... | [
[
"tensorflow.test.main"
]
] |
herjy/BlendingToolKit | [
"f36dfa45cf96b182a9e0c87d163edfc10e8237d8"
] | [
"btk/utils.py"
] | [
"\"\"\"Contains functions to perform detection, deblending and measurement\n on images.\n\"\"\"\nfrom btk import measure\nimport btk.create_blend_generator\nimport numpy as np\nimport astropy.table\nimport skimage.feature\n\n\nclass SEP_params(measure.Measurement_params):\n \"\"\"Class to perform detection an... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"numpy.where",
"numpy.std",
"numpy.stack",
"numpy.random.randint",
"numpy.hypot",
"numpy.transpose",
"numpy.abs",
"numpy.random.random",
"numpy.unique"
... |
thepeytongreen/pyCGM | [
"c5a55dec675747a5c2d07e171d5bd2d046218ad5"
] | [
"pyCGM_Single/tests/test_csvOutput.py"
] | [
"import pytest\nimport numpy as np\nimport os\nimport sys\nimport tempfile\nfrom shutil import rmtree\nfrom pyCGM_Single.pyCGM_Helpers import getfilenames\nfrom pyCGM_Single.pycgmCalc import calcAngles, calcKinetics\nfrom pyCGM_Single.pycgmIO import dataAsDict, loadData, loadVSK, writeResult\nfrom pyCGM_Single.pycg... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
skamdar/gesture_recognition | [
"87613dcf923e2c518e2d58853d6b6bb9a8296d17"
] | [
"utils/grit_json.py"
] | [
"# convert annotation data in csv file to dict and dump the dict in json format.\n# dict looks as follow:\n\n# {'labels': ['ApplyEyeMakeup', 'ApplyLipstick', ...],\n#\n# 'database': {'v_ApplyEyeMakeup_g08_c01': {'subset': 'training', 'annotations': {'lable': 'ApplyEyeMakeup'}},\n# 'v_ApplyLipst... | [
[
"pandas.read_csv"
]
] |
haoxiangyang89/COVID_Staged_Alert | [
"4c2cc5ef1d38c140875380a5f10a0fe1eaf8a47a"
] | [
"InterventionsMIP/reporting/plotting.py"
] | [
"'''\nModule for plotting function\n'''\nimport os\nimport sys\nimport numpy as np\nimport pandas as pd\nimport time\nimport argparse\nimport calendar as py_cal\nfrom pathlib import Path\nfrom matplotlib import pyplot as plt\nfrom matplotlib.ticker import FuncFormatter\nimport matplotlib.dates as mdates\nimport mat... | [
[
"numpy.quantile",
"numpy.mean",
"numpy.max",
"numpy.empty",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.argmax",
"matplotlib.pyplot.tight_layout",
"matplotlib.colors.to_rgb",
"matplotlib.pyplot.subplots_adjust",
"numpy.square",
"numpy.array",
... |
qiaw99/Data-Structure | [
"3b1cdce96d4f35329ccfec29c03de57378ef0552"
] | [
"Computerorietierte_Mathematik/U8/run7_3.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# n ist das minimum zwischen a und b. Dann müssen wir uns zuerst für das minimum entscheiden.\n# kmin = n - 1 + 1 = n\n# kmax = 2(n - 1) + 1 = 2n - 1\ndef ggT_tumb(a, b):\n ggt = 1\n counter = 1\n temp... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"numpy.random.randint",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
lilanka/Falcon | [
"57a866b6a5e467684a3f45a36ec2b51c5bd097c0"
] | [
"falcon/fprob/binomial.test.py"
] | [
"import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom fstat.distributions import D\n\nif __name__ == \"__main__\":\n data = np.random.rand(2000)\n \n \"\"\"\n b1 = D.binomial(5, 3, data)\n b2 = D.binomial(20, 12, data)\n b3 = D.binomial(100, 60, data)\n b4 = D.binomial(1000, 600, data)\n\n... | [
[
"matplotlib.pyplot.show",
"numpy.random.rand",
"matplotlib.pyplot.subplots"
]
] |
Eternity666/DREAMPlace | [
"f694cddc39486e3ef2d5ae36431d8b21d1c397bd"
] | [
"dreamplace/PlaceObj.py"
] | [
"##\n# @file PlaceObj.py\n# @author Yibo Lin\n# @date Jul 2018\n# @brief Placement model class defining the placement objective.\n#\n\nimport os\nimport sys\nimport time\nimport numpy as np\nimport itertools\nimport logging\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.n... | [
[
"torch.zeros",
"numpy.square",
"torch.cat",
"torch.stack",
"torch.rand_like",
"torch.autograd.Variable",
"torch.no_grad",
"torch.from_numpy",
"torch.tensor",
"numpy.amax",
"torch.pow"
]
] |
NCAR-ASP-2021/hydro_tutorial_asp2021 | [
"9045417d10503d1718f50c9194d6d126b4b16ba1"
] | [
"utils.py"
] | [
"import numpy as np\nfrom scipy import optimize\nimport matplotlib.pyplot as plt\n\ndef damop_model(runoffarr, dt, catcharea, kappa, hmax, hmin, wmax, wmin, rmax, sigma):\n print()\n print('damop_model has been called with the constraints:')\n print('wmax = ',wmax,' wmin = ',wmin,' hmax = ',hmax,' hm... | [
[
"numpy.concatenate",
"numpy.dot",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"numpy.copy",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.ones",
"numpy.where",
"numpy.random.randn... |
ORFMark/Misc_Projects_and_Programs | [
"8984b73f36a58e69c569ea1be4a2c193b7ba1061"
] | [
"Graphs/Lab_2_Vector_Cartesian_Refrence.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.patches import Ellipse\nells = [];\nxUncertain = 0.0001\nyUncertain = 0\nvectors = [[0.0, .10462 * 9.81,'#345678']\n , [(90.1/360)*(2*3.14), .15441 * 9.81,'#338458']\n , [(235.6/360)*(2*3.14), .18657 * 9.81,'#582341']]\nfig, a... | [
[
"numpy.sin",
"numpy.random.rand",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.patches.Ellipse",
"numpy.cos",
"matplotlib.pyplot.show"
]
] |
forallx94/Korean-license-plate-Generator | [
"d34a488680b93a4f09b8efc97d5fe33ac5f82d74"
] | [
"Eletronic_Generator_original.py"
] | [
"import os, random\nimport cv2, argparse\nimport numpy as np\n\ndef random_bright(img):\n img = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)\n img = np.array(img, dtype=np.float64)\n random_bright = .5 + np.random.uniform()\n img[:, :, 2] = img[:, :, 2] * random_bright\n img[:, :, 2][img[:, :, 2] > 255] = 25... | [
[
"numpy.array",
"numpy.random.uniform"
]
] |
blynotes/CS6301_SDN | [
"7db92b6273222ddce28aaa238678a40fbd435b25"
] | [
"Code/src/old/sparkStatisticalMethods.py"
] | [
"from __future__ import print_function\n\n# https://spark.apache.org/docs/2.3.0/api/python/pyspark.html\nfrom pyspark import SparkConf, SparkContext\n# https://spark.apache.org/docs/2.3.0/api/python/pyspark.streaming.html\nfrom pyspark.streaming import StreamingContext\n# https://spark.apache.org/docs/2.3.0/api/pyt... | [
[
"numpy.array"
]
] |
lfrommelt/monty | [
"e8cabf0e4ac01ab3d97eecee5e699139076d6544"
] | [
"2018/11/code.py"
] | [
"import numpy as np\n\n\ndef _UnitStep(x):\n return np.heaviside(x.real, 1)\n\ndef _x(t):\n return (((-1/4 * np.sin(10/7 - 23 * t) -\n 3/10 * np.sin(4/3 - 22 * t) -\n 2/5 * np.sin(7/5 - 19 * t) -\n 1/5 * np.sin(7/5 - 16 * t) -\n 3/7 * np.sin(10/7 - 15 * t) -\n 3/8 * np.sin(13/9 - 9 * t) -\... | [
[
"numpy.full",
"numpy.sin",
"numpy.heaviside",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.rc",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.subplot"
]
] |
hurschler/pig-face-recognition | [
"5834f3c89448a645ee0eaf2bbdade064f0c4be93"
] | [
"augmentation/data_aug_edge_det.py"
] | [
"import glob\n\nimport mpimg as mpimg\nimport numpy as np\nimport cv2\nimport os\nimport scipy.misc as sm\nimport tensorflow as tf\nfrom keras.preprocessing.image import load_img\nfrom PIL import Image as Pil_Image\nfrom matplotlib import pyplot as plt\nfrom IPython.display import display, HTML\nfrom scipy import n... | [
[
"matplotlib.pyplot.subplot",
"numpy.array",
"scipy.ndimage.filters.convolve",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"numpy.hypot",
"numpy.arctan2",
"matplotlib.pyp... |
alexbjorling/nanomax-analysis-utils | [
"e208d098243e28a90004c6e1c5fb69251177d23e"
] | [
"nmutils/gui/scanViewer/widgets/ScalarWidget.py"
] | [
"from silx.gui import qt\nimport numpy as np\n\nfrom .MapWidget import MapWidget\nfrom .Base import PairedWidgetBase\n\nclass ScalarWidget(PairedWidgetBase):\n # This widget defines a MapWidget and and normal text label and describes\n # how they are related by data operations.\n def __init__(self, parent=... | [
[
"numpy.where",
"numpy.sum",
"numpy.zeros",
"numpy.mean"
]
] |
ricardoperezf/MLExamples | [
"058dbda967dbf6e83dbc7562a70ee8d3e453d539"
] | [
"FlowerDetection/app.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport mglearn\nimport pandas as pd\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\n\niris_dataset = load_iris()\n\n# print(\"Keys of iris_dataset: \\n{}\".format(... | [
[
"numpy.array",
"pandas.DataFrame",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.mean",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_iris"
]
] |
mhuen/TFScripts | [
"4ade57237efcd9ce5332532d8bcc399a06bcddf2"
] | [
"tfscripts/compat/v1/core.py"
] | [
"'''\nCore functions of tfscripts.compat.v1:\n\n Add residuals, batch normalisation, activation,\n'''\n\nfrom __future__ import division, print_function\n\nimport numpy as np\nimport tensorflow as tf\n\n# tfscripts.compat.v1 specific imports\nfrom tfscripts.compat.v1.weights import new_weights\n\n# constants\nfr... | [
[
"tensorflow.exp",
"tensorflow.compat.v1.assign",
"tensorflow.zeros",
"tensorflow.concat",
"tensorflow.nn.relu",
"tensorflow.ones",
"tensorflow.nn.relu6",
"tensorflow.strided_slice",
"tensorflow.nn.moments",
"tensorflow.constant",
"tensorflow.sign",
"tensorflow.zeros... |
rychallener/theresa | [
"886c6b74bee2edef7df9b6b54ce6d97de4aa4421"
] | [
"theresa/lib/utils.py"
] | [
"import numpy as np\nimport pickle\nimport theano\nimport time\nimport constants as c\nimport scipy.constants as sc\nimport scipy.interpolate as spi\nimport eigen\nimport starry\nimport progressbar\nimport theano\nimport theano.tensor as tt\nimport mc3.stats as ms\nfrom numba import njit\n\ndef initsystem(fit, ydeg... | [
[
"numpy.exp",
"numpy.mean",
"numpy.min",
"numpy.where",
"numpy.cos",
"numpy.size",
"numpy.max",
"numpy.sin",
"numpy.trapz",
"numpy.sqrt",
"scipy.interpolate.interp1d",
"numpy.zeros",
"numpy.diff",
"numpy.std",
"numpy.loadtxt",
"numpy.amax",
"numpy... |
huangxiang701/polymerNEN | [
"df5d706a881666dac7c38e7151caea8a58862de4"
] | [
"src/trainer/train_vect_data.py"
] | [
"\"\"\"\nCopyright (C) 2019 University of Massachusetts Amherst.\nThis file is part of \"expLinkage\"\nhttp://github.com/iesl/expLinkage\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\nhttp... | [
[
"torch.save",
"torch.cuda.is_available"
]
] |
FranklinBF/drl_girls_melodic | [
"20d44e5748d628e5a04d3b2a8106f420d834f41c"
] | [
"rl_agent/src/rl_agent/env_wrapper/ros_env_raw_scan_prep_wp.py"
] | [
"'''\n @name: ros_env_raw_scan_prep_wo.py\n @brief: This class is a simulation environment wrapper for\n the Polar Representation.\n @author: Ronja Gueldenring\n @version: 3.5\n @date: 2019/04/05\n'''\n\n# python relevant\nimport numpy as np\nimport math\n# ros-relev... | [
[
"numpy.divide",
"numpy.ones",
"numpy.zeros"
]
] |
alexmlamb/mimicry | [
"be030fb24a79c9bd50843d188d930c01e2260f45"
] | [
"torch_mimicry/nets/infomax_gan/attention.py"
] | [
"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_mimicry.nets.infomax_gan.sparse_attn import SparseAttention\n\nclass ScaledDotProductAttention(nn.Module):\n ''' Scaled Dot-Product Attention '''\n\n def __init__(self, temperature, dropout=0.1):\n super().__init__()\n ... | [
[
"torch.nn.Dropout",
"torch.matmul",
"torch.nn.functional.softmax"
]
] |
Pandinosaurus/Colorization | [
"a1d84d12fa29040b79c4001e3de8e2a77916b43e"
] | [
"atari_diverse/loss.py"
] | [
"import torch\nimport torch.nn as nn\n\nmaeloss = nn.L1Loss()\nmseloss = nn.MSELoss()\nsoftplus = nn.Softplus()\n\n\nclass DecomposeLossCalculator:\n def __init__(self):\n pass\n\n @staticmethod\n def content_loss(y: torch.Tensor, t: torch.Tensor) -> torch.Tensor:\n return torch.mean(torch.ab... | [
[
"torch.nn.MSELoss",
"torch.nn.L1Loss",
"torch.abs",
"torch.nn.ReLU",
"torch.nn.Softplus",
"torch.ones_like",
"torch.mean",
"torch.pow"
]
] |
Valentyn1997/oct-diagn-semi-supervised | [
"6fb5803fba23a8ad875235c90361be1a37eeeb72"
] | [
"src/data/transforms.py"
] | [
"import numpy as np\nfrom PIL import Image\nfrom src.data.rand_augment import RandAugmentMC\nimport torchvision.transforms as transforms\n\n\ndef pad(x, border=4):\n return np.pad(x, [(0, 0), (border, border), (border, border)], mode='reflect')\n\n\nclass RandomPadandCrop(object):\n \"\"\"Crop randomly the im... | [
[
"numpy.pad",
"numpy.random.randint",
"numpy.transpose"
]
] |
vsinic/deep_rl_trader | [
"1aafa451f0f00ad3e27c43241a596a62d608ba72"
] | [
"ddqn_rl_trader.py"
] | [
"import numpy as np\n\n# import keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Flatten, CuDNNLSTM\nfrom keras.optimizers import Adam\n\n# keras-rl agent\nfrom rl.agents.dqn import DQNAgent\nfrom rl.policy import BoltzmannQPolicy, EpsGreedyQPolicy\nfrom rl.memory import Seque... | [
[
"numpy.random.seed",
"numpy.array"
]
] |
BearerPipelineTest/Cirq | [
"640ef8f82d6a56ec95361388ce7976e096cca906"
] | [
"cirq-core/cirq/sim/density_matrix_simulation_state_test.py"
] | [
"# Copyright 2021 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"numpy.full",
"numpy.array",
"numpy.random.RandomState",
"numpy.testing.assert_almost_equal",
"numpy.sqrt"
]
] |
superkerokero/hinabe | [
"9fa00d1cbdee2b046426c8ed0c7c269556125337"
] | [
"naruhodo/utils/misc.py"
] | [
"\"\"\"\nModule for miscellaneous utility functions.\n\"\"\"\nimport re\nimport json\nfrom math import sqrt\nimport numpy as np\nimport networkx as nx\nfrom nxpd import draw\nfrom naruhodo.utils.dicts import NodeType2StyleDict, NodeType2ColorDict, NodeType2FontColorDict, EdgeType2StyleDict, EdgeType2ColorDict\n\n\n... | [
[
"numpy.average",
"numpy.dot"
]
] |
skyw/NeMo | [
"3886aa251f7be7c2e43aeb7315afc6b8924228aa"
] | [
"nemo/collections/asr/models/ctc_models.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.no_grad",
"torch.cuda.is_available"
]
] |
KsanaKozlova/sdc | [
"70b5ae813243d120571eec908e3b7bf1178cb8dd"
] | [
"sdc/tests/test_compile_time.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2019-2020, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redist... | [
[
"numpy.ones",
"numpy.arange"
]
] |
luisgrivas/name-correction | [
"1de4a2146a8d8ae50d340a580e79720f2866653a"
] | [
"distance.py"
] | [
"import numpy as np\n\nletters = 'abcdefghijklmnopqrstuvwxyz'\n\n\ndef splits(string):\n return [(string[:i], string[i:]) for i in range(len(string) + 1)]\n\n\ndef transposes(string):\n all_splits = splits(string)\n return [L + R[1] + R[0] + R[2:] for L, R in all_splits if len(R) > 1]\n\n\ndef deletes(stri... | [
[
"numpy.zeros"
]
] |
energeeks/ashrae-energy-prediction | [
"2b15a3749dd5810df228f99d7c23d62234117a1f"
] | [
"src/features/build_features.py"
] | [
"import os\n\nimport click\nimport math\nimport numpy as np\nimport pandas as pd\nimport yaml\nfrom meteocalc import feels_like\n\nfrom src.timer import timer\n\n\n@click.command()\n@click.argument('data_dir', type=click.Path(exists=True))\n@click.argument('output_filepath', type=click.Path())\ndef click_main(data_... | [
[
"pandas.read_pickle",
"numpy.sin",
"numpy.log",
"numpy.mean",
"numpy.std",
"pandas.Categorical",
"numpy.cos",
"pandas.concat",
"pandas.read_csv",
"pandas.read_feather"
]
] |
welgazil/DeDTW | [
"05d46c68122521dfe706736aaff24d6f99807e6e"
] | [
"deepspeech_pytorch/loader/spec_augment.py"
] | [
"# Copyright 2019 RnD at Spoon Radio\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 ... | [
[
"matplotlib.use",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"torch.tensor",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
]
] |
tuannv0898/uwb-ips | [
"d790e75e6f5da916701b11a2fdf3e03b6a47086b"
] | [
"software/linux/gateway/mavlink-1.0.13/pymavlink/tools/mavgraph.py"
] | [
"#!/usr/bin/env python\n'''\ngraph a MAVLink log file\nAndrew Tridgell August 2011\n'''\nfrom __future__ import print_function\nfrom builtins import input\nfrom builtins import range\n\nimport datetime\nimport matplotlib\nimport os\nimport re\nimport sys\nimport time\nfrom math import *\n\ntry:\n from pymavlink.... | [
[
"matplotlib.use",
"matplotlib.dates.DateFormatter",
"matplotlib.dates.SecondLocator"
]
] |
mramospe/minkit | [
"fa6808a6ca8063751da92f683f2b810a0690a462"
] | [
"performance/timing/roofit_script.py"
] | [
"#!/usr/bin/env python\n########################################\n# MIT License\n#\n# Copyright (c) 2020 Miguel Ramos Pernas\n########################################\n'''\nGenerate a sample using the RooFit package.\n'''\nimport time\nimport argparse\nimport roofit_models\nimport multiprocessing\nimport numpy as n... | [
[
"numpy.empty"
]
] |
catycaldwell/CNTK | [
"86a20080b19255b96ada85b6a7ab6b8e7be7465b"
] | [
"bindings/python/setup.py"
] | [
"import sys\nimport os\nimport shutil\nfrom glob import glob\nimport platform\nfrom warnings import warn\nfrom setuptools import setup, Extension, find_packages\nimport numpy\n\nIS_WINDOWS = platform.system() == 'Windows'\n\n# TODO should handle swig path specified via build_ext --swig-path\nif os.system('swig -ver... | [
[
"numpy.get_include"
]
] |
eljost/QCElemental | [
"c6de3a330f686f5dad0a7f4cb0fcf2bf55a549e2"
] | [
"qcelemental/util/test_scipy_hungarian.py"
] | [
"# [Apr 2019] stolen directly from scipy so I can test getting an array back\n# https://github.com/scipy/scipy/blob/master/scipy/optimize/tests/test_hungarian.py\n# * change imports to local\n# * skip importing and testing `matrix`\n# * add testing of reduced cost for non-T (reduced matrix for T is differen... | [
[
"numpy.array",
"numpy.asarray",
"numpy.testing.assert_array_equal",
"numpy.identity",
"numpy.sort"
]
] |
JohnHuCC/mlintro | [
"6b5ca7ea7f8658d14ac0fa50c9d1514cfa2bdb6c"
] | [
"Neural_Network_classifier.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nimport os\nfrom sklearn import datasets\nfrom tensorflow.contrib.learn.python import SKCompat\nfrom pandas import DataFrame\nimport torch\nimport torch.nn.functional as F\nfrom sklearn.discri... | [
[
"tensorflow.matmul",
"numpy.random.normal",
"tensorflow.contrib.learn.DNNClassifier",
"tensorflow.Variable",
"numpy.arange",
"sklearn.datasets.make_circles",
"numpy.array",
"matplotlib.pyplot.pcolormesh",
"tensorflow.train.AdamOptimizer",
"tensorflow.initialize_all_variable... |
huyalvchuan/CenterNet | [
"66ff00b618919f04b4f30ce9d37b7b11727b8c1d"
] | [
"src/lib/models/utils.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\n\ndef _sigmoid(x):\n y = torch.clamp(x.sigmoid_(), min=1e-4, max=1-1e-4)\n return y\n\ndef _gather_feat(feat, ind, mask=None):\n dim = feat.size(2)\n ind ... | [
[
"torch.flip"
]
] |
Alexanders101/SPANet | [
"20731bb271b23f0746243e79203ff6b77556c852"
] | [
"spanet/network/symmetric_attention/symmetric_attention_base.py"
] | [
"from typing import List, Tuple\n\nimport torch\nfrom torch import nn\n\nfrom spanet.options import Options\nfrom spanet.network.utilities.group_theory import complete_indices, symmetry_group\n\n\n# noinspection SpellCheckingInspection\nclass SymmetricAttentionBase(nn.Module):\n WEIGHTS_INDEX_NAMES = \"ijklmn\"\... | [
[
"torch.scalar_tensor"
]
] |
Milos9304/GasStationPrediction | [
"12d294d743e37cfdeb82553e4299a43ba76848f9"
] | [
"main.py"
] | [
"import pandas as pd\nfrom sklearn.neighbors import KNeighborsRegressor\nfrom sklearn.model_selection import KFold\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.svm import SVR\nfrom sklearn.metrics import classification_report, confusion_matrix, mean_squared_error\nimport numpy as np\nimport matplot... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.mean",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.model_selection.KFold",
"pandas.read_csv"
]
] |
erdogant/clusteval | [
"618e8133bb4bc2eb23f0d9ff83f944aa3ebe2aad"
] | [
"clusteval/examples.py"
] | [
"# EXAMPLE\nfrom sklearn.datasets import make_blobs\nimport clusteval\nprint(clusteval.__version__)\nprint(dir(clusteval))\n\nfrom clusteval import clusteval\n\n# %%\nfrom sklearn.datasets import make_blobs\n\nfrom clusteval import clusteval\nce = clusteval(cluster='dbscan')\nX, labels_true = make_blobs(n_samples=5... | [
[
"sklearn.preprocessing.Normalizer",
"sklearn.datasets.make_blobs",
"sklearn.pipeline.make_pipeline",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.decomposition.TruncatedSVD"
]
] |
melorian94/minerl_imitation_learning | [
"3297909ab85a562da304175c7ab126849ad75070"
] | [
"model.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nimport math\n\n\nclass Network(nn.Module):\n def __init__(self, num_actions, image_channels, vec_size, cnn_module, hidden_size=256,\n dueling=True, double_channels=False):\n super().__init__()\n\n self.nu... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.ones",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu"
]
] |
quepas/ScenarioDomainModel | [
"ee351b7bd3629af0c1d1d800dcc5ac5426b9b804"
] | [
"domain_model/model.py"
] | [
"\"\"\" Class Model\n\nCreation date: 2018 10 30\nAuthor(s): Erwin de Gelder\n\nModifications:\n2018 11 05: Make code PEP8 compliant.\n2018 11 07: Make seperate classes for each type of model. Model itself becomes abstract class.\n2018 11 12: Add fit method to all models.\n2018 11 19: Make it possible to instantiat... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.dot",
"numpy.argmin",
"scipy.interpolate.splrep",
"numpy.min",
"numpy.mean",
"numpy.linalg.lstsq",
"numpy.argmax",
"numpy.arange",
"numpy.linalg.svd",
"numpy.cos",
"scipy.interpolate.sp... |
jaberg/scikits-image | [
"eccc41907135cf81b99c4be18a480a9bc705485d",
"eccc41907135cf81b99c4be18a480a9bc705485d"
] | [
"skimage/transform/tests/test_hough_transform.py",
"skimage/filter/setup.py"
] | [
"import numpy as np\nfrom numpy.testing import *\n\nimport skimage.transform as tf\nimport skimage.transform.hough_transform as ht\nfrom skimage.transform import probabilistic_hough\n\n\ndef append_desc(func, description):\n \"\"\"Append the test function ``func`` and append\n ``description`` to its name.\n ... | [
[
"numpy.linspace",
"numpy.zeros"
],
[
"numpy.distutils.misc_util.Configuration",
"numpy.distutils.misc_util.get_numpy_include_dirs"
]
] |
XuYunqiu/DRN-WSOD-pytorch | [
"f08b97b912daf8a8ffd6f3ec5fd58c5026c08098"
] | [
"projects/WSL/wsl/data/datasets/builtin.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\n\n\"\"\"\nThis file registers pre-defined datasets at hard-coded paths, and their metadata.\n\nWe hard-code metadata for common datasets. This will enable:\n1. Consistency check when loading the datasets\n2. Use mode... | [
[
"numpy.uint8",
"numpy.zeros"
]
] |
datarevenue-berlin/sparsity | [
"cabac15148b473600ac61572152b28273bdb0158"
] | [
"sparsity/sparse_frame.py"
] | [
"# coding=utf-8\nimport functools\nimport traceback\nimport warnings\nfrom collections import OrderedDict\nfrom functools import partial, reduce\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.api import types\nfrom pandas.core.common import _default_index\n\ntry:\n from pandas.indexes.base import _ensur... | [
[
"numpy.array_equal",
"scipy.sparse.isspmatrix_csr",
"numpy.issubdtype",
"pandas.api.types.is_categorical_dtype",
"numpy.broadcast_to",
"numpy.concatenate",
"numpy.empty",
"pandas.DataFrame",
"numpy.arange",
"scipy.sparse.csr_matrix",
"scipy.sparse.coo_matrix",
"nump... |
icannistraci/nerfmm | [
"514ae420f41ba5b6447be853f73e37beca136f85"
] | [
"utils/comp_ray_dir.py"
] | [
"import torch\n\n\ndef comp_ray_dir_cam(H, W, focal):\n \"\"\"Compute ray directions in the camera coordinate, which only depends on intrinsics.\n This could be further transformed to world coordinate later, using camera poses.\n :return: (H, W, 3) torch.float32\n \"\"\"\n y, x = torch.meshgrid(torch... | [
[
"torch.stack",
"torch.arange",
"torch.ones"
]
] |
choi-jiwoo/financialdatapy | [
"a744252eab4bce981e3523c1b05dc0a3ddf445a0"
] | [
"financialdatapy/financials.py"
] | [
"\"\"\"This module states abstract class for financial statements.\"\"\"\nfrom abc import ABC, abstractmethod\nimport pandas as pd\nimport string\nfrom financialdatapy.request import Request\nfrom financialdatapy import search\n\n\nclass Financials(ABC):\n \"\"\"Abstract class representing financial statements o... | [
[
"pandas.to_datetime",
"pandas.to_numeric",
"pandas.read_html"
]
] |
aman16011/SML_Project_2019 | [
"77f8aaca91aa5505a0183c9ffaa1c9272883f073"
] | [
"code/main.py"
] | [
"import numpy as np\r\nfrom glob import glob\r\nfrom helper_function import *\r\nfrom scipy.signal import welch\r\nfrom sklearn.metrics import accuracy_score\r\nimport matplotlib.pyplot as plt \r\nimport pickle as pkl\r\n\r\n# # Assigning class labels\r\nlabels = {'tongue':0,'foot':1, 'left':2, 'right':3}\r\n# Data... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.load",
"matplotlib.pyplot.title",
"numpy.save",
"matplotlib.pyplot.ylabel",
"scipy.signal.welch"
]
] |
mtrebitsch/yt | [
"55c281448695bb9fe3b34920e43fd2f2ada2ad29"
] | [
"yt/visualization/plot_window.py"
] | [
"import abc\nfrom collections import defaultdict\nfrom functools import wraps\nfrom numbers import Number\nfrom typing import List, Optional, Type, Union\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom more_itertools import always_iterable\nfrom mpl_toolkits.axes_grid1 import ImageGr... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"matplotlib.mathtext.MathTextParser",
"numpy.nonzero",
"matplotlib.pyplot.figure",
"numpy.float64",
"numpy.nanmin",
"numpy.sqrt",
"numpy.isfinite",
"numpy.log10",
"matplotlib.ticker.ScalarFormatter",
"numpy.column_stack... |
adolgert/PyGSPN | [
"e8918357bf80d9f20f682ce39179a58b2378114e"
] | [
"gspn/distributions.py"
] | [
"import logging\nimport numpy as np\nimport scipy.stats\n\nlogger=logging.getLogger(__file__)\n\n\ndef anderson_sample_tester(distribution, now, cnt, rng):\n \"\"\"\n This checks whether hazard_integral and implicit_hazard_integral\n work by using them to sample a distribution.\n \"\"\"\n samples=np.... | [
[
"numpy.isinf",
"numpy.array",
"numpy.log",
"numpy.zeros",
"numpy.double",
"numpy.float",
"numpy.copy",
"numpy.exp",
"numpy.where",
"numpy.power",
"numpy.sqrt",
"numpy.all",
"numpy.hstack"
]
] |
sydroth/sydirv | [
"2a43aaadffaeee5974780e51e6936a5e9f82f01c"
] | [
".ipynb_checkpoints/Irv_EDA5-checkpoint.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\n# In[2]:\n\n\nbo_mojo = pd.read_csv('unzippedData/bom.movie_gross.csv')\n\n\n# In[3]:\n\n\nthe_numbers = pd.read_csv('unzippedData/tn.movie_budgets.csv')\n\n\... | [
[
"pandas.to_datetime",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
smerkousdavid/membrane-analysis | [
"f001db2a9ff836e304b8250531ef0d47882d5879"
] | [
"structure/test/fpw_measure.py"
] | [
"import unittest\nfrom analysis import make_fpw_measurements\nfrom tests.statistics import compare_statistics\nimport numpy as np\nimport math\nimport os\nimport cv2\n\n\nPY_PATH = os.path.dirname(os.path.realpath(__file__))\nIMAGE_FOLDER = os.path.join(PY_PATH, 'test_imgs')\nTEST_IMGS = [os.path.join(IMAGE_FOLDER,... | [
[
"numpy.ascontiguousarray",
"numpy.array",
"numpy.zeros"
]
] |
PML-UCF/pinn | [
"dcedf25f7154dccd9872df735a19c1f9bcfca50c"
] | [
"samples/cumulative_damage/propagation_walker_model/model.py"
] | [
"# ______ _ _ _ _ _ _ _ \n# | ___ \\ | | | | (_) (_) | | (_) \n# | |_/ / __ ___ | |__ __ _| |__ _| |_ ___| |_ _ ___ \n# | __/ '__/ _ \\| '_ \\ / _` | '_ \\| | | / __| __| |/ __|\n# | | | | | (_) | |_) | (_| | |_) | | | \\__ \\ |_| | (__ \n# \\_| |_| \... | [
[
"numpy.asarray",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.RNN",
"tensorflow.keras.models.Model",
"tensorflow.keras.Sequential",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.keras.layers.Concatenate"
]
] |
ruoqi-liu/DeepChatBot | [
"6e6a61ff6fffc3eee76295c4b25aea85e3b7886a"
] | [
"seq2seq.py"
] | [
"import tensorflow as tf\nimport tensorflow.contrib as contrib\nfrom utils import *\nfrom sklearn.model_selection import train_test_split\nimport numpy as np\nimport random\nfrom sklearn.metrics import mean_absolute_error\n\ndata = unpickle_file('generate_movie_dialogue.pkl')\nunknown_symbol = '*'\nstart_symbol = '... | [
[
"tensorflow.saved_model.utils.build_tensor_info",
"tensorflow.nn.embedding_lookup",
"tensorflow.global_variables_initializer",
"tensorflow.contrib.seq2seq.BahdanauAttention",
"tensorflow.cast",
"tensorflow.saved_model.signature_def_utils.build_signature_def",
"tensorflow.shape",
"t... |
ByronDev121/literature-review | [
"23c276e92534793d85c7af5c24d93603f8ee7678"
] | [
"literature-review/linear-regression/single_var_linear_regression.py"
] | [
"from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom single_var_gradient_decent import LinearRegressionUs... | [
[
"sklearn.metrics.mean_squared_error",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"sklearn.metri... |
ArseneLupinhb/py_al | [
"e2e4d25a00cb13d68da26c17f86f9cf1e47a79e1"
] | [
"learn/data_analysis/normal_data_analysis/seaborn_test.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pa\nimport seaborn as sb\n\n# 中文乱码\nplt.rcParams['font.sans-serif'] = ['SimHei']\nplt.rcParams['axes.unicode_minus'] = False\n\npath_random = r'C:\\Users\\AL\\Desktop\\test\\test.csv'\ntest_data_df = pa.read_csv(path_random)\ntest_data_df.head()\n# tick_label x轴对应标... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.bar"
]
] |
nontas/menpo | [
"d915bec26de64a5711b96be75cd145661a32290e"
] | [
"menpo/io/test/test_io_import.py"
] | [
"import sys\nimport warnings\n\nimport menpo.io as mio\nimport numpy as np\nfrom PIL import Image as PILImage\nfrom mock import patch, MagicMock\nfrom pytest import raises\n\n\ndef test_import_incorrect_built_in():\n with raises(ValueError):\n mio.import_builtin_asset('adskljasdlkajd.obj')\n\n\ndef test_b... | [
[
"numpy.all",
"numpy.allclose",
"numpy.isnan",
"numpy.zeros"
]
] |
nimeshgit/nyoka | [
"43bf049825922213eeb3e6a8f39864f9b75d01d5"
] | [
"nyoka/preprocessing/__init__.py"
] | [
"import queue\nimport numpy as np\nfrom sklearn.utils import check_array\nfrom sklearn.base import TransformerMixin\nFLOAT_DTYPES = (np.float64, np.float32, np.float16)\n\n\nclass Lag(TransformerMixin):\n \"\"\"\n The Lag class takes `value` number of previous record of the fields where it is applied and appl... | [
[
"sklearn.utils.check_array",
"numpy.array"
]
] |
AllTheLonelyPeople/Chips-Circuits | [
"55e97579f97e63f6219c14fe5c59ae761729248c"
] | [
"linespacer_ratioy.py"
] | [
"\"\"\"\npath.py\n\nTom Kamstra, Izhar Hamer, Julia Linde\n\nFinds the optimal paths between the chips based on ratio between distance in x direction and total distance between chips.\n\"\"\"\nfrom mpl_toolkits import mplot3d\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom code.classes import classes as ... | [
[
"numpy.meshgrid",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.axes"
]
] |
SLAMPAI/generalization-cellular-automata | [
"8758551eee455656156c48ecf72346fd1d315d75"
] | [
"run.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport data_generator as gen\nimport ca_unet as unet\nimport tensorflow as tf\nimport random\nimport argparse, pathlib\n\nparser = argparse.ArgumentParser(description='Generalization CA')\nparser.add_argument('--gen_level', help='Level of Generalization, try \"simple\", \"1\", \"2\", or ... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint"
]
] |
tinaba96/fn2q | [
"cbee3ecaf30563826172a3c2e86cd82458fe08e3"
] | [
"convert.py"
] | [
"#!/usr/bin/env python2.7\r\n\r\nimport caffe\r\nfrom caffe.proto import caffe_pb2\r\nimport sys, os\r\n\r\nimport torch\r\nimport torch.nn as nn\r\n\r\nimport argparse, tempfile\r\nimport numpy as np\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument('caffe_model', help='input model in hdf5 or caffem... | [
[
"numpy.array",
"numpy.loadtxt"
]
] |
mikstr/qml | [
"552e273da080a3a1fb9f8c466e4562b7d64ed6bd"
] | [
"tests/test_distance.py"
] | [
"# MIT License\n#\n# Copyright (c) 2017 Anders Steen Christensen\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 without limitation the rights\n# to... | [
[
"numpy.allclose",
"numpy.random.random",
"numpy.sqrt",
"numpy.zeros"
]
] |
jhouck/mne-python | [
"95facbd1a28e471cf81e1d86735fa272a66d13d1"
] | [
"mne/tests/test_annotations.py"
] | [
"# Authors: Jaakko Leppakangas <jaeilepp@student.jyu.fi>\n# Robert Luke <mail@robertluke.net>\n#\n# License: BSD-3-Clause\n\nfrom collections import OrderedDict\nfrom datetime import datetime, timezone\nfrom itertools import repeat\nimport sys\n\nimport os.path as op\n\nimport pytest\nfrom pytest import ap... | [
[
"numpy.repeat",
"numpy.testing.assert_allclose",
"numpy.where",
"numpy.full_like",
"numpy.empty",
"numpy.testing.assert_array_almost_equal",
"numpy.arange",
"numpy.isfinite",
"numpy.in1d",
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.random... |
wovert/ai_tutorials | [
"74ce45183bab777cf7f1778e58b0d38b817b750c"
] | [
"numpy/nmpy_array.py"
] | [
"# coding: utf-8\n\nimport numpy\n\n# 一维矩阵\nvector = numpy.array([5, 10, '15', 20.0])\n\n# 二维矩阵\nmatrix = numpy.array([[2, 4, 8], [20, 25, 30], [40, 45, 48]])\nprint(vector)\nprint(matrix)\n\n# 行和列\nprint(vector.shape)\nprint(type(vector))\n\n# 2行3列\nprint(matrix.shape)\n\none = matrix[1, 1]\nprint(one) # 25\n\npri... | [
[
"numpy.array"
]
] |
Womac/pyroomacoustics | [
"15a86425b68969b2109860ca3614f0cbf92b1bd0"
] | [
"pyroomacoustics/bss/common.py"
] | [
"# Common Functions used in BSS algorithms\n# Copyright (C) 2019 Robin Scheibler, Yaron Dibner, Virgile Hernicot, Juan Azcarreta\n# MIT License\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Softwa... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.tile",
"numpy.real",
"numpy.sign",
"numpy.finfo",
"numpy.conj",
"numpy.arange",
"numpy.abs",
"numpy.sqrt",
"numpy.imag",
"numpy.expand_dims"
]
] |
tinnguyen96/coupling-Gibbs-partition | [
"0238026cf3b491273ee19b9d1c9ee543c3458037"
] | [
"modules/predictive_experiment.py"
] | [
"\"\"\"\nReport the predictive density for DP posterior over gmm data.\n\"\"\"\n\n# Standard libaries \nimport argparse\nimport os\nfrom multiprocessing import Pool\nimport matplotlib.pyplot as plt\nimport seaborn as sb\nsb.set_context('paper', rc={'xtick.labelsize': 15, 'ytick.labelsize': 15, 'lines.markersize': 5... | [
[
"numpy.random.seed",
"numpy.set_printoptions",
"numpy.random.get_state",
"numpy.mean"
]
] |
wireless911/bert-text | [
"8a8b2775a2952d3bf99c445c0eb5e3937d221a33"
] | [
"sequence-label.py"
] | [
"import collections\nimport time\nimport torch\nfrom typing import Optional, Text\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nfrom transformers import BertTokenizer\n\nfrom trainer import SequenceLabelTrainer\nfrom config import SequenceLabelConfig\nfrom utils import... | [
[
"torch.utils.data.DataLoader"
]
] |
zhtianxiao/DLA-Combined-IoUs | [
"0b9db0e8e2b2927928bd57c6032497d3b87e7905"
] | [
"dynamic_atss_core/modeling/roi_heads/mask_head/roi_mask_predictors.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom dynamic_atss_core.layers import Conv2d\nfrom dynamic_atss_core.layers import ConvTranspose2d\nfrom dynamic_atss_core.modeling import registry\n\n\n@registry.ROI_MASK_PREDICTOR... | [
[
"torch.nn.init.kaiming_normal_",
"torch.nn.init.constant_"
]
] |
TomKingsfordUoA/emotion-recognition-using-speech | [
"d3e115e32c06c511e70cb50a92097bafd00d5e6c"
] | [
"emotion_recognition_using_speech/create_csv.py"
] | [
"import glob\nimport os\n\nimport pandas as pd\n\n\ndef write_emodb_csv(emotions=[\"sad\", \"neutral\", \"happy\"], train_name=\"train_emo.csv\",\n test_name=\"test_emo.csv\", train_size=0.8, verbose=1):\n \"\"\"\n Reads speech emodb dataset from directory and write it to a metadata CSV fil... | [
[
"pandas.DataFrame"
]
] |
Thundzz/advent-of-code-2021 | [
"e91cd8a5756566ad3f47e07a51b0beb5b9f5326c"
] | [
"py/day_11/solve.py"
] | [
"\nimport numpy as np\nimport itertools\n\ndef parse_input(filename):\n cavern = np.zeros((10, 10))\n with open(filename) as file:\n for idx, line in enumerate(file.readlines()):\n cavern[idx, :] = [int(c) for c in line.strip()]\n return cavern\n\ndef neighbours(i, j, max_size):\n ... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.argwhere"
]
] |
daoo/autodesk | [
"de5be9593a4d6eb873240ac4455507df3a87c89d"
] | [
"tests/unit/test_operation.py"
] | [
"from autodesk.operation import Operation\nfrom autodesk.states import INACTIVE, ACTIVE\nfrom datetime import date, time\nfrom pandas import Timestamp\nimport pytest\n\n\ndef combine(dates, times):\n return [Timestamp.combine(day, stroke)\n for day in dates for stroke in times]\n\n\nondates = [\n d... | [
[
"pandas.Timestamp.combine"
]
] |
wwjiang007/keras | [
"f630ad87a01ed2b4d08f91e5553b50c6a85601f6"
] | [
"keras/tests/automatic_outside_compilation_test.py"
] | [
"# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v2.compat.v1.enable_eager_execution",
"tensorflow.python.eager.context.set_soft_device_placement",
"tensorflow.compat.v2.tpu.experimental.initialize_tpu_system",
"tensorflow.compat.v2.config.experimental_connect_to_cluster",
"numpy.zeros",
"tensorflow.compat.v2.compat.v1... |
tbekolay/nengodocs-rtd | [
"f57b45d14cf5ad748267d15616d6f6c11f41a165"
] | [
"examples/spa_parser.py"
] | [
"\n# coding: utf-8\n\n## Nengo example: Parsing simple commands\n\n# This example is a simplified version\n# of the language parsing model presented in\n# [Stewart & Eliasmith, 2013](http://compneuro.uwaterloo.ca/publications/stewart2013.html).\n# Please refer to that paper for the high-level details.\n\n# In[ ]:\n... | [
[
"matplotlib.pyplot.figure"
]
] |
Javicadserres/dnetworks | [
"173f9dfa35ae1cff8dbeec3c1d24cb00990b41a6"
] | [
"tests/test_activations.py"
] | [
"import numpy as np\nimport dnetworks\n\nfrom dnetworks.layers import (\n ReLU, Sigmoid, Tanh, LeakyReLU, Softmax\n)\n\ndef test_relu():\n \"\"\"\n Tests ReLU activation class.\n \"\"\"\n Z = np.array([1, -1, 0])\n dA = np.array([2, 3, 5])\n\n expected_A = np.array([1, 0, 0])\n expected_dZ =... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
SnarkAttack/gaming_ml | [
"3f4e9ce6af73e60adcdd027341158eca8419bd54"
] | [
"src/mcts/mcts.py"
] | [
"import numpy as np\nfrom operator import attrgetter\n\nclass MCTSNode(object):\n\n def __init__(self, game, parent=None, c=2):\n\n self._game = game\n self._parent = parent\n self._children = []\n self._visits = 0\n self._value = 0\n # c is a constant value that can be ... | [
[
"numpy.log"
]
] |
gmjustforfun/code | [
"7551909edf61bddfeafdff223c2a3390661dc62f"
] | [
"examples/demo_de.py"
] | [
"import numpy as np\nimport math\nimport openpyxl\nimport pandas as pd\nimport matplotlib.pyplot as plt\n'''\nmin f(x1, x2, x3) = x1^2 + x2^2 + x3^2\ns.t.\n x1*x2 >= 1\n x1*x2 <= 5\n x2 + x3 = 1\n 0 <= x1, x2, x3 <= 5\n'''\n\"参数预设\"\n# [-100,100]\nset_lb_01 =np.ones(10)*(-100)\nset_ub_01 = np.ones(10)*1... | [
[
"numpy.random.rand",
"numpy.zeros",
"pandas.DataFrame",
"numpy.ones",
"pandas.ExcelWriter"
]
] |
bsouhaib/qf-tpp | [
"a5adf3f7203b920528c1c397329c4afd9039c3b4"
] | [
"code/dpp/flows/affine.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom torch.distributions import constraints\n\nfrom dpp.flows.base import Flow\nfrom dpp.nn import Hypernet\nfrom dpp.utils import clamp_preserve_gradients\n\n\nclass FixedAffine(Flow):\n \"\"\"Affine transformation y = ax + b with fixed parameters.\"\"\"\n domain = con... | [
[
"torch.tensor",
"torch.exp",
"torch.nn.Parameter"
]
] |
shouno/FS_MCMC | [
"624b437444d8fbf8034cf15c83b754f2f0cdd3e3"
] | [
"IsingModel/energy_state.py"
] | [
"#\n# -*- coding: utf-8 -*-\n#\n\nimport numpy as np\nfrom tqdm import tqdm\n\n# 全探索バージョン\n\n\nclass IsingModelMC:\n def __init__(self, size, beta=1., h=0.0, state=None, J=None):\n self.size = size\n if J is None: # Ferro\n self.Jmat = np.ones((size, size)) - np.eye(size)\n else... | [
[
"numpy.array",
"numpy.random.binomial",
"numpy.zeros",
"numpy.random.permutation",
"numpy.ones",
"numpy.exp",
"numpy.eye",
"numpy.random.uniform",
"numpy.hstack"
]
] |
Rahul-fix/stereo-depth | [
"b3722644ffe6268968bada1681cb2b6f4cd44a3b"
] | [
"src/models/joined_processing.py"
] | [
"import torch\nfrom torch import nn\nimport configparser\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nconfig = configparser.ConfigParser()\nconfig.read(\"configs/kitti.config\")\n\nin_channels = config.getint(\"Siamese\", \"channels\")\n\nheight = config.getint(\"Data\", \"height\... | [
[
"torch.nn.Sequential",
"torch.cuda.is_available",
"torch.Tensor"
]
] |
shi3z/image-gpt | [
"c996b872908d67a74cd5e79e6a5299f2fd5bee40"
] | [
"src/imgconv.py"
] | [
"# Sept. 5 2020 shi3z \n# MIT Licence\n\nimport os\nimport random\nfrom PIL import Image\nfrom imageio import imwrite\nimport numpy as np\n\nclusters = np.load(\"download/kmeans_centers.npy\")\n\n\n# Load Image \nim = Image.open('shi3z.png')\nim = im.resize((32,32))\n\nimr = np.array(im)\n\ndef dist(x,y): # Get E... | [
[
"numpy.array",
"numpy.sum",
"numpy.rint",
"numpy.load",
"numpy.save"
]
] |
pprp/pytorch-cifar-model-zoo | [
"e7e68d8162a77aee2161bcd3cd70c20ddd7ef7ab"
] | [
"lib/mutator/random_mutator.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom lib.mutables.spaces import InputSpace, OperationSpace, ValueSpace\n\nfrom .default_mutator import Mutator\n\n__all__ = [\n 'RandomMutator',\n]\n\n\nclass RandomMutator(Mutator):\n def __init__(self, model, *args, **kwargs):\n su... | [
[
"torch.randint",
"torch.nn.functional.one_hot",
"torch.randperm",
"torch.tensor"
]
] |
Asquidy/pyblp_alt | [
"cd3f79ddef51da8104df128399d6e981bf34f3bf"
] | [
"pyblp/construction.py"
] | [
"\"\"\"Data construction.\"\"\"\n\nfrom typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Union\n\nimport numpy as np\n\nfrom . import exceptions, options\nfrom .configurations.formulation import Formulation\nfrom .configurations.integration import Integration\nfrom .utilities.basics import Arra... | [
[
"numpy.full",
"numpy.fill_diagonal",
"numpy.vectorize",
"numpy.errstate",
"numpy.ascontiguousarray",
"numpy.sum",
"numpy.block",
"numpy.tile",
"numpy.eye",
"numpy.where",
"numpy.arange",
"numpy.sqrt",
"numpy.abs"
]
] |
waterljwant/UGV-KPNet | [
"99f9e3922cdbb8c1116cb3f807be3874133a1979"
] | [
"evaluate/tool_ugv_eval.py"
] | [
"__author__ = 'tsungyi'\n\nimport numpy as np\nimport datetime\nimport time\nfrom collections import defaultdict\n# from . import mask as maskUtils\nimport copy\n\n\nclass UGV_Eval:\n # Interface for evaluating detection on the Microsoft COCO dataset.\n #\n # The usage for CocoEval is as follows:\n # c... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.count_nonzero",
"numpy.logical_not",
"numpy.zeros",
"numpy.round",
"numpy.ones",
"numpy.exp",
"numpy.mean",
"numpy.where",
"numpy.argsort",
"numpy.cumsum",
"numpy.repeat",
"numpy.searchsorted",
... |
devmofl/M5_Accuracy_3rd | [
"b02bd4333520d71ff01b66c0446bb07324cfb0d1"
] | [
"pts/modules/distribution/constant.py"
] | [
"import torch\nfrom torch.distributions.distribution import Distribution\n\nclass ConstantDistribution(Distribution):\n r\"\"\"\n Creates a constant distribution, i.e. Var(x) = 0\n \n Args: \n loss_type: L1 or L2\n mu (Tensor): mean\n \"\"\"\n def __init__(self, loss_type, mu, val... | [
[
"torch.zeros_like",
"torch.ones_like",
"torch.abs",
"torch.Size"
]
] |
MagiMas/ArpesBandmass | [
"98785fabcb7977e110532a984d40971b915f09b3"
] | [
"Basefile.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import interp1d, interp2d\nfrom scipy.ndimage import convolve1d\n\nclass Spectra1D(object):\n \"\"\"\n Holds a 1d spectrum.\n \"\"\"\n\n def __init__(self, xdata, ydata, name=\"\", director... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.sin",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.sign",
"numpy.amin",
"numpy.amax",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"scipy.interpolate.interp2d",
"... |
guanshaoheng/DataGenerationPlastic | [
"11cd3f0398f18f1b6c1ab4f63dd6e90aea829642"
] | [
"Gaussian.py"
] | [
"import os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\n\nclass GuanssianRandomPath:\n \"\"\"\n Used for random loading path generation via Gaussian Process method\n \"\"\"\n def __init__(self, curlDegree, amplitudeValue, showFlag=False, maxEpsi... | [
[
"numpy.savetxt",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.exp",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.ones",
"matplotlib.pyplot.tight_layout",
... |
shah-newaz/vaxrank | [
"65832878f28ce44ccaaf47be3e0c6d38a1743988"
] | [
"vaxrank/report.py"
] | [
"# Copyright (c) 2016-2018. Mount Sinai School of Medicine\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"pandas.DataFrame.from_dict",
"pandas.ExcelWriter"
]
] |
nuno-chicoria/GHC_2018 | [
"d3a19c4f6293dd24ca06d24fdde58da04800781b"
] | [
"source_code/ghc2018.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 1 18:44:04 2018\n\n@author: JavaWizards\n\"\"\"\n\nimport numpy as np\n\nfile = \"/Users/nuno_chicoria/Downloads/b_should_be_easy.in\"\n\nhandle = open(file)\n\nR, C, F, N, B, T = handle.readline().split()\n\nrides = []\n\nindex = []\nfor... | [
[
"numpy.column_stack",
"numpy.asarray",
"numpy.delete"
]
] |
ArthurWangNet/Trading | [
"c7f39da2b7186f190b934725461b695521ab369b"
] | [
"4_update_fundamental_data.py"
] | [
"# This script will run after get fundamental data is done. It will update the latests data to production files.\nimport os\nimport Paths\nimport datetime\nimport pandas as pd\nimport multiprocessing as mp\nfrom multiprocessing import Pool\nimport time\nfrom joblib import Parallel, delayed\nimport tqdm\n\n# list al... | [
[
"pandas.concat"
]
] |
zaverichintan/Convolutional-Sequence-to-Sequence-Model-for-Human-Dynamics | [
"f12206e3a63ca9bc73763db11b4256d481d3829b"
] | [
"src/VAE/ops.py"
] | [
"import tensorflow as tf\n\n\ndef lrelu(x, leak=0.2, name=\"lrelu\"):\n return tf.maximum(x, leak*x)\n"
] | [
[
"tensorflow.maximum"
]
] |
sinharitesh/tutorials-masterclasses | [
"810bbbbb29ada64dd4e618d6ae9037ad0c2c4aca"
] | [
"pytorch-tutorial/Sess-1-Linear-Regression.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[80]:\n\n\nimport torch\nimport torch.nn as nn\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\n# In[81]:\n\n\nX = torch.randn(100, 1)*10\ny = X + 3*torch.randn(100, 1)\nplt.plot(X.numpy(), y.numpy(), 'o')\nplt.ylabel('y')\nplt.xlabel('x')\n\n\n# In[82]:\n\n\n... | [
[
"torch.nn.Linear",
"torch.nn.MSELoss",
"matplotlib.pyplot.xlabel",
"torch.no_grad",
"matplotlib.pyplot.title",
"torch.manual_seed",
"torch.tensor",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter",
"torch.randn"
]
] |
ACIL-Group/DVHA | [
"76f120e5b219f084e48383a59139438cc029bc4a"
] | [
"src/processing/gather_raw.py"
] | [
"\"\"\"\n Copyright 2019 Islam Elnabarawy\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 applicabl... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.loadtxt",
"sklearn.metrics.adjusted_rand_score"
]
] |
anhquan0412/fastai_v1 | [
"1f73d4a42dfbdbf1d9ce065b9cb97bb60fbbf957"
] | [
"my_note/nb_001b.py"
] | [
"\n #################################################\n ### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###\n #################################################\n # file to edit: dev_nb/001b_fit.ipynb\n\nimport pickle, gzip, torch, math, numpy as np, torch.nn.functional as F\nfrom pathlib i... | [
[
"torch.device",
"torch.nn.Sequential",
"numpy.sum",
"torch.no_grad",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"numpy.multiply",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.AdaptiveAvgPool2d"
]
... |
marhofmann/pandapower | [
"a7903c5cc0e23b8b1d397c1fc707a49490c2b62d"
] | [
"pandapower/test/api/test_file_io.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\n\nimport os\nimport pytest\nimport copy\n\nimport pandas as pd\nimport pandapower as pp\nimport pandapower.topology as to... | [
[
"numpy.allclose",
"pandas.DataFrame",
"numpy.array",
"pandas.Series"
]
] |
tihoson/seawater | [
"024206f6944fe5ea977de6d17fa967a3d602a4e6"
] | [
"data.py"
] | [
"import pandas as pd\nimport gsw\n\nDATES_COLUMNS = ['Date', 'Time']\n\nclass Data:\n def __init__(self, path):\n self._read(path)\n self._clean()\n\n def _read(self, path):\n self.data = pd.read_csv(path, sep='\\s+', parse_dates=DATES_COLUMNS)\n for column in self.data.columns:\n ... | [
[
"pandas.read_csv"
]
] |
Jason-ccm/covid19-forecast-hub-evaluation | [
"8e55ab8a9604cac71c7385f851fdf5e1a597aadb"
] | [
"power_rankings.py"
] | [
"from collections import defaultdict\nimport glob\n\nimport numpy as np\nimport pandas as pd\n\n\n\"\"\"\nCompute a \"Power Rankings\" based on the mean 'N weeks ahead' percentiles,\n where N is 1-6 weeks ahead. This includes both US and state-by-state rankings.\n\nThere are a total of 12 summaries: US + state-b... | [
[
"pandas.isnull",
"pandas.DataFrame",
"pandas.read_csv",
"numpy.mean"
]
] |
aasquier/AI_Tower_Defense | [
"9430fade5083e61620d6af5e6f09502a671271d9"
] | [
"AI_Tower_Defense/src/agent/qLearningAgent.py"
] | [
"import numpy as np\n\nfrom constants.gameConstants import *\nfrom constants.aiConstants import *\n\nclass Qdata:\n\n def __init__(self):\n self.qTable = np.zeros((NUMBER_OF_TOWERS, STARTING_POSITIONS))\n # self.towers = []\n self.gameScores = []\n # self.currentScore = 0\n\n\nclass... | [
[
"numpy.random.shuffle",
"numpy.zeros"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.