repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
DS1SQM/OPKR0710_panda2 | [
"5e33d1cd501fc8ddf9bcdb7a2b3c01c786e46a7b"
] | [
"selfdrive/car/hyundai/spdcontroller.py"
] | [
"import math\nimport numpy as np\n\nfrom cereal import car, log\nimport cereal.messaging as messaging\n\nimport cereal.messaging as messaging\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.controls.lib.planner import calc_cruise_accel_limits\nfrom selfdrive.controls.lib.speed_smoother import speed_... | [
[
"numpy.arange",
"numpy.array",
"numpy.abs",
"numpy.min"
]
] |
jamesfang8499/QuantFin | [
"b4abe18d1baa8c52e9c890268b958f85576fd9fa"
] | [
"QuantFin_Python/call_option.py"
] | [
"# -*- coding:utf-8 -*-\n__version__ = '0.0.1'\n__author__ = 'Dr. Yingfeng, Yu'\nfrom scipy import stats\nfrom math import log, sqrt, exp\n\nclass call_option:\n def __init__(self, S0, K, T, t, r, sigma):\n self.S0 = float(S0)\n self.K = K\n self.T = T\n self.t = t\n self.r ... | [
[
"scipy.stats.norm.cdf",
"scipy.stats.norm.pdf"
]
] |
StandardCyborg/scsdk | [
"92f80bf2a580ebaafa6b0d1052d90d5c8f6682f7"
] | [
"scsdk/python/scsdk_samples/node_types.py"
] | [
"# Copyright 2020 Standard Cyborg\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 ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
AlliedToasters/elko_den | [
"4e69f7f5c0dc7ffad54c7e190a2b75aba2eab7d2"
] | [
"variance-networks-pytorch/toy-problem.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\nimport torch\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_classification\nfrom torch.autograd import Variable\n\nget_ipython().run_line_magic('pylab', 'inline')\n\n\n# In[2]:\n\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom to... | [
[
"torch.nn.Softmax",
"torch.nn.CrossEntropyLoss",
"torch.Tensor",
"matplotlib.pyplot.ylim",
"torch.from_numpy",
"matplotlib.pyplot.savefig",
"torch.nn.Linear",
"matplotlib.pyplot.xlim",
"torch.nn.LeakyReLU",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"torc... |
remram44/duke | [
"627912e23685d058c6becc4e4615a7d3e8c93b93"
] | [
"Duke/dataset_descriptor.py"
] | [
"import numpy as np\nfrom operator import itemgetter\nfrom inflection import pluralize\n\nfrom Duke.class_tree import EmbeddedClassTree, tree_score\nfrom Duke.dataset import EmbeddedDataset\nfrom Duke.embedding import Embedding\nfrom Duke.utils import mean_of_rows, no_op\n\n\nclass DatasetDescriptor():\n\n def _... | [
[
"numpy.dot",
"numpy.array",
"numpy.argmax",
"numpy.vstack"
]
] |
SuperSumo/maze | [
"a2600e170cb03a0ce0ba1cd18ce6c11325c3cd9d"
] | [
"generate_maze.py"
] | [
"# Code taken from\n# http://code.activestate.com/recipes/578356-random-maze-generator/\n\nimport numpy as np\nimport random\nfrom PIL import Image\n\n# Register image display with IPython\n# http://nbviewer.ipython.org/gist/deeplook/5162445\nfrom io import BytesIO\nfrom IPython.core import display\n\n\ndef display... | [
[
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
caoy1996/CL-NMT | [
"b386f575ab73baeb0eb0009f7f4e544969c183ea"
] | [
"fairseq/trainer_lifelong_learning.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nTrain a network across multiple GPUs.\n\"\"\"\n\nimport contextlib\nimport math\nimport os\nimport sys\nfrom collections imp... | [
[
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cuda.get_device_capability",
"torch.cuda.memory_summary",
"torch.cuda.DoubleTensor",
"torch.cuda.empty_cache",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_count",
"torch.distributed.all_reduce"
]
] |
thauptmann/3D-ResNet-for-Keras | [
"ac1b8b3d0032c9af832cc945bc57a63106366e54"
] | [
"three_d_resnet_builder/three_D_resnet.py"
] | [
"from tensorflow import keras\n\nfrom .layers import ResidualBlock, ResidualBottleneckBlock, ResidualConvBlock, ResidualConvBottleneckBlock\n\n\nclass ThreeDConvolutionResNet(keras.Model):\n \"\"\"\n\n \"\"\"\n def __init__(self, input_shape, output_shape, output_activation, repetitions, regularizer=None,\... | [
[
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.InputLayer",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.GlobalAvgPool3D",
"tensorflow.keras.lay... |
byungjin0826/mrcnn | [
"1d773c1e9c39ba84684ca58452c4f80930680c2a"
] | [
"mrcnn/object/visualize.py"
] | [
"\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage.measure import ... | [
[
"matplotlib.pyplot.imshow",
"numpy.concatenate",
"numpy.any",
"numpy.where",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.tight_layout",
"numpy.unique",
"numpy.fliplr",
"numpy.arange",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"numpy.zeros",
"ma... |
harsh-vt/IITPKD | [
"80c72b4281df86c261dca0537346b0d8fb64adc9"
] | [
"main.py"
] | [
"import json\nimport pandas as pd\n\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\nfrom fastapi.responses import HTMLResponse, JSONResponse\nfrom fastapi.staticfiles import StaticFiles\nfrom typing import Optional\n\nmain_html_content = \"\"\"\n<!DOCTYPE html>\n<html> \n<head>\n <meta charset=\"U... | [
[
"pandas.read_csv"
]
] |
ngierty/yaglm | [
"57e212b576af7c5c0f0d62f9d6ad2484b9e25f10"
] | [
"yaglm/opt/stopping.py"
] | [
"from warnings import warn\nimport numpy as np\n\n\ndef check_no_change(current, prev, norm='max', tol=None,\n rel_crit=False, tol_eps=np.finfo(float).eps):\n \"\"\"\n Checks if there is no change between the current current value and the previous value.\n\n Parameters\n ----------\n ... | [
[
"numpy.abs",
"numpy.finfo"
]
] |
elenberg-io/dota-app | [
"d66da5780bc5319ede75bb1ae7b038eae427f173"
] | [
"data/getBestHero.py"
] | [
"import pandas as pd\nfrom sklearn.multioutput import MultiOutputRegressor\nfrom sklearn.ensemble import GradientBoostingRegressor\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import pairwise_distances_argmin_min\nimport os\n\nmatch_data_df = pd.read_csv(r'output\\matchData.csv')\nheroes... | [
[
"pandas.read_csv",
"sklearn.linear_model.LinearRegression"
]
] |
UWSEDS/homework-2-python-functions-and-modules-we29758143 | [
"dbcc252b3b1d592797e187152fe52b3ed7bba4cc"
] | [
"using_function.py"
] | [
"import pandas as pd\nURL ='https://data.seattle.gov/api/views/2khk-5ukd/rows.csv?accessType=DOWNLOAD'\n\n#read data\ndef read_data(url):\n return pd.read_csv(url)\n\n#check three requirements\ndef test_create_dataframe(df, colName):\n isValid = True #initialize return\n if list(df.columns) != colName: #ch... | [
[
"pandas.read_csv"
]
] |
ai-se/isminus | [
"ea41d8d9cf42894a9b4fc6204becf5a26df5b87c"
] | [
"sort_zitler.py"
] | [
"from bnbad import *\nimport numpy as np\n\n\n# Function to do insertion sort\ndef insertionSort(arr, t):\n \n # Traverse through 1 to len(arr)\n for i in range(1, len(arr)):\n print(i)\n key = arr[i]\n \n # Move elements of arr[0..i-1], that are\n # greater than key, to one po... | [
[
"numpy.savetxt",
"numpy.array"
]
] |
sandralima/MLMortgage | [
"16946e4c1a1cfec87739eb5aa0c711e5e305dc24"
] | [
"src/data/features_selection.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 1 19:02:33 2018\n\n@author: sandr\n\"\"\"\n\nimport make_dataset\nimport build_data\nimport pandas as pd\nimport numpy as np\n\nimport sklearn.feature_selection as fs\nfrom sklearn.preprocessing import QuantileTransformer\nfrom sklearn.preprocessing import Robus... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.dtype",
"sklearn.metrics.mean_squared_error",
"pandas.DataFrame",
"sklearn.metrics.classification_report",
"sklearn.linear_model.Perceptron",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.pipeline.Pipeline",
"sklearn.neighbors.KN... |
feedforward/cleverhans | [
"bafccdabd069ff29bc0840457ab164f5c4bc9ee5"
] | [
"cleverhans_tutorials/mnist_tutorial_jsma.py"
] | [
"\"\"\"\nThis tutorial shows how to generate adversarial examples\nusing JSMA in white-box setting.\nThe original paper can be found at:\nhttps://arxiv.org/abs/1511.07528\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import u... | [
[
"tensorflow.python.platform.flags.DEFINE_boolean",
"numpy.reshape",
"tensorflow.placeholder",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"numpy.mean",
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow... |
alize-papp/MAPIE | [
"184f65c792a378a931ee040b4f4209a75125d760"
] | [
"examples/plot_homoscedastic_1d_data.py"
] | [
"\"\"\"\n==========================================================\nEstimate the prediction intervals of 1D homoscedastic data\n==========================================================\n\n:class:`mapie.estimators.MapieRegressor` is used to estimate\nthe prediction intervals of 1D homoscedastic data using\ndiffer... | [
[
"scipy.stats.norm.ppf",
"numpy.random.seed",
"numpy.linspace",
"numpy.random.exponential",
"matplotlib.pyplot.subplots",
"numpy.stack",
"sklearn.preprocessing.PolynomialFeatures",
"numpy.random.normal",
"sklearn.linear_model.LinearRegression"
]
] |
gregoratlarge/dash-stock-tickers-demo-app | [
"35960f5fd8a29b9eca6a686a394ac21796cca712"
] | [
"app.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\n\nimport colorlover as cl\nimport datetime as dt\nimport flask\nimport os\nimport pandas as pd\nimport time\n\napp = dash.Dash(\n __name__, \n assets_external_scripts='https://cdn.plot.ly/plotly-finance-1.28.0.min.js'\n)\ns... | [
[
"pandas.read_csv"
]
] |
RobbieHember/fcgadgets | [
"d968991ea185d48df8d674d290b7e03bfc8843d4"
] | [
"macgyver/query_vector_db.py"
] | [
"'''\n\nQUERY RESULTS ACTIVITY TREATMENT LAYER\n\n'''\n\n#%% Import modules\n\nimport numpy as np\nimport pandas as pd\nimport geopandas as gpd\nimport fiona\nimport matplotlib.pyplot as plt\nimport numpy.matlib as ml\nfrom shapely.geometry import Polygon,Point\nimport time\nimport gc as garc\nfrom fcgadgets.macgyv... | [
[
"numpy.arange",
"numpy.intersect1d",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
mahabubul-alam/iccad_2021_invited_QML | [
"9dc62442addada01bb003c6255788ef93dcb6598"
] | [
"Tflow/classical_classifier_example.py"
] | [
"from sklearn.datasets import load_breast_cancer\nimport app.qnn_builder as qnn_builder\nimport pennylane as qml\nimport tensorflow as tf\nfrom sklearn.preprocessing import normalize\nfrom numpy import genfromtxt\nimport sys\nimport os\nimport numpy as np\n\ndata = genfromtxt(sys.argv[1], delimiter=',')\ndata = dat... | [
[
"tensorflow.keras.layers.Activation",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"numpy.genfromtxt",
"sklearn.preprocessing.normalize",
"numpy.array",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.optimizers.SGD"
]
] |
belltailjp/pytorch-pfn-extras | [
"8ce08d8e6bc67502be8e0fd5053a8c84e4df5e6a"
] | [
"pytorch_pfn_extras/runtime/_runtime.py"
] | [
"import contextlib\n\nfrom typing import Any, Dict, Generator, Iterable, Optional, Tuple, Union\n\nimport torch\n\nfrom pytorch_pfn_extras.handler._code_block import CodeBlock\nfrom pytorch_pfn_extras.training import Evaluator, Trainer\n\n_amp_enabled = False\n\n\ntry:\n import torch.cuda.amp\n\n _amp_enabled... | [
[
"torch.cuda.is_available",
"torch.cuda.amp.autocast"
]
] |
deshpandeyash/treesplittingsimulator | [
"aa93dcac892cd580669e453353a88a7b9343b423",
"aa93dcac892cd580669e453353a88a7b9343b423"
] | [
"make_stat.py",
"simresult.py"
] | [
"import numpy as np\r\nimport scipy.stats\r\nfrom matplotlib import pyplot as plt\r\nimport tikzplotlib\r\n\r\n\r\ndef mean_confidence_interval(data, confidence=0.95):\r\n a = 1.0 * np.array(data)\r\n n = len(a)\r\n m, se = np.mean(a), scipy.stats.sem(a)\r\n h = se * scipy.stats.t.ppf((1 + confidence) /... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.title",
"numpy.unique",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.mean",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"numpy.array",
"numpy.histog... |
ningchaoar/portfolio-examples | [
"bacbbbcc3f20e89648c91141156f091de4eef651"
] | [
"pytorch/fastpitch/common/audio_processing.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2018, NVIDIA 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# * Redis... | [
[
"scipy.signal.get_window",
"torch.from_numpy",
"torch.exp",
"torch.clamp",
"numpy.zeros"
]
] |
kshramt/ngboost | [
"693efc3fe40db460c1b3d5e129a8a3356f502864"
] | [
"ngboost/distns/laplace.py"
] | [
"import scipy as osp\nimport scipy.stats\nimport jax.numpy as np\nimport jax.scipy as sp\nimport jax.random as random\n\n\nclass Laplace(object):\n\n n_params = 2\n has_fisher_info = True\n has_crps_metric = True\n\n def __init__(self, params, temp_scale = 1.0):\n self.loc = params[0]\n se... | [
[
"scipy.stats.laplace.fit",
"scipy.stats.laplace.ppf"
]
] |
odigous-labs/self-learning-algorithm | [
"83fd7e3cbd0daab77ea94fc4bc21b28e2c510d19",
"83fd7e3cbd0daab77ea94fc4bc21b28e2c510d19"
] | [
"gsom/util/display.py",
"gsom/feature_extracter/VGG.py"
] | [
"\"\"\"\nPython display plots:\nhttps://python-graph-gallery.com/all-charts/\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib import cm\nfrom matplotlib import colors\nfrom collections import Counter\nimport matplotlib.image as mpimg\nimport matplotlib.patches as mpatches\nimport squa... | [
[
"matplotlib.pyplot.legend",
"matplotlib.patches.Patch",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.random.seed",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.image.imread",
"matplotlib.pyplot.clf",
"matplotlib.colors.ListedColormap",... |
ChangeTheWorld20191008/PaddleOCR | [
"9b2ee55c4411b5692fae7322b074ce074e597c3b"
] | [
"tools/infer/my_utils.py"
] | [
"import os\nimport sys\nimport time\n\n__dir__ = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(__dir__)\nsys.path.append(os.path.abspath(os.path.join(__dir__, '../..')))\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import ConfigProto\nfrom tensorflow.python.saved_model i... | [
[
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.image.combined_non_max_suppression",
"tensorflow.saved_model.load",
"numpy.asarray",
"numpy.reshape",
"tensorflow.placeholder",
"numpy.linalg.norm",
"tensorflow.ConfigProto",
"tensorflow.Session",
"numpy.argsort",
... |
LSSTDESC/prepsf-moments | [
"0fb155500caeb3f88b654be1a6b670ad2ffc9a50"
] | [
"notebooks/shear_meas.py"
] | [
"import sys\nimport numpy as np\nimport tqdm\n\n\ndef _run_boostrap(x1, y1, x2, y2, wgts, silent):\n rng = np.random.RandomState(seed=100)\n mvals = []\n cvals = []\n if silent:\n itrl = range(500)\n else:\n itrl = tqdm.trange(\n 500, leave=False, desc='running bootstrap', nc... | [
[
"numpy.ones_like",
"numpy.sqrt",
"numpy.std",
"numpy.delete",
"numpy.mean",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.sum"
]
] |
adam-kerrigan/pybader | [
"1d675ae69ab64fe336b936b00990681e01258031"
] | [
"pybader/thread_handlers.py"
] | [
"\"\"\"Functions for handling the threading of intensive calculations.\n\"\"\"\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nimport numpy as np\nfrom numba import typeof\n\nfrom pybader import methods, refinement\n\nfrom .utils import (array_merge, atom_assign, dtype_calc, dtype_change,\n ... | [
[
"numpy.multiply",
"numpy.ascontiguousarray",
"numpy.subtract",
"numpy.array_split",
"numpy.where",
"numpy.float64",
"numpy.ndindex",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
google/consent-based-conversion-adjustments | [
"225b3d8c9afeb763648bc86e500e9b222d7ab4ec"
] | [
"cocoa/testing_constants.py"
] | [
"# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.array"
]
] |
vfdev-5/vgn | [
"7ceaddf5e27d853a7488685e8316c2987f7b11fc"
] | [
"scripts/panda_detection.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nReal-time grasp detection.\n\"\"\"\n\nimport argparse\nfrom pathlib import Path\nimport time\n\nimport cv_bridge\nimport numpy as np\nimport rospy\nimport sensor_msgs.msg\nimport torch\n\nfrom vgn import vis\nfrom vgn.detection import *\nfrom vgn.perception import *\nfrom vgn.utils... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
AlexGreason/PreferenceEstimation | [
"1a3e771f8040ccc2a5a5fa206ea4e2438af47918"
] | [
"charmodel.py"
] | [
"import itertools\n\nimport numpy as np\nimport pylab\nimport scipy.misc as misc\nimport scipy.ndimage as ndimage\nfrom keras.layers import Input, Dense, Convolution2D, MaxPooling2D, Reshape, Flatten, UpSampling2D, \\\n AveragePooling2D\nfrom keras.models import Model, Sequential, Graph\nfrom matplotlib.widgets ... | [
[
"scipy.misc.imresize",
"scipy.ndimage.gaussian_filter",
"numpy.random.seed",
"matplotlib.widgets.Button",
"numpy.arange",
"matplotlib.widgets.Slider",
"numpy.exp",
"numpy.random.uniform",
"numpy.array"
]
] |
fogfog2/depthformer2 | [
"d1eaade1f80e1919d84f9e55d08d88b42cf6387a",
"d1eaade1f80e1919d84f9e55d08d88b42cf6387a"
] | [
"packnet_sfm/networks/layers/resnet/resnet_encoder_depth.py",
"packnet_sfm/losses/multiview_photometric_loss_fbnet.py"
] | [
"# Copyright 2020 Toyota Research Institute. All rights reserved.\n\n# Adapted from monodepth2\n# https://github.com/nianticlabs/monodepth2/blob/master/networks/resnet_encoder.py\n\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport... | [
[
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"numpy.array",
"torch.nn.init.kaiming_normal_"
],
[
"torch.abs",
"torch.nn.ReflectionPad2d",
"torch.cat",
"torch.nn.AvgPool2d",
"torch.c... |
553269487/ConvLSTM-PyTorch | [
"d44942983c05c66381eeb9f54e88c828e9e37cfc"
] | [
"encoder.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n'''\n@File : encoder.py\n@Time : 2020/03/09 18:47:50\n@Author : jhhuang96\n@Mail : hjh096@126.com\n@Version : 1.0\n@Description: encoder\n'''\n\nfrom torch import nn\nfrom utils import make_layers\nimport torch\nimport logging\n\n\nclass Encod... | [
[
"torch.reshape",
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
HaoranZhuExplorer/Efficient-Uncertainty-Estimation-for-Segmentation | [
"b6f64098c4fed8869bc67c08b50a2b684ffce7d1"
] | [
"models/enet.py"
] | [
"import torch.nn as nn\nimport torch\n\n\nclass InitialBlock(nn.Module):\n \"\"\"The initial block is composed of two branches:\n 1. a main branch which performs a regular convolution with stride 2;\n 2. an extension branch which performs max-pooling.\n\n Doing both operations in parallel and concatenat... | [
[
"torch.nn.Dropout2d",
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.zeros",
"torch.nn.MaxUnpool2d",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d"
]
] |
dcardenasv/mbuild | [
"20c13f6bb66c6b023b07d7a2b2e4ad0a5073d727"
] | [
"mbuild/tests/test_compound.py"
] | [
"import os\nimport time\n\nimport numpy as np\nimport parmed as pmd\nimport mdtraj\nimport pytest\n\nimport mbuild as mb\nfrom mbuild.exceptions import MBuildError\nfrom mbuild.utils.geometry import calc_dihedral\nfrom mbuild.utils.io import get_fn, import_, has_foyer, has_intermol, has_openbabel, has_networkx\nfro... | [
[
"numpy.random.random",
"numpy.allclose",
"numpy.random.seed",
"numpy.array_equal",
"numpy.linalg.norm",
"numpy.identity",
"numpy.random.rand",
"numpy.array",
"numpy.zeros",
"numpy.isclose"
]
] |
shanecanny1/Data-Analytics-Programming-and-Scripting-Project-2018 | [
"90b00dc5da112a864d13eedb2c7d62b6211dd446"
] | [
"ProjectP8.py"
] | [
"# Project 2018 Part 8 Assigning All Iris Classifications with Correct Data and Calulating Means\r\n\r\n# Import Numpy Library\r\nimport numpy\r\n\r\n# Import Panda Lbrary\r\nimport pandas as pd \r\n\r\n# Import Matplotlib Library for Generating Graphs\r\nimport matplotlib.pyplot as plt\r\n\r\n# Assigning Headings ... | [
[
"pandas.read_csv",
"numpy.mean",
"numpy.genfromtxt"
]
] |
hursung1/coach | [
"327a8f81d5c8d0a9a1ea7eefe65c4af423e19dae",
"327a8f81d5c8d0a9a1ea7eefe65c4af423e19dae"
] | [
"preprocess/gen_embeddings_for_slu.py",
"preprocess/gen_example_emb_for_slu_baseline.py"
] | [
"import numpy as np\nimport pickle\n\n# prepare OoV words\noov_words = ['PAD', 'UNK', '50', '2016', 'indiespensables', 'biszewilo', '2010', '00', 'wastedagain', '6', 'palylist', '30', '52', 'twerkout', '2015', 'electronow', 'pre-party', 'a-hunting', '16', '61', '-blue', 'side-', 'teriazume', 'rapcaviar', '2', '2017... | [
[
"numpy.concatenate",
"numpy.load",
"numpy.zeros",
"numpy.save"
],
[
"numpy.zeros",
"numpy.stack"
]
] |
metai/aitrace | [
"8e42001f5e3a187801764f413b6ee2f32476c6d1",
"8e42001f5e3a187801764f413b6ee2f32476c6d1"
] | [
"_static/src/python/BasisMath/MatrixTheory/Norm/demo_SpectralNorm_L2Norm.py",
"_static/src/python/SignalProcessing/Digital/TimeFrequencyAnalysis/Classical/STFT/demo_stft_gauss_nfft.py"
] | [
"import numpy as np\r\n\r\nH = 3\r\nW = 4\r\n\r\nX = np.random.randn(H, W)\r\n\r\nprint(X)\r\nprint(np.conj(X).transpose())\r\n\r\nL2Norm = np.sqrt(np.sum(X ** 2))\r\n\r\nS, U, V = np.linalg.svd(np.conjugate(X).transpose())\r\n\r\nprint(S)\r\n\r\nmaxSigma = S.max()\r\n\r\nSpectralNorm = np.sqrt(maxSigma)\r\n\r\npri... | [
[
"numpy.conj",
"numpy.sqrt",
"numpy.abs",
"numpy.random.randn",
"numpy.sum",
"numpy.conjugate"
],
[
"numpy.hstack",
"scipy.signal.spectral.spectrogram",
"matplotlib.pyplot.pcolormesh",
"numpy.linspace",
"matplotlib.pyplot.title",
"numpy.cos",
"matplotlib.pypl... |
aqeelanwar/DRLwithTL_real | [
"6aac018a6917e9e53b94e8098a1ad7d394661e0a"
] | [
"DeepNet/network/heat_map.py"
] | [
"from .heat_map_network import Network\n\nimport tensorflow as tf\nimport cv2\nimport numpy as np\n\nclass heat_map():\n\n def __init__(self):\n self.heat_map_g = tf.Graph()\n with self.heat_map_g.as_default():\n height = 228\n width = 304\n channels = 3\n ... | [
[
"tensorflow.Graph",
"numpy.asarray",
"tensorflow.placeholder",
"numpy.ptp",
"tensorflow.ConfigProto",
"numpy.max",
"tensorflow.train.Saver",
"numpy.array",
"numpy.zeros"
]
] |
MasterOnDust/DUST | [
"f54e3288419434407285eb652cb0b5b143ede8f9"
] | [
"DUST/tests/test_process_data_dust.py"
] | [
"from .create_test_data import create_flexdust_test_data, create_test_data\nimport xarray as xr\nimport numpy as np\nimport pandas as pd\nfrom DUST.process_data_dust import process_per_timestep, create_output,process_per_pointspec\nimport pytest\n\n\n\ndef test_multiplication(seed=1,**test_kwargs):\n HEIGHT=100\... | [
[
"numpy.arange",
"numpy.testing.assert_allclose"
]
] |
ilyalyovwork/leaves | [
"2c4ee4111a08ece91c172d782b01351e1d240603"
] | [
"research/dataset.py"
] | [
"import torch\nimport numpy as np\nimport cv2\nfrom torch.utils.data import Dataset\nfrom albumentations.pytorch.transforms import img_to_tensor\nfrom img_transformations import separate_image_on_steps\n\n#binary_factor = 255\n\nmask_folder = 'segmented'\n\nclass LeavesDataset(Dataset):\n def __init__(self, file... | [
[
"torch.stack",
"numpy.expand_dims"
]
] |
nickp60/riboSeed | [
"636eaf78a1bbe4517c43ddb120e5ca5bb2b97212"
] | [
"riboSeed/riboScore.py"
] | [
"#!/usr/bin/env python3\n#-*- coding: utf-8 -*-\n# Copyright 2017, National University of Ireland and The James Hutton Insitute\n# Author: Nicholas Waters\n#\n# This code is part of the riboSeed package, and is governed by its licence.\n# Please see the LICENSE file that should have been included as part of\n# this... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
bcmi/Image-Composition-Assessment-with-SAMP | [
"35c093bafdaaa98923d8ba093a73ddf0079ffbc9"
] | [
"SAMPNet/samp_net.py"
] | [
"import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nimport torchvision.models as models\nimport warnings\nwarnings.filterwarnings('ignore')\nfrom samp_module import MPPModule, SAMPPModule\nfrom config import Config\n\nclass SAPModule(nn.Module):\n def __init__(self, input_channel, output_chann... | [
[
"torch.nn.Softmax",
"torch.mean",
"torch.nn.functional.softmax",
"torch.cat",
"torch.sum",
"torch.where",
"torch.pow",
"torch.nn.Dropout",
"torch.randn",
"torch.nn.Sigmoid",
"torch.ones_like",
"torch.nn.Sequential",
"torch.nn.Linear",
"torch.count_nonzero",
... |
badchild0912/foolbox | [
"cfd1cfcc7e1c48ff64df2fe98e388a050effc74a"
] | [
"foolbox/v1/attacks/boundary_attack.py"
] | [
"import warnings\nimport threading\nimport queue\nimport time\nimport sys\nimport collections\n\nfrom concurrent.futures import ThreadPoolExecutor\nfrom concurrent.futures import Executor\nfrom concurrent.futures import Future\n\nfrom .base import Attack\nfrom .base import call_decorator\nfrom .blended_noise import... | [
[
"numpy.sqrt",
"numpy.take",
"numpy.clip",
"numpy.asarray",
"numpy.arange",
"numpy.abs",
"numpy.linalg.norm",
"numpy.argmax",
"numpy.argmin",
"numpy.mean",
"numpy.zeros",
"numpy.empty",
"numpy.vdot"
]
] |
Boekske/data-visualisation-scripts | [
"81c797e31e22837984a4af2f63c0cc3a6fe4ba8c"
] | [
"dash-2019-coronavirus/history_version/app_replaced_20200325.py"
] | [
"# -*- coding: utf-8 -*-\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport math\nimport os\n\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\n\nimport dash\nimport dash_table\nimport dash_core_components as dcc\nimport dash_html_components as ht... | [
[
"numpy.array",
"numpy.arange",
"pandas.merge",
"pandas.read_csv"
]
] |
bcrafton/icsrl-deep-learning | [
"e3616982d1dda5f978d61d6591c91cb0da76ab02"
] | [
"image-classification/bc_utils/pre_processing.py"
] | [
"\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"tensorflow.image.random_contrast",
"tensorflow.equal",
"tensorflow.image.random_saturation",
"tensorflow.image.central_crop",
"tensorflow.image.random_hue",
"tensorflow.image.random_flip_left_right",
"tensorflow.summary.image",
"tensorflow.squeeze",
"tensorflow.subtract",
... |
DomInvivo/pna | [
"1a7d8ae645d093ebedeffcf148a98f6061957a23"
] | [
"realworld_benchmark/data/superpixels.py"
] | [
"# MIT License\n# Copyright (c) 2020 Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, Xavier Bresson\n\n\nimport os\nimport pickle\nfrom scipy.spatial.distance import cdist\nfrom scipy import sparse as sp\nimport numpy as np\nimport itertools\n\nimport dgl\nimport torch\nimport torch.utils.... | [
[
"torch.abs",
"torch.cat",
"torch.zeros",
"torch.sum",
"numpy.concatenate",
"torch.unique",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.where",
"numpy.partition",
"numpy.arange",
"torch.round",
"numpy.real",
"numpy.diag_indices_from",
"numpy.ar... |
tgsmith61591/reclab | [
"423c9b5dd6e00def548b5cc29d3eca4dcc8c4a88"
] | [
"reclab/datasets/base.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\n\nimport numpy as np\nfrom os.path import join, dirname\n\nfrom sklearn.datasets.base import Bunch\nfrom sklearn.preprocessing import LabelEncoder\n\nfrom ..utils.validation import to_sparse_csr\n\n__all__ = [\n 'load_lastfm'\n]\n\n\nclass __Bun... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.datasets.base.Bunch",
"numpy.loadtxt"
]
] |
DominykasButa/c5galaxyrepo | [
"c6937998b723bb3fe33b7196b6621b1fa7cc33f2"
] | [
"src/lam_convergence_01.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy.linalg import solve\nimport copy\nimport matplotlib\nfrom matplotlib.ticker import (MultipleLocator)\n\ny=[2.00E+00\t,\n1.96E+00\t,\n1.92E+00\t,\n1.88E+00\t,\n1.84E+00\t,\n1.80E+00\t,\n1.76E+00\t,\n1.72E+00\t,\n1.68E+00\t,\n1.64E+00\t,\n1.60E+00\t,\n1... | [
[
"matplotlib.pyplot.legend",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.figure"
]
] |
thekitchenscientist/pydotART | [
"3d8398be94b8c0949c0d99ef19a647624434265f"
] | [
"spaceinvaderDOTS.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jul 17 13:07:36 2021\n\n@author: Stephen\nhttps://github.com/thekitchenscientist/pydotART\n\nSample programs for the 41935 Set\nhttps://rebrickable.com/sets/41935-1/lots-of-dots/#parts\n\"\"\"\n\nimport pydotART as da\n\nfrom itertools import combinations_with_replac... | [
[
"numpy.unique",
"numpy.asarray",
"numpy.flipud",
"numpy.array",
"numpy.sum",
"numpy.vstack"
]
] |
LeiGitHub1024/lowlight | [
"86649ae4275b8908d39561792a8068d391318f8d",
"86649ae4275b8908d39561792a8068d391318f8d"
] | [
"Rformer2/genR.py",
"uformer1104/model.py"
] | [
"import os\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torchvision.transforms as transforms\nimport cv2\ndef is_png_file(filename):\n return any(filename.endswith(extension) for extension in [\".png\"])\ndef copyGT(input_dir,output_dir):\n if not os.path.exists(output_d... | [
[
"numpy.expand_dims",
"numpy.clip",
"numpy.power",
"numpy.uint8",
"numpy.isnan",
"numpy.concatenate",
"numpy.max",
"numpy.array"
],
[
"torch.nn.Softmax",
"torch.transpose",
"torch.cat",
"torch.zeros",
"torch.nn.functional.interpolate",
"torch.flatten",
... |
msimet/sc_classifier | [
"3dbc8c4d722e1a2b6a588986fff8c083fb5db541"
] | [
"sc_classifier/SCC.py"
] | [
"\"\"\" SCC.py: contains the definition of the SpatialCluster object that performs the\n Hebert & Macaire algorithm \"\"\"\n\nimport numpy as np\nfrom sklearn.cluster import KMeans\n\nclass SpatialColorClassifier(object):\n \"\"\"\n A class to perform the spatial-color pixel clustering algorithm of\n ht... | [
[
"numpy.diag",
"numpy.dot",
"sklearn.cluster.KMeans",
"numpy.min",
"numpy.linalg.eig",
"numpy.all",
"numpy.max",
"numpy.floor",
"numpy.moveaxis",
"numpy.var",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
robertfasano/labyak | [
"8f1896aeebdc7d9f1a6adc58f8bb2009a1254ab7"
] | [
"labyak/waveform_generator.py"
] | [
"from labjack import ljm\nimport numpy as np\n\nclass WaveformGenerator:\n def __init__(self, labjack):\n self.labjack = labjack\n\n def start(self, t, V, channels = [0]):\n data, scanRate = self.labjack.stream.resample(V, np.max(t))\n self.labjack.stream.configure(settling_time=0, resolu... | [
[
"numpy.max"
]
] |
bdexp/RedCarpet-LaneDetection | [
"83d76bae0b024afb64b5b831fc35aa864cc20af2"
] | [
"imageRead.py"
] | [
"import imageflow\nimport numpy as np\nimport pandas as pd\nimport random\n\nfrom skimage import exposure, filters\nfrom scipy.misc import imresize\nimport matplotlib.pyplot as plt\n\nDATA_PATH = '../Data/Clean_images/'\nDATA_FOLDERS = [\n 'dashedlinesmissing',\n 'fulltrack1',\n 'fulltrack2',\n 'leftcur... | [
[
"scipy.misc.imresize",
"pandas.read_csv",
"numpy.expand_dims",
"numpy.multiply",
"numpy.random.choice",
"numpy.fliplr",
"numpy.arange",
"numpy.random.shuffle",
"numpy.copy",
"numpy.append",
"numpy.array_split",
"numpy.zeros"
]
] |
UFResearchComputing/py4ai | [
"db7f80614f26274ec18556d56ea9f549c463165a"
] | [
"solutions/110_solution_03.py"
] | [
"import glob\r\nimport pandas\r\n\r\nfor filename in glob.glob('data/*.csv'):\r\n contents = pandas.read_csv(filename)\r\n if len(contents)<50:\r\n print(filename, len(contents))"
] | [
[
"pandas.read_csv"
]
] |
TortoiseHam/openfl | [
"c48823613b3a725c528d450df41def93a5fed38c"
] | [
"openfl/federated/task/runner_fe.py"
] | [
"# Copyright (C) 2020-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\"\"\"FastEstimatorTaskRunner module.\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom openfl.utilities import split_tensor_dict_for_holdouts\nfrom openfl.utilities import TensorKey\nfrom .runner import TaskRunner\nfrom... | [
[
"numpy.array",
"tensorflow.config.run_functions_eagerly"
]
] |
DamonDeng/thetago | [
"2dba48460aaf3e3544b6d228deb4cff0d0fd7123"
] | [
"data_loader/original_processor.py"
] | [
"from gosgf import Sgf_game\nfrom go_core.goboard import GoBoard\n\nimport numpy as np\nimport mxnet as mx\n\nclass OriginalProcessor(object):\n\n def __init__(self, sgf_content, board_size=19, level_limit='0d', player='all'):\n # self.sgf_file = sgf_file\n self.board_col = board_size\n self... | [
[
"numpy.zeros"
]
] |
jackd/spax | [
"bc55a2660d468838aa1c080d6152d0be73eab118"
] | [
"spax/linalg/polynomials_test.py"
] | [
"import jax\nimport jax.numpy as jnp\nimport numpy as np\nfrom absl.testing import absltest\nfrom jax import test_util as jtu\nfrom jax.config import config\n\nfrom spax.linalg import polynomials as poly\n\nconfig.parse_flags_with_absl()\n\n\nclass PolyTest(jtu.JaxTestCase):\n def test_matrix_poly_vector_prod_fr... | [
[
"numpy.random.default_rng"
]
] |
smallporridge/FNPS | [
"e33f98ccb3430c5f468e9716e8fb8c4c1aa2441b"
] | [
"SubLayers.py"
] | [
"''' Define the sublayers in encoder/decoder layer '''\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom Modules import ScaledDotProductAttention\n\n__author__ = \"Yu-Hsiang Huang\"\n\nclass MultiHeadAttention(nn.Module):\n ''' Multi-Head Attention module '''\n\n def __init__(s... | [
[
"torch.nn.Dropout",
"numpy.sqrt",
"numpy.power",
"torch.nn.init.xavier_normal_",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.nn.Conv1d"
]
] |
JesseLivezey/multicolinearity | [
"3bfaf81fadd1fabe31ea310bd0045af1755467de"
] | [
"analysis.py"
] | [
"import numpy as np\nfrom sklearn.linear_model import LinearRegression as LinR, Lasso as LasR\n\ndef sample_data(X_cov, M, noise_std, n_data, rng):\n X = rng.multivariate_normal(np.zeros_like(M), X_cov, n_data)\n X /= X.std(axis=0, keepdims=True)\n Y = X.dot(M) + rng.randn(n_data) * noise_std\n return X... | [
[
"numpy.nonzero",
"sklearn.linear_model.Lasso",
"numpy.zeros_like",
"sklearn.linear_model.LinearRegression",
"numpy.count_nonzero",
"numpy.zeros"
]
] |
theNded/SGP | [
"63d33cc8bffde53676d9c4800f4b11804b53b360"
] | [
"code/perception3d/test.py"
] | [
"import sys, os\n\nfile_path = os.path.abspath(__file__)\nproject_path = os.path.dirname(os.path.dirname(file_path))\nsys.path.append(project_path)\n\nfcgf_path = os.path.join(project_path, 'ext', 'FCGF')\nsys.path.append(fcgf_path)\n\nfrom dataset.threedmatch_test import Dataset3DMatchTest\nfrom perception3d.adapt... | [
[
"numpy.savez"
]
] |
sijin-dm/semantic-segmentation | [
"54bba2948ccd6647ec6ce280daf0099e0655e139"
] | [
"datasets/base_loader.py"
] | [
"\"\"\"\nCopyright 2020 Nvidia Corporation\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following dis... | [
[
"numpy.array",
"numpy.zeros"
]
] |
xrick/gotek_smic | [
"7655b6d7415b23c35810b8db48af7424f7dcdb06"
] | [
"KWS/TestPrograms/test_vad_test.py"
] | [
"import numpy as np\nfrom numpy.linalg import norm\nimport scipy.io.wavfile as wavio\n\ndef vad_test(s, fs):\n s = s - np.amin(s)\n s = s / np.amax(s)\n FrameSize = int(fs * 0.025) #400\n ShiftSize = int(fs * 0.010) #160\n Overlap = FrameSize - ShiftSize #240\n threshold = -1.9\n s_temp = []\n ... | [
[
"numpy.hstack",
"numpy.amax",
"numpy.amin",
"numpy.linalg.norm",
"numpy.ones",
"numpy.transpose",
"numpy.array",
"scipy.io.wavfile.read"
]
] |
TuKJet/models | [
"984fbc754943c849c55a57923f4223099a1ff88c"
] | [
"research/capsules/experiment.py"
] | [
"# Copyright 2017 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.device",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.gfile.Exists",
"tensorflow.gfile.MakeDirs",
"tensorflow.get_default_graph",
"tensorflow.Graph",
"numpy.reshape",
"tensorflow.Summary.FromString",
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow... |
Agaetis-IT/learningbot | [
"8f99603525075ca98e97860d4ed519e4794fee4b"
] | [
"create_tfrecords.py"
] | [
"\"\"\"\nCreate the tfrecord files for a dataset.\n\nA lot of this code comes from the tensorflow inception example, so here is their license:\n\n# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | [
[
"tensorflow.train.Int64List",
"numpy.linspace",
"numpy.arange",
"tensorflow.image.decode_png",
"tensorflow.train.Coordinator",
"tensorflow.placeholder",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.compat.as_bytes",
"tensorflow.Session",
"tensorflow.train.FloatList",
... |
brilee/pyrfume | [
"ae93d320793914c39315dc4f94384f6184254af5"
] | [
"pyrfume/unit_test/test_config_data.py"
] | [
"from pathlib import Path\nimport unittest\n\nclass DataAndConfigTestCase(unittest.TestCase):\n\n def test_init_reset_config(self):\n from pyrfume import init_config, reset_config\n init_config(False)\n reset_config()\n init_config(True)\n \n def test_read_write_config(self)... | [
[
"pandas.DataFrame"
]
] |
moderato/LayerFusion | [
"3acdbe18e9575eee6e4ab3b60293393a40eedac5"
] | [
"plots/runtime_and_flops.py"
] | [
"from tvm.topi.fusion_composer import *\nfrom utils import get_workloads\nfrom matplotlib import pyplot as plt\nimport argparse\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description=\"Parses command.\")\n parser.add_argument(\"-i\", \"--iterations\", type=int, default=20, help=\"Number ... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
]
] |
danhje/pdrepr | [
"e4954c2cf893d3fe1bcba22869a9abe3b2458b2b"
] | [
"tests/test_pdrepr.py"
] | [
"import pytest\nfrom pdrepr import pdrepr\nimport datetime\nimport pandas as pd\nimport numpy as np\nfrom contextlib import contextmanager\nimport mock\n\n\n@contextmanager\ndef rename_pd():\n global pd\n orig = pd\n del pd\n yield orig\n pd = orig\n\n\ndef test_pdrepr_minimal():\n original = pd.D... | [
[
"numpy.random.rand",
"pandas.testing.assert_frame_equal",
"pandas.MultiIndex.from_product",
"pandas.DataFrame"
]
] |
CarmanZheng/CarmanZheng.github.io | [
"bb969ad037f3db4dae7b0d5edf99b365f9d589cb"
] | [
"_posts/2020-12-18-目标检测专题/code/chapter02_image_classification_introduction/2.2_introduction_of_image_classification/classical_cnn_models/lenet/LeNet.py"
] | [
"\"\"\"\n代码修改自https://github.com/yunjey/pytorch-tutorial\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.nn.functional as F\n\n# Device configuration\ndevice = torch.device('cuda:1' if torch.cuda.is_available() else 'cpu')\nprint(\"You are ... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
materials-data-facility/battery-data-toolk | [
"00ea2761d6f98170573758d398ad67b6716d81db"
] | [
"batdata/postprocess/tests/test_cycle_stats.py"
] | [
"import os\nfrom math import isclose\n\nimport numpy as np\nfrom pytest import fixture\n\nfrom batdata.extractors.arbin import ArbinExtractor\nfrom batdata.postprocess.cycle_stats import compute_energy_per_cycle, compute_charging_curve\n\n\n@fixture\ndef example_data():\n ex_file = os.path.join(os.path.dirname(_... | [
[
"numpy.isclose"
]
] |
blackary/docs | [
"5e49a42219f0d09676c7f784cdd51cc8155cf8a2"
] | [
"python/api-examples-source/data.dataframe.py"
] | [
"import streamlit as st\nimport pandas as pd\nimport numpy as np\n\n@st.experimental_memo\ndef load_data():\n df = pd.DataFrame(np.random.randn(50, 20), columns=(\"col %d\" % i for i in range(20)))\n return df\n\ndf = load_data()\n\nst.dataframe(df) # Same as st.write(df)\n"
] | [
[
"numpy.random.randn"
]
] |
GMonster0905/pysot | [
"011f92017afc346c1fc8cff231647d089f5f331a"
] | [
"pysot/tracker/siamrpnlt_tracker.py"
] | [
"# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\n\nfrom pysot.core.config import cfg\nfrom pysot.tracker.siamrpn_tracker import SiamRPNTra... | [
[
"numpy.maximum",
"numpy.sqrt",
"numpy.argmax",
"numpy.hanning",
"numpy.outer",
"numpy.array",
"numpy.exp",
"numpy.sum"
]
] |
sheridanfew/CLOVER | [
"ca746afb64a72bcf3d2b897576764809cdd8b836"
] | [
"Scripts/Generation scripts/Solar.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n===============================================================================\n SOLAR GENERATION FILE\n===============================================================================\n Most recent update:\n ... | [
[
"numpy.arange",
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
KevinCarpricorn/Code | [
"8d0164f5b28f937e8891854f86e1a9b584122b48"
] | [
"ch06/overfit_dropout.py"
] | [
"# coding: utf-8\r\nimport os\r\nimport sys\r\nsys.path.append(os.pardir) # 为了导入父目录的文件而进行的设定\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom dataset.mnist import load_mnist\r\nfrom common.multi_layer_net_extend import MultiLayerNetExtend\r\nfrom common.trainer import Trainer\r\n\r\n(x_train, t_tra... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
jordanrmerrick/pandas | [
"e18415e64c66a5c125a6e6a9e9aa9fa97eb01403"
] | [
"pandas/tests/series/methods/test_astype.py"
] | [
"from datetime import (\n datetime,\n timedelta,\n)\nfrom importlib import reload\nimport string\nimport sys\n\nimport numpy as np\nimport pytest\n\nfrom pandas._libs.tslibs import iNaT\nimport pandas.util._test_decorators as td\n\nfrom pandas import (\n NA,\n Categorical,\n CategoricalDtype,\n In... | [
[
"pandas._testing.assert_produces_warning",
"pandas.CategoricalDtype",
"pandas.Series",
"pandas.Timestamp",
"numpy.unique",
"pandas.Categorical",
"numpy.arange",
"pandas.Index",
"numpy.dtype",
"pandas.Timedelta",
"numpy.random.randn",
"numpy.random.randint",
"pan... |
ding1998/BS_View_Recognition | [
"6856d9a2db148c4bbb9bc3f0ece06bea0c53824d"
] | [
"detect.py"
] | [
"import time\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom yolov3_tf2.models import (\n YoloV3, YoloV3Tiny\n)\nfrom yolov3_tf2.dataset import transform_images, load_tfrecord_dataset\nfrom yolov3_tf2.utils import draw_outputs\n\n... | [
[
"tensorflow.config.experimental.list_physical_devices",
"numpy.array",
"tensorflow.expand_dims",
"tensorflow.config.experimental.set_memory_growth"
]
] |
Electr0phile/pymoo | [
"652428473cc68b6d9deada3792635bc8a831b255",
"652428473cc68b6d9deada3792635bc8a831b255"
] | [
"pymoo/algorithms/so_de.py",
"pymoo/algorithms/so_gradient_descent.py"
] | [
"import numpy as np\n\nfrom pymoo.algorithms.genetic_algorithm import GeneticAlgorithm\nfrom pymoo.docs import parse_doc_string\nfrom pymoo.model.termination import SingleObjectiveToleranceBasedTermination\nfrom pymoo.operators.crossover.biased_crossover import BiasedCrossover\nfrom pymoo.operators.crossover.differ... | [
[
"numpy.where",
"numpy.argmin"
],
[
"numpy.isnan",
"numpy.atleast_2d",
"numpy.copy",
"numpy.any"
]
] |
brandon-b-miller/numba | [
"775b988bdd3ae4593aa6ed48d789edb4f13f8b07"
] | [
"numba/cpython/randomimpl.py"
] | [
"\"\"\"\nImplement the random and np.random module functions.\n\"\"\"\n\n\nimport math\nimport os\nimport random\n\nimport numpy as np\n\nfrom llvmlite import ir\n\nfrom numba.core.extending import overload, register_jitable\nfrom numba.core.imputils import (Registry, impl_ret_untracked,\n ... | [
[
"numpy.random.standard_gamma",
"numpy.random.chisquare",
"numpy.random.random",
"numpy.random.standard_normal",
"numpy.arange",
"numpy.random.shuffle",
"numpy.random.standard_exponential",
"numpy.copy",
"numpy.random.permutation",
"numpy.random.gamma",
"numpy.random.bin... |
constrainedlearning/advbench | [
"68f9f6d77268aad45517ca84d383b996724cc976"
] | [
"advbench/plotting/primal_dual.py"
] | [
"import argparse\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport pandas as pd\nimport json\nimport os\n\nfrom advbench.lib import reporting, plotting\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Plot primal dual')\n parser.add_argument('--in... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots_adjust",
"pandas.melt"
]
] |
bkmalayC/learntools | [
"37dda063e316503d53ac45f3b104a5cf1aaa4d78",
"c739a1ee131caebcb9bbd8b138d51cff75152f3a"
] | [
"learntools/advanced_pandas/summary_functions_maps.py",
"learntools/machine_learning/ex3.py"
] | [
"import pandas as pd\nreviews = pd.read_csv(\"../input/wine-reviews/winemag-data-130k-v2.csv\", index_col=0)\n\n\ndef check_q1(ans):\n expected = reviews.points.median()\n return ans == expected if type(ans) == float else False\n\n\ndef answer_q1():\n print(\"\"\"reviews.points.median()\"\"\")\n\n\ndef che... | [
[
"pandas.read_csv",
"pandas.Series"
],
[
"sklearn.tree.DecisionTreeRegressor"
]
] |
wangxiao1021/hapi | [
"73c474728bc467c8dcec8999e14a6e9c79941a3a"
] | [
"examples/emotion_detection/run_classifier.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.array",
"numpy.argmax"
]
] |
vturrisi/torchfuel | [
"bf9d967013fdb8367a302e8e801a3ad856517f9c"
] | [
"torchfuel/trainers/classification.py"
] | [
"import os\nimport sys\nfrom typing import Any, Dict, Optional, Union\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\ntorchfuel_path = os.path.dirname(\n os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))\n)\nsys.path.append(torch... | [
[
"torch.nn.functional.cross_entropy"
]
] |
BitskiCo/token-recommender | [
"bfa7ac01fcb469234ea4de972177795ab873424d"
] | [
"wals_ml_engine/trainer/get_recommendations.py"
] | [
"import numpy as np\nfrom model import generate_recommendations\n\nuser_address = '0x8c373ed467f3eabefd8633b52f4e1b2df00c9fe8'\nalready_rated = ['0x006bea43baa3f7a6f765f14f10a1a1b08334ef45','0x5102791ca02fc3595398400bfe0e33d7b6c82267','0x68d57c9a1c35f63e2c83ee8e49a64e9d70528d25','0xc528c28fec0a90c083328bc45f587ee21... | [
[
"numpy.load",
"numpy.searchsorted"
]
] |
ohhuola/Data-Mining-for-Cybersecurity | [
"7c04b2519810970227777fc1a1a29bb87d47a41e",
"7c04b2519810970227777fc1a1a29bb87d47a41e"
] | [
"Homework/2019/Task7/11/code/train.py",
"Homework/2019/Task7/1/code/preprocess/log_parse.py"
] | [
"# coding:utf-8\n# author: WenR0\n\nimport os\nfrom utils import recursion_load_php_file_opcode, load_php_opcode\n\nfrom sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn import met... | [
[
"sklearn.naive_bayes.GaussianNB",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.brier_score_loss",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.metrics.accuracy_score"
... |
NeilGirdhar/probability | [
"afc7ccfd6b5d8065b74b77e57e103d3cce5ee364"
] | [
"tensorflow_probability/python/internal/vectorization_util.py"
] | [
"# Copyright 2019 The TensorFlow Probability 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 a... | [
[
"tensorflow.compat.v2.nest.map_structure",
"tensorflow.python.ops.parallel_for.pfor",
"tensorflow.compat.v2.get_static_value",
"tensorflow.compat.v2.is_tensor",
"tensorflow.compat.v2.nest.is_nested",
"tensorflow.compat.v2.control_dependencies",
"tensorflow.compat.v2.name_scope",
"t... |
bage79/nlp4kor | [
"016a20270774325579fc816a0364fb1695e60b51"
] | [
"bage_utils/dataset.py"
] | [
"import gzip\nimport math\nimport os\nimport pickle\n\nimport numpy as np\n\nfrom bage_utils.char_one_hot_vector import CharOneHotVector\nfrom nlp4kor.config import log\n\n\nclass DataSet(object):\n def __init__(self, features: np.ndarray = None, labels: np.ndarray = None, features_vector: CharOneHotVector = Non... | [
[
"numpy.asarray",
"numpy.arange",
"numpy.concatenate",
"numpy.array_split",
"numpy.array"
]
] |
ParanoiaSYT/test | [
"fbefb045e97593b42ebb2a10c10ecaadf8786967"
] | [
"JPA/NA.JPA_APP/NA.S21.py"
] | [
"import numpy as np\nimport skrf as rf\nfrom lab import Application\n\n\nclass JPA_S21(Application):\n '''从网分上读取 JPA_S21\n require:\n rc : NA\n settings: repeat(optional)\n\n return: Frequency, Re(S21), Im(S21)\n '''\n\n async def work(self):\n if self.params.get('power', None) i... | [
[
"numpy.imag",
"numpy.abs",
"numpy.real",
"numpy.mean",
"numpy.angle"
]
] |
Astruj/Regional-English-Wiki | [
"2930765f06b6dbd1ade2004522f38f4d2fd08156"
] | [
"EnglishWiki/COVID-19 pandemic in India/pageviewsPerArticle.py"
] | [
"#import csv\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport csv\n\n\ndf = pd.read_csv ('hi_data.csv')\nhi_articles = list(df['article'])\npageviews1 = list(df['pageviews'])\nnumArticles1 = len(hi_articles)\ntemp = 0\nfor i in range(0,numArticles1):\n temp = temp + pageviews1[i]\navg1 = temp/n... | [
[
"pandas.read_csv"
]
] |
jackbenn/probabilistic-programming-intro | [
"b68f141481052dd53ebd5a2675b053740d745239"
] | [
"edward/edwd-simple-nnet.py"
] | [
"#!/usr/env/python\n\n\"\"\"\nsimple neural network example to model cosine data\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom edward.models import Normal\nimport edward as ed\nplt.style.use('bmh')\n\ndef buffer_layout(ax,buff=0.01):\n \"\"\"use x and y to add well... | [
[
"tensorflow.matmul",
"numpy.linspace",
"tensorflow.zeros",
"numpy.cos",
"tensorflow.ones",
"numpy.random.normal",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
]
] |
srijarkoroy/segRetino | [
"d141329dd38b919a5876a280de4dca3e860e31c3"
] | [
"data/dataset.py"
] | [
"import os\nimport numpy as np\nimport cv2\nimport torch\nfrom torch.utils.data import Dataset\n\nclass DriveDataset(Dataset):\n def __init__(self, images_path, masks_path):\n\n self.images_path = images_path\n self.masks_path = masks_path\n self.n_samples = len(images_path)\n\n def __get... | [
[
"numpy.expand_dims",
"torch.from_numpy",
"numpy.transpose"
]
] |
francofgp/Tic-Tac-Toe-Gym | [
"702d8876c2941b0fe9c6e7c8da0a7f209afd7cf9"
] | [
"tictactoe.py"
] | [
"import pygame\nimport sys\nimport numpy as np\nimport gym\nfrom gym import spaces\nfrom gym.spaces import Discrete, Box\nfrom stable_baselines3 import PPO\nimport random\nimport time\n\npygame.init()\n\nWIDTH = 600\nHEIGHT = 600\nLINE_WIDTH = 15\nWIN_LINE_WIDTH = 15\nBOARD_ROWS = 3\nBOARD_COLS = 3\nSQUARE_SIZE = 2... | [
[
"numpy.zeros"
]
] |
jpohanka/testing-tensorflow | [
"1b11f08470819ea65e424be2f76bca98241b5ae0"
] | [
"tf-demonstration/models/multivariate_t_distribution/multivariate_t_distribution.py"
] | [
"from __future__ import print_function\n\nimport tensorflow as tf\nfrom tensorflow.contrib import distributions as tfcd\n\ng = tf.Graph()\n\n\"\"\"\nThe idea comes from Lemma 1 from the paper \"Some Characterizations of the Multivariate t Distribution\":\n\nhttps://ac.els-cdn.com/0047259X72900218/1-s2.0-0047259X729... | [
[
"tensorflow.cholesky",
"tensorflow.Graph",
"tensorflow.summary.FileWriter",
"tensorflow.contrib.distributions.StudentT",
"tensorflow.contrib.distributions.bijectors.Affine",
"tensorflow.name_scope",
"tensorflow.Session"
]
] |
Squadrick/agents | [
"d7905cfc8b317900657113c34f51244ec5211b69"
] | [
"tf_agents/agents/categorical_dqn/categorical_dqn_agent.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents 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 b... | [
[
"tensorflow.concat",
"tensorflow.nest.assert_same_structure",
"tensorflow.control_dependencies",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.equal",
"tensorflow.abs",
"tensorflow.nest.flatten",
"tensorflow.linspace",
"tensorflow.add",
... |
fleur101/predict-python | [
"d40c876d919232bbb77904e050b182c875bc36fa",
"d40c876d919232bbb77904e050b182c875bc36fa"
] | [
"src/core/tests/test_core.py",
"src/encoding/tests/test_encoder.py"
] | [
"import os\n\nfrom django.test.testcases import TestCase\nfrom pandas.util.testing import assert_frame_equal\n\nfrom src.cache.cache import get_digested\nfrom src.cache.models import LabelledLog, LoadedLog\nfrom src.encoding.common import get_encoded_logs\nfrom src.utils.tests_utils import create_test_job\n\n\nclas... | [
[
"pandas.util.testing.assert_frame_equal"
],
[
"pandas.DataFrame"
]
] |
emadboctorx/stable-baselines3 | [
"2d66de446a0a2832a52f5710e291f2e23729b8e2"
] | [
"stable_baselines3/her/her_replay_buffer.py"
] | [
"import warnings\nfrom collections import deque\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch as th\n\nfrom stable_baselines3.common.buffers import DictReplayBuffer\nfrom stable_baselines3.common.preprocessing import get_obs_shape\nfrom stable_baselines3.common.type... | [
[
"numpy.arange",
"numpy.tile",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
csmith49/maude | [
"b6287230a1cfb5b785f8153910970acbf3077bfd"
] | [
"src/darknet/model.py"
] | [
"# only import from cv2 what we need - need opencv > 3.4\nfrom cv2 import imread\nfrom cv2.dnn import readNetFromDarknet, blobFromImage, NMSBoxes\n\n# some minor matrix stuff\nfrom numpy import argmax, array\nfrom numpy.random import randint\n\n# and we'll be constructing predictions\nfrom .prediction import Predic... | [
[
"numpy.array",
"numpy.argmax",
"numpy.random.randint"
]
] |
pysiakk/bigclam | [
"67685fab9e3dae54ca8b8f58e9fb002f1ad759c7"
] | [
"util/generate_data.py"
] | [
"import json\nimport numpy as np\nfrom random import random\nimport pickle\n\n\nclass Datagen():\n def __init__(self, N, w, p, cross):\n \"\"\"\n Data generator.\n The social network will have N people. At first, we assign each\n person a community with probability w_i. Secondly. we a... | [
[
"numpy.random.choice",
"numpy.save",
"numpy.where",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
RicoSuaveGuapo/yolact | [
"cabb939a51878c88c20d0e929944ad5409e47642"
] | [
"layers/modules/multibox_loss.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom ..box_utils import match, log_sum_exp, decode, center_size, crop, elemwise_mask_iou, elemwise_box_iou\n\nfrom data import cfg, mask_type, activation_func\n\n\nclass MultiBoxLoss(... | [
[
"torch.abs",
"torch.nn.functional.softmax",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.randperm",
"torch.sum",
"torch.no_grad",
"torch.nn.functional.smooth_l1_loss",
"torch.autograd.Variable",
"torch.sqrt",
"torch.nn.functional.binary_cross_entropy_with_logits"... |
acamargofb/nipype | [
"47e149bbd6a9e865e9242e50fb7ca1a18adfc640"
] | [
"nipype/interfaces/nitime/analysis.py"
] | [
"# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"\nInterfaces to functionality from nitime for time-series analysis of fmri data\n\n- nitime.analysis.CoherenceAnalyzer: Coherence/y\n- nitime.fmri.io:\n- nitime.viz.dra... | [
[
"numpy.savetxt",
"numpy.mean",
"numpy.where",
"numpy.loadtxt"
]
] |
montyly/adversarial-robustness-toolbox | [
"40b1592dfd268b3a6d1aad1f8a4c847c9e01a270"
] | [
"test_accuracies.py"
] | [
"# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ... | [
[
"numpy.load",
"tensorflow.Session"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.