repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ebbingcasa/cs224u
[ "d491b93ecb12a523bfbeb84230a5a3510493c448" ]
[ "test/test_utils.py" ]
[ "import numpy as np\nimport os\nimport pytest\nimport random\nimport utils\n\n__author__ = \"Christopher Potts\"\n__version__ = \"CS224u, Stanford, Spring 2021\"\n\n\nutils.fix_random_seeds()\n\n\n@pytest.mark.parametrize(\"arg, expected\", [\n [\n np.array([0.0, 0.25, 0.75]),\n np.array([0.2272197...
[ [ "numpy.array", "numpy.random.random", "torch.rand", "numpy.array_equal" ] ]
MeRajat/skorch
[ "6b013a1fa8b52cf781d54abbae515c755e1c6f9c" ]
[ "skorch/callbacks/regularization.py" ]
[ "\"\"\" Post-process regularization steps such as gradient normalizing. \"\"\"\n\nfrom torch.nn.utils import clip_grad_norm_\n\nfrom skorch.callbacks import Callback\n\n\n__all__ = ['GradientNormClipping']\n\n\nclass GradientNormClipping(Callback):\n \"\"\"Clips gradient norm of a module's parameters.\n\n The...
[ [ "torch.nn.utils.clip_grad_norm_" ] ]
giruenf/GRIPy-3
[ "ea0f5175bbdd966ca2df956f4667a806d035e532" ]
[ "classes/ui/propgrid.py" ]
[ "from collections import OrderedDict, Sequence\n\nimport wx\nimport wx.propgrid as pg\nimport matplotlib.colors as mcolors\n\nfrom classes.ui import UIManager\nfrom classes.ui import UIControllerObject\nfrom classes.ui import UIViewObject\nimport app.pubsub as pub\nfrom app.app_utils import MPL_COLORS, MPL_COLORMAP...
[ [ "matplotlib.colors.get_named_colors_mapping", "matplotlib.colors.is_color_like", "matplotlib.colors.to_hex", "matplotlib.colors.to_rgb" ] ]
junyoungkim22/sqlova
[ "b7525459dfc7033a071eead3d29b0849906b7974" ]
[ "sqlova/utils/utils_wikisql.py" ]
[ "# Copyright 2019-present NAVER Corp.\n# Apache License v2.0\n\n# Wonseok Hwang\n\nimport os, json\nimport random as rd\nfrom copy import deepcopy\n\nfrom matplotlib.pylab import *\n\nimport torch\nimport torchvision.datasets as dsets\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nfrom .utils import g...
[ [ "torch.sigmoid", "torch.nn.functional.softmax", "torch.LongTensor", "torch.zeros", "torch.utils.data.DataLoader", "torch.nn.utils.rnn.pack_padded_sequence", "torch.tensor", "torch.nn.utils.rnn.pad_packed_sequence", "torch.cuda.is_available" ] ]
hi-zhengcheng/examples
[ "6c3c9b62e202923d1d87d03c51b1e79279bdae4b" ]
[ "tensorflow_examples/lite/model_maker/demo/image_classification_demo_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the 'License');\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.io.gfile.exists", "tensorflow.compat.v1.logging.info", "tensorflow.test.main" ] ]
zuoqin/restapi_admin
[ "89f6f6709f1c006e67497e2484cfcc03f695c534" ]
[ "AddressAPI.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport psycopg2\nimport psycopg2.extras\nimport pandas as pd\nimport random\nimport apilib\nfrom flask import Flask, jsonify, request\nfrom flasgger import Swagger\nfrom flask_jwt_extended import (create_access_token,\n create_refresh_token, jwt_required, jwt_refresh_...
[ [ "pandas.read_sql" ] ]
bopopescu/Social-Lite
[ "ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf" ]
[ "google-cloud-sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py" ]
[ "# Copyright 2018 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.expand_dims", "tensorflow.compat.v1.saved_model.loader.maybe_saved_model_directory", "tensorflow.compat.v1.disable_v2_behavior", "numpy.asarray", "tensorflow.python.util.compat.as_text", "tensorflow.compat.v1.gfile.Copy", "tensorflow.compat.v1.Session", "tensorflow.compat.v1...
AiPBAND/OmiTrans
[ "8e5d9198a1ee422eb805e5ead068c1a2523aeed5" ]
[ "models/c_gan_model.py" ]
[ "import torch\nfrom .basic_model import BasicModel\nfrom . import networks\nfrom . import losses\nimport torch.nn as nn\n\n\nclass CGanModel(BasicModel):\n \"\"\"\n This class implements the conditional GAN model, for learning a mapping from input omics data type to output omics\n data type given paired da...
[ [ "torch.nn.Sigmoid" ] ]
numahha/wmopo
[ "1557dab2e8168c1f2e53ffbc435b4000680f1d28" ]
[ "pendulum_experiments/model.py" ]
[ "import torch\nimport torch.nn.functional as F\n\nclass DynamicsModel(torch.nn.Module): # transitioin function\n def __init__(self, D_in, D_out, hidden_unit_num):\n\n print(\"[DynamicsModel] H =\",hidden_unit_num)\n super(DynamicsModel, self).__init__()\n\n # zero hidden layer\n #self...
[ [ "torch.nn.Linear", "torch.ones_like", "torch.zeros" ] ]
WavesLi/NSC_2to3
[ "3292ac804f8bebce722c0c9fcb2b41ff4f298e2d" ]
[ "NSC+LA/src/LSTMModel.py" ]
[ "#-*- coding: UTF-8 -*- \nfrom EmbLayer import EmbLayer\nfrom LSTMLayer import LSTMLayer\nfrom HiddenLayer import HiddenLayer\nfrom PoolLayer import *\nfrom SentenceSortLayer import *\nimport theano\nimport theano.tensor as T\nimport numpy\nimport random\nimport sys\nfrom Update import AdaUpdates\n\nclass LSTMMode...
[ [ "numpy.float32", "numpy.random.randint" ] ]
khushhallchandra/Deep-Learning-Project
[ "cf832f96d55e268b3eaba62a25ee6b04c22389e0" ]
[ "ExchangeRate/method1b.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas\nimport math\nimport datetime\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.metrics import mean_squared_error\n\ndata_folder = 'data...
[ [ "numpy.reshape", "numpy.genfromtxt", "matplotlib.pyplot.plot", "sklearn.metrics.mean_squared_error", "matplotlib.pyplot.subplot", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros" ] ]
megrao/BioSPPy
[ "52340610f850f382082136cd645496e22fbdbae5" ]
[ "biosppy/signals/bcg.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nbiosppy.signals.bcg\n-------------------\n\nThis module provides methods to process Ballistocardiographic (BCG) signals.\nImplemented code assumes a single-channel head-to-foot like BCG signal.\n\n:author: Guillaume Cathelain\n\n\"\"\"\n\n# Imports\n# compat\nfrom __future__ import...
[ [ "scipy.signal.find_peaks", "numpy.linspace", "scipy.fftpack.fft", "numpy.concatenate", "numpy.mean", "scipy.cluster.hierarchy.leaders", "numpy.where", "numpy.argmax", "numpy.insert", "scipy.cluster.hierarchy.linkage", "numpy.zeros", "numpy.power", "numpy.min", ...
adrn/thejoker
[ "e77182bdb368e20127a17cc76ba1083ab77746ea" ]
[ "thejoker/src/setup_package.py" ]
[ "from distutils.core import Extension\nfrom collections import defaultdict\nimport os\n\n\ndef get_extensions():\n exts = []\n\n import numpy as np\n import twobody\n\n cfg = defaultdict(list)\n cfg['include_dirs'].append(np.get_include())\n\n twobody_path = os.path.dirname(twobody.__file__)\n ...
[ [ "numpy.get_include" ] ]
seraconlp/transformers
[ "1073a2bde5d608f9891d6da6df7b63921dca1b71" ]
[ "tests/test_modeling_tf_openai.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.convert_to_tensor", "tensorflow.expand_dims" ] ]
VMK11/cnn-text-classification
[ "63df563b6dede311f0b4f882f0e2759f375f768f" ]
[ "train.py" ]
[ "#! /usr/bin/env python\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport data_helpers\nfrom text_cnn import TextCNN\nfrom tensorflow.contrib import learn\nimport os, argparse\nfrom tensorflow.python.framework import graph_util\n\n\n# Parameters\n# =====================...
[ [ "tensorflow.train.global_step", "tensorflow.global_variables", "tensorflow.train.AdamOptimizer", "tensorflow.flags.DEFINE_float", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.app.run", ...
whzhangg/IFermi
[ "511c69acd1e5ac849f073d435210a25a603d5bcb" ]
[ "ifermi/QE_adaptor.py" ]
[ "import re\nimport numpy as np\nfrom pymatgen.electronic_structure.bandstructure import BandStructure\nfrom pymatgen.core.lattice import Lattice\nfrom pymatgen.core.structure import Structure\nfrom pymatgen.electronic_structure.core import Spin\n\n# Wenhao Zhang, 2021/09/23 wenhao997@outlook.com\n# examples/MgB2_QE...
[ [ "numpy.array", "numpy.zeros" ] ]
agora-ecosystem/tee-bench
[ "befa7ff19963643a6e98840b38065ad7ce5791c1" ]
[ "scripts/exp6-scale-r-experiment-SUDO.py" ]
[ "#!/usr/bin/python3\n\nimport commons\nimport re\nimport statistics\nimport subprocess\nimport csv\nimport matplotlib.pyplot as plt\n\nfilename = \"data/scale-r-output.csv\"\nmb_of_data = 131072\n\n\ndef run_join(prog, alg, size_r, size_s, threads, reps, mode):\n f = open(filename, \"a\")\n results = []\n ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "matplotlib.pyplot.xlim", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ...
AndrewZeitler/Cyber-Bullying-Detection-Bot
[ "4973077fe0f56f8a98f111d8fa0f9afca01166c8" ]
[ "cyber/cyberbullying_detection.py" ]
[ "# Data processing tools\r\nimport praw\r\nimport pickle\r\nimport pandas\r\nimport numpy\r\n\r\n# Machine Learning Tools\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.feature_extraction.text import TfidfVectorizer\r\nfrom skle...
[ [ "pandas.read_pickle", "sklearn.naive_bayes.MultinomialNB", "sklearn.model_selection.train_test_split", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.svm.SVC", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
apoorvaish/mujoco-rl
[ "234bd7689990cdd63db458d0367e14ccd1b62c1f" ]
[ "td-actor-critic-state-value-functions/dl.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nclass Network(nn.Module):\n def __init__(self, lr, input_dims, n_hidden=64, output_dims=4):\n super(Network, self).__init__()\n self.fc1 = nn.Linear(input_dims, n_hidden)\n ...
[ [ "torch.nn.Linear" ] ]
lolwuz/traffic_simulator
[ "4ba221f764d0c80a457b75c0d6059e6aee826421" ]
[ "python_controller/server.py" ]
[ "#!/usr/bin/env python\nfrom objects.controller import Controller\nfrom SimpleWebSocketServer import SimpleWebSocketServer, WebSocket\nimport json\nimport pandas\nimport time\ntry:\n import thread as thread # For ubuntu thread\nexcept ModuleNotFoundError:\n import _thread as thread # Mac/Windows\n\n\n_ADDRE...
[ [ "pandas.read_csv" ] ]
thimathabeysirigunawardena/plot
[ "1f3639d853cfe91bce628eba63b7fcde971b3c2e" ]
[ "scatterplot.py" ]
[ "import pandas as pd\nimport plotly.express as px\n\ndf = pd.read_csv(\"data.csv\")\nfig = px.scatter(df, x=\"Population\", y=\"cases\",\n\t size=\"number\",color=\"Country\",\n size_max=60)\nfig.show()\n" ]
[ [ "pandas.read_csv" ] ]
gitaar9/graf
[ "f7692ad885c1a3b8a377fed3b74c9ce6b9210732" ]
[ "graf/models/generator.py" ]
[ "import numpy as np\nimport torch\nfrom ..utils import sample_on_sphere, look_at, to_sphere\nfrom ..transforms import FullRaySampler\nfrom submodules.nerf_pytorch.run_nerf_mod import render, run_network # import conditional render\nfrom functools import partial\n\n\nclass Generator(object):\n def __in...
[ [ "numpy.random.uniform", "numpy.arange" ] ]
bjoern1001001/viziphant
[ "1a63e0dbbae9d69173ed482771227d2970a95a80" ]
[ "viziphant/rasterplot.py" ]
[ "\"\"\"\nSimple but highly configurable plotting functions for spiketrains in neo format.\nWhile building on the matplotlib libary the functions lay an emphasis on clear,\npleasant-to-look-at visualizations.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom elephant.statist...
[ [ "numpy.unique", "matplotlib.pyplot.subplots", "matplotlib.pyplot.axes", "numpy.max", "numpy.concatenate", "numpy.append", "numpy.array", "numpy.where" ] ]
gwallison/open-FF
[ "d0c1a9ace91abfb6f5393c85ee511366ca4b1fbe" ]
[ "update_density_PHASE_4.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 5 14:33:38 2021\n\n@author: Gary\n\nThis is used to fetch basic information from the IngredientComment field.\n\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport core.Read_FF as rff\n\n#### ----------- File handles -------------- ####\n\n####### unco...
[ [ "numpy.where" ] ]
fplk/gpt-neox
[ "9992042ab113428022e5e91421c04917577b8e00" ]
[ "megatron/global_vars.py" ]
[ "# coding=utf-8\n# Copyright (c) 2021, EleutherAI contributors\n# This file is based on code by the authors denoted below and has been modified from its original version.\n#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# yo...
[ [ "torch.distributed.get_rank", "torch.cuda.synchronize", "torch.distributed.is_initialized", "torch.utils.tensorboard.SummaryWriter" ] ]
darianyang/traj-plot
[ "849c1e6b5a6f6f64fb66e62149f98318b07fe292" ]
[ "traj_plot/data_plot_2D.py" ]
[ "\"\"\"\nPlot 2D timeseries data heatmaps such as secondary structure and per residue RMSD.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\n\nimport matplotlib.cm as cm\nfrom matplotlib.colors import Normalize\nfrom matplotlib.colors import ListedColormap\n\nfrom matplotlib...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.char.split", "matplotlib.pyplot.subplots", "matplotlib.colors.Normalize", "numpy.genfromtxt", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.colorbar", "matplotlib.colors.ListedColorma...
kmckiern/spin
[ "2e2badcff2cac65c63c2752c1be3ca89673ce58d" ]
[ "spin/operators.py" ]
[ "from __future__ import division\nimport numpy as np\nfrom scipy.ndimage import filters\n\n\ndef adj_kernel(configuration):\n \"\"\" Creates adjecency kernel for arbitrary dimensional array \"\"\"\n # ensure each dimension is gt 2\n for dim_length in configuration.shape:\n assert dim_length > 2\n\n ...
[ [ "numpy.abs", "numpy.ones", "numpy.mean", "scipy.ndimage.filters.convolve", "numpy.sum" ] ]
bittersweetpuff/in-search-of-the-unknown-roguelike
[ "fd1bfd488f0d4e42e0b8246d0d76086788eb14f0" ]
[ "src/tile_types.py" ]
[ "from typing import Tuple\n\nimport numpy as np # type: ignore\n\n# Tile graphics structured type compatible with Console.tiles_rgb.\ngraphic_dt = np.dtype(\n [\n (\"ch\", np.int32), # Unicode codepoint.\n (\"fg\", \"3B\"), # 3 unsigned bytes, for RGB colors.\n (\"bg\", \"3B\"),\n ]\n)...
[ [ "numpy.array", "numpy.dtype" ] ]
Hosseinberg/Cirq
[ "8b64834ba601e8b48394753c24800e16b36a59b1" ]
[ "cirq-core/cirq/sim/clifford/act_on_stabilizer_ch_form_args.py" ]
[ "# Copyright 2020 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.exp" ] ]
Ddottsai/Code-Storage
[ "fe8753e3d93dfa69822ae06b64cc7d3b259a4434" ]
[ "Quick Terminal-Interface Database/resource_database.py" ]
[ "class resource_database():\n import pandas as pd\n import ujson as json\n from io import StringIO\n from multiprocessing import Pool\n from functools import partial\n import ast\n import os\n import re\n import glob\n import textwrap\n from contextlib import suppress\n from pand...
[ [ "pandas.read_csv", "pandas.Series", "pandas.DataFrame", "pandas.DataFrame.from_records", "pandas.set_option" ] ]
chengstone/insightface
[ "33d9a34d5f5e7adfc0e28843072c86699499bd8f" ]
[ "src/eval/verification.py" ]
[ "\"\"\"Helper for evaluation on the Labeled Faces in the Wild dataset \n\"\"\"\n\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\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 So...
[ [ "numpy.asarray", "sklearn.model_selection.KFold", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.square", "numpy.arange", "numpy.less", "numpy.subtract", "numpy.std", "numpy.argmax", "scipy.interpolate.interp1d", "numpy.zeros", "numpy.logical_not", ...
jeanp413/cudf
[ "3f0859824cae915e246a41be17d4d4789ec72b9f" ]
[ "python/cudf/cudf/tests/test_column.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION.\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport cudf\nfrom cudf.tests.utils import assert_eq\n\ndtypes = [\n \"int8\",\n \"int16\",\n \"int32\",\n \"int64\",\n \"float32\",\n \"float64\",\n \"datetime64[ns]\",\n \"str\",\n \"c...
[ [ "pandas.api.types.is_string_dtype", "pandas.Series", "numpy.random.randint" ] ]
weilinie/JARE
[ "13967b3525c54a52cb0217e388be3d0f8ae68447" ]
[ "real/run.py" ]
[ "import argparse\nimport os\nimport tensorflow as tf\nimport numpy as np\n\nimport models\nfrom libs.inputs import (\n get_filename_queue,\n get_input_image, get_input_cifar10,\n create_batch\n)\nfrom train import train\nfrom utils import pp\n\nparser = argparse.ArgumentParser(description='Train and run a ...
[ [ "tensorflow.set_random_seed", "numpy.random.seed" ] ]
md11235/ssd.pytorch
[ "b168ee9c92cc1f53685fc4f42b906fcfb424d0c7" ]
[ "layers/modules/multibox_quadrilateral_loss.py" ]
[ "# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom data import coco as cfg\nfrom ..box_utils import match, log_sum_exp, match_quadrilaterals\n\n\nclass MultiBoxQuadrilaterralLoss(nn.Module):\n \"\"\"SSD Weighted Loss Function\...
[ [ "torch.LongTensor", "torch.Tensor", "torch.nn.functional.cross_entropy", "torch.nn.functional.smooth_l1_loss", "torch.autograd.Variable" ] ]
zeroam/TIL
[ "43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1" ]
[ "deep-learning-from-scratch/ch07/visualize_filter.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom simple_convnet import SimpleConvNet\n\n\ndef filter_show(filters, nx=8, margin=3, scale=10):\n FN, C, FH, FW = filters.shape\n ny = int(np.ceil(FN / nx))\n \n fig = plt.figure()\n fig.subplots_adjust(left=0, right=1, bottom=0, top=1, hspace=0...
[ [ "numpy.ceil", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
AtticusJohnson/mmdetection
[ "d8d89bafcce13d3b32b1fb3366be3bb9830546c2" ]
[ "tools/test.py" ]
[ "import argparse\nimport os\n\nimport mmcv\nimport torch\nfrom mmcv import Config, DictAction\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import get_dist_info, init_dist, load_checkpoint\nfrom tools.fuse_conv_bn import fuse_module\n\nfrom mmdet.apis import multi_gpu_test, ...
[ [ "torch.cuda.current_device" ] ]
gzydominating/tf-faster-rcnn
[ "83668f40a3bc725e261c8aab7cb197b603640bed" ]
[ "lib/model/config.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport os.path as osp\nimport numpy as np\n# `pip install easydict` if you don't have it\nfrom easydict import EasyDict as edict\n\n__C = edict()\n# Consumers can get config by:\n# from fa...
[ [ "numpy.array" ] ]
limscoder/predator
[ "5999468d417dbab159529b8764866e2581802a01" ]
[ "models/lstm/model.py" ]
[ "\"\"\"trains lstm model on coin data\"\"\"\n\n# adapted from -- https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/\n\nfrom pandas import DataFrame, concat, read_csv\nfrom sklearn.preprocessing import MinMaxScaler\nfrom keras.models import Sequential\nfrom keras.layers import Dense...
[ [ "matplotlib.pyplot.legend", "pandas.concat", "pandas.read_csv", "tensorflow.saved_model.builder.SavedModelBuilder", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "sklearn.preprocessing.MinMaxScaler" ] ]
r00tDada/Mini_Project_Semester_7
[ "fd84be13d91c9ffca8288c7787a0330a5aee7950" ]
[ "Resume_Matcher/fileReader.py" ]
[ "from operator import index\nfrom pandas._config.config import options\nimport Cleaner\nimport textract as tx\nimport pandas as pd\nimport numpy\nimport os\nimport tf_idf\n\nuser = os.getcwd()\nprint(user)\n\n\nresume_dir = user+\"/media/Resume/\"\njob_desc_dir = user+\"/media/JobDesc/\"\nresume_names = os.listdir(...
[ [ "pandas.DataFrame" ] ]
bhargavyagnik/TRex-Bot-Google-Chrome-Offline-game-
[ "71581096a35c1935c973aa9cfda480c0b057d50b" ]
[ "temp.py" ]
[ "import pyautogui as pg\r\nfrom PIL import ImageGrab\r\nimport cv2\r\nimport numpy as np\r\nimport time\r\n\r\n\r\ndef up(sleep_time):\r\n time.sleep(sleep_time)\r\n pg.press(\"space\")\r\n time.sleep(0.1)\r\n pg.press(\"down\")\r\n\r\ndef boot():\r\n template=cv2.imread('cactus.jpg',0)\r\n templa...
[ [ "numpy.array", "numpy.where" ] ]
himkt/pymc3
[ "fde52a4a69be1b0887a2f7861801fb48c941bbe6" ]
[ "pymc3/tests/test_gp.py" ]
[ "# pylint:disable=unused-variable\nfrom functools import reduce\nfrom ..math import cartesian, kronecker\nfrom operator import add\nimport pymc3 as pm\nimport theano\nimport theano.tensor as tt\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\n\nnp.random.seed(101)\n\n\nclass TestZeroMean(object):\n...
[ [ "numpy.diag", "numpy.dot", "numpy.log", "numpy.linalg.solve", "numpy.allclose", "numpy.random.seed", "numpy.linspace", "numpy.ones", "numpy.all", "numpy.random.randn", "numpy.random.rand", "numpy.any", "numpy.testing.assert_allclose", "numpy.random.uniform",...
NBUFabio25/Speaker_Verification-
[ "b6691d0c78e50803d1d7117887c81e5ce57fd34b" ]
[ "utils.py" ]
[ "# Third Party\nimport librosa\nimport numpy as np\nimport torch.nn.functional as F\n\n\n# ===============================================\n# code from Arsha for loading data.\n# This code extract features for a give audio file\n# ===============================================\ndef load_wav(audio_filepath, s...
[ [ "numpy.concatenate", "numpy.std", "torch.nn.functional.cosine_similarity", "numpy.mean", "numpy.load", "numpy.random.randint" ] ]
Dowell-Lab/OCR_transcription_detection
[ "702c49d4c4ae7c0eefdf1fa52a218359c52cbe27" ]
[ "dataset_stats.py" ]
[ "import pandas as pd\n\ndata = pd.read_pickle('./combined_dataset_union_fstitchtfit.pkl')\ndata['prom_ovlp'] = data['prom_ovlp'].clip(upper=1)\n\nprint(\"For all OCRs:\")\nprint(\"OCRs overlapping nascent transcription:\")\nprint(data.groupby(['sample', 'ovlp_txn']).size())\nprint(\"OCRs overlapping TSSs:\")\nprint...
[ [ "pandas.read_pickle" ] ]
lxgrf/posenet_jetson_nano
[ "41e1a728f7c1db153b942a7174bec2383a5c00ad" ]
[ "webcam_demo.py" ]
[ "import tensorflow as tf\nimport cv2\nimport time\nimport argparse\n\nimport posenet\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--model', type=int, default=101)\nparser.add_argument('--cam_id', type=int, default=0)\nparser.add_argument('--cam_width', type=int, default=1280)\nparser.add_argument('--...
[ [ "tensorflow.Session" ] ]
woo1/Anim-NeRF
[ "03977700420691b18b6aa0bc809f3a05a9f07b12" ]
[ "models/volume_rendering.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nif torch.__version__ < '1.6.0':\n from torchsearchsorted import searchsorted\n\nclass VolumeRenderer(nn.Module):\n def __init__(\n self, \n n_coarse=64,\n n_fine=0,\n n_fine_depth=0,\n share_fine=False,\n...
[ [ "torch.randn_like", "torch.linspace", "torch.max", "torch.clamp_max", "torch.cat", "torch.sum", "torch.zeros_like", "torch.gather", "torch.relu", "torch.no_grad", "torch.rand", "torch.cumprod", "torch.sort", "torch.clamp_min", "torch.searchsorted", "...
chris4540/DD2412-adl-proj
[ "69490f335acb6bc9eb8bca29329de1debb2c9c83" ]
[ "utils/eval.py" ]
[ "import tensorflow as tf\n\ndef evaluate(data_loader, model, output_activations=True):\n total = 0\n correct = 0.0\n for inputs, labels in data_loader:\n if output_activations:\n out, *_ = model(inputs, training=False)\n else:\n out = model(inputs, training=False)\n\n ...
[ [ "tensorflow.reshape", "tensorflow.cast", "tensorflow.math.softmax", "tensorflow.argmax", "tensorflow.size" ] ]
BChaudron/entsoe-py
[ "be6c724c4b9aac438954f79623d7ec0b51ab4848" ]
[ "entsoe/misc.py" ]
[ "import pandas as pd\nfrom dateutil import rrule\nfrom itertools import tee\n\n\ndef year_blocks(start, end):\n \"\"\"\n Create pairs of start and end with max a year in between, to deal with usage restrictions on the API\n\n Parameters\n ----------\n start : dt.datetime | pd.Timestamp\n end : dt....
[ [ "pandas.Timestamp" ] ]
shreyaspj20/DataScientist
[ "47bcbd7415eb4d7d91dbc893a6476861d048cca6" ]
[ "datascientist/feature_selection/test/test_pearson.py" ]
[ "#Reading the test file having the data of footballers and target being their\n#overall skill score ( 1-100 ).\nimport pandas as pd\nplayer_df = pd.read_csv(\"datascientist/feature_selection/test/CSV/data.csv\")\n\n#Taking only those columns which have numerical or categorical values since \n#feature selection with...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.get_dummies" ] ]
loriab/geomeTRIC
[ "335e97896e8efc261b2a041bd7ffeade1bf3f7d7" ]
[ "geometric/rotate.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import division\nfrom forcebalance.nifty import invert_svd\nfrom forcebalance.molecule import *\nimport numpy as np\nimport sys\n\n\"\"\"\nReferences\n----------\n1. E. A. Coutsias, C. Seok, K. A. Dill. \"Using Quaternions to Calculate RMSD.\". J. Comput. Chem 2004.\n\"\"\"...
[ [ "numpy.matrix", "numpy.dot", "numpy.abs", "numpy.sqrt", "numpy.eye", "numpy.arccos", "numpy.max", "numpy.linalg.eigh", "numpy.zeros_like", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
mobiledgex/edge-cloud-sampleapps
[ "f9d7b04cf56d949a7cc78bb9987608024f583af4" ]
[ "TritonInferenceServer/clients/rest_client.py" ]
[ "# Copyright 2021 MobiledgeX, Inc. All rights and licenses reserved.\n# MobiledgeX, Inc. 156 2nd Street #408, San Francisco, CA 94105\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...
[ [ "numpy.frombuffer" ] ]
sanyabt/kg-microbe
[ "5886197d5fa00ab4c2e6af09dd9f5a3bc453743f" ]
[ "kg_microbe/utils/nlp_utils.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport configparser\nfrom kgx.cli.cli_utils import transform\nfrom oger.ctrl.router import Router, PipelineServer\nfrom oger.ctrl.run import run as og_run\nfrom kg_microbe.utils import biohub_converter as bc\nimport pandas as pd\n\nSETTINGS_FILENAME = 's...
[ [ "pandas.read_csv" ] ]
shingte/Face-Expression-Transfer-by-Audio
[ "7aa93880bbc62b7f9fe25428d425ea3f0f73c8b0" ]
[ "code/models.py" ]
[ "import torch\nimport torch.nn as nn\n# from pts3d import *\nfrom ops import *\nimport torchvision.models as models\nimport functools\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.nn import init\nimport numpy as np\nfrom convolutional_rnn import Conv2dGRU\n\nclass Flatten(nn.Modu...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ReflectionPad2d", "torch.nn.ConvTranspose2d", "torch.nn.LSTM", "torch.cat", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.stack...
elix-tech/infrag
[ "e5fa6b91659ed94e64ffbb3272b90fd3618e017e" ]
[ "egegl/models/handlers/explainer_handler.py" ]
[ "\"\"\"\nExplainer handler class\n\nCopyright (c) 2021 Elix, Inc.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Adam\nfrom torch_geometric.data import Batch\n\nfrom egegl.models.attribution import (\n AbstractExplainer,\n DirectedMessagePassingNetwork,\n GraphConvNetwork,\n)\n\n\n...
[ [ "torch.transpose", "torch.no_grad", "torch.nn.MSELoss" ] ]
jonboh/virtual_worlds
[ "d9a96d51cfa9ef598b3f17f751ad3fdb516d7e23" ]
[ "tests/universe_tests.py" ]
[ "import pytest\nfrom unittest import mock\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom universe import *\nfrom rules import *\n\n\ndef default_universe_creation():\n np.random.seed(1)\n num_agents = 7\n num_foods = 25\n num_dims = 2\n np.random.seed(2)\n rules = Rules\n agents = [...
[ [ "numpy.array", "numpy.random.rand", "numpy.random.seed" ] ]
Junyoungpark/CGS
[ "a0230d9898f13d1456f8d706b97a93d814b51e64" ]
[ "gvi_train.py" ]
[ "from time import perf_counter\n\nimport dgl\nimport hydra\nimport torch\nimport torch.optim as th_op\nfrom torch.optim.lr_scheduler import CosineAnnealingWarmRestarts\n\nfrom CGS.experiments.gvi.generate_graph import generate_graphs_seq\nfrom CGS.gnn.CGS.get_model import get_model\nfrom CGS.utils.test_utils import...
[ [ "torch.optim.lr_scheduler.CosineAnnealingWarmRestarts", "torch.nn.MSELoss" ] ]
joelibaceta/backend-codigo-10
[ "75256580ce9975bcfa831fde884362787d82b71f" ]
[ "sesion41/fashion_tester/pre.py" ]
[ "from PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport matplotlib.image as mpimg\n\ndef rgb2gray(rgb):\n return np.dot(rgb[...,:3], [0.2989, 0.5870, 0.1140])\n\nim = mpimg.imread('sneaker_test.jpg')#.convert('L')\n#imr = im.resize((28, 28))\n\ngray = rgb2gray(im)\n\nplt.imshow(gray...
[ [ "matplotlib.image.imread", "numpy.dot", "matplotlib.pyplot.show", "matplotlib.pyplot.get_cmap" ] ]
asappresearch/aum
[ "892e76eda4b6b85e21bda441d86134e0430ded7a" ]
[ "examples/paper_replication/runner.py" ]
[ "import datetime\nimport logging\nimport os\nimport random\nimport shutil\nimport sys\nfrom collections import OrderedDict\n\nimport numpy as np\nimport pandas as pd\nimport torch\n\nimport fire\nimport tqdm\nimport util\nfrom aum import AUMCalculator\nfrom losses import losses\nfrom models import models\nfrom torc...
[ [ "torch.cat", "torch.randperm", "torch.utils.data.DataLoader", "pandas.DataFrame", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "torch.optim.lr_scheduler.MultiStepLR", "pandas.read_csv", "torch.eye", "torch.tensor", "t...
s-arora-1987/imitation
[ "17c7b512013eb44c22376a2c2991cde664f64b87" ]
[ "tests/algorithms/test_dagger.py" ]
[ "\"\"\"Tests for DAgger.\"\"\"\n\nimport contextlib\nimport glob\nimport os\nimport pickle\nfrom unittest import mock\n\nimport gym\nimport numpy as np\nimport pytest\nfrom stable_baselines3.common import policies\n\nfrom imitation.algorithms import bc, dagger\nfrom imitation.data import rollout\nfrom imitation.pol...
[ [ "numpy.testing.assert_array_equal", "numpy.all", "numpy.any", "numpy.zeros", "numpy.sum" ] ]
rdmolony/dublin-electricity-substations
[ "137573c68e4564c7c31dc3c60b6de2218704436a" ]
[ "notebooks/link_demands_to_clustered_stations.py" ]
[ "# %%\nfrom pathlib import Path\n\nimport pandas as pd\nimport geopandas as gpd\nimport mapclassify as mc\nimport matplotlib.patheffects as pe\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\n\nimport dublin_electricity_network as den\nfrom dublin_electricity_network.cluster import clust...
[ [ "pandas.read_csv" ] ]
nkoep/geomstats
[ "e10f363b14fd4216825d3b44daf3ec38057a1d86" ]
[ "examples/plot_square_h2_poincare_half_plane.py" ]
[ "\"\"\"Plot a square on H2 with Poincare half-plane visualization.\"\"\"\n\nimport logging\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport geomstats.visualization as visualization\nfrom geomstats.geometry.hyperbolic import Hyperbolic\n\nH2 = Hyperbolic(dimension=2)\nMETRIC = H2.metric\n\...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.show", "numpy.linspace" ] ]
MayuriKalokhe/Data_Science_Covid-19
[ "e4bd99ddb2d6b2467991867bfa8a658804689d9f" ]
[ "src/tests/tests.py" ]
[ "\n\nimport build_features as bf\nimport pandas as pd\n\n\n\n\nif __name__ == '__main__':\n\n\n pd_JH_data=pd.read_csv('data/processed/COVID_relational_confirmed.csv',sep=';',parse_dates=[0])\n pd_JH_data=pd_JH_data.sort_values('date',ascending=True).copy()\n" ]
[ [ "pandas.read_csv" ] ]
tjgran01/DotNIRSToolboxTools
[ "aa07f507095dc42d4af4c3d8616e826c401e6a54" ]
[ "utilities/eml/data_state_table_generator.py" ]
[ "import pandas as pd\nimport os\nimport re\n\nfrom pathlib import Path\n\nfrom utilities.generic.file_finder import FileFinder\n\ndef list_diff(li1, li2):\n \"\"\"Returns the subset of lists that are present in li1 but absent in li2.\n\n Args:\n li1: The first list (a superset of li2).\n ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
DocOtak/gsw-xarray
[ "eb39f8712173c1b2d75caf37218174367f07023c" ]
[ "gsw_xarray/tests/conftest.py" ]
[ "import pytest\n\nimport xarray as xr\nimport numpy as np\n\n\n@pytest.fixture\ndef ds():\n ds = xr.Dataset()\n id = np.arange(3)\n ds[\"id\"] = xr.DataArray(id, coords={\"id\": id})\n ds[\"CT\"] = ds[\"id\"] * 10\n ds[\"CT\"].attrs = {\"standard_name\": \"sea_water_conservative_temperature\"}\n d...
[ [ "numpy.arange" ] ]
ngu-khoi/BRITS-Realtime-Alive
[ "5167070ee7cdf8ce74dcf8dd2d7bf8340a6bd186" ]
[ "neural_net.py" ]
[ "import xgboost as xgb\nimport numpy as np\nimport os\nimport csv\nmodel_name = 'brits'\n\nimpute = np.load('./{}_data.npy'.format(model_name)).reshape(-1, 48*35)\nprint(impute.shape)\n\nlabel = np.load('./{}_label.npy'.format(model_name)).reshape(-1,)\nprint(label.shape)\n\ndata = np.nan_to_num(impute)\nn_train = ...
[ [ "sklearn.neural_network.MLPClassifier", "numpy.mean", "numpy.nan_to_num" ] ]
gauravpks/ml-repo
[ "4e5874aff2aef105367c8ac3ffd155a05a3abe11" ]
[ "Part 1 - Data Preprocessing/data_preprocessing_tools.py" ]
[ "# Data Preprocessing Tools\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('https://raw.githubusercontent.com/gauravpks/ml-repo/master/Part%201%20-%20Data%20Preprocessing/Data.csv')\nX = dataset.iloc[:, :-1].va...
[ [ "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder", "sklearn.impute.SimpleImputer", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder" ] ]
LightTwist/RobustVideoMatting
[ "03096f23de1831b8181dadd5e165561c2759f9eb" ]
[ "evaluation/generate_videomatte_with_background_image.py" ]
[ "\"\"\"\npython generate_videomatte_with_background_image.py \\\n --videomatte-dir ../matting-data/VideoMatte240K_JPEG_HD/test \\\n --background-dir ../matting-data/Backgrounds/valid \\\n --num-samples 25 \\\n --resize 512 288 \\\n --out-dir ../matting-data/evaluation/vidematte_static_sd/\n\"\"\"\n\n...
[ [ "numpy.asarray" ] ]
laeen/kaggle_practice
[ "f12d4ab01800ee0f750067c16ef6cea473b168c5" ]
[ "house_prices/main.py" ]
[ "import pickle\nimport pandas as pd\n\nfrom sklearn.externals import joblib\nfrom sklearn import preprocessing\n\nclf = joblib.load(\"train_model.m\")\n\ndata_test = pd.read_csv(\"cleaning_test.csv\")\ndf = pd.read_csv(\"data/test.csv\")\n\nf_names = ['OverallQual', 'GrLivArea', 'TotalBsmtSF', 'GarageArea', '1stFlr...
[ [ "sklearn.externals.joblib.load", "pandas.read_csv", "pandas.DataFrame" ] ]
tetsuzawa/rpi_ahrs
[ "5db341073b7c711c33d8854a22535655170d82c0" ]
[ "server/attitude_estimation/server_thread.py" ]
[ "# -*- coding: utf-8 -*-\nimport socket\nimport threading\nimport time\n\nimport numpy as np\n\n\nclass ServerThreadUDP(threading.Thread):\n def __init__(self, server_ip='127.0.0.1', port=50009, ini_val=np.ones((3, 3))):\n threading.Thread.__init__(self)\n # initial value\n self.data = ini_v...
[ [ "numpy.array", "numpy.zeros", "numpy.ones" ] ]
DickLiTQ/pyts
[ "374711385a48349b0a74db7f444acaf769ab49ee" ]
[ "tspy.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\n\"\"\"\r\n\r\nThis pyfile is used to make our time series analysis more convenient. Although statsmodels are powerful enough, it can be quite tedious to remember a lot of modules with different name. If we spend so much time on searching which command should we use in statsmodels, we...
[ [ "matplotlib.pyplot.figure", "numpy.zeros_like", "matplotlib.pyplot.style.use", "pandas.date_range" ] ]
VLOGroup/optox
[ "ae8bf1b4c1bfeb1e2fea24f549182d5610e09d82" ]
[ "tensorflow/optotf/keras/pad.py" ]
[ "import tensorflow as tf\nimport optotf.pad\nimport unittest\n\nclass Pad2d(tf.keras.layers.Layer):\n def __init__(self, padding, mode, channel_last=True):\n super().__init__()\n self.padding = padding\n self.mode = mode\n self.channel_last = channel_last\n self.op = optotf.pad...
[ [ "tensorflow.transpose", "tensorflow.unstack", "tensorflow.stack", "tensorflow.reshape", "tensorflow.math.imag", "tensorflow.math.real", "tensorflow.random.normal" ] ]
doutib/lobpredict
[ "3e443766ea97ec7385fdb6b3d86c37e58055065c" ]
[ "lobpredictrst/rf.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\nimport numpy as np\nimport pandas as pd\nimport json\n\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.metrics import log_loss\nfrom sklearn.metrics import precision_score\nfrom sklearn.metrics import f1_score\nfrom sklear...
[ [ "sklearn.ensemble.RandomForestClassifier", "numpy.unique", "sklearn.metrics.confusion_matrix", "sklearn.metrics.log_loss", "numpy.std", "numpy.argsort", "sklearn.metrics.classification_report", "sklearn.metrics.accuracy_score" ] ]
haihabi/NormFlowPy
[ "a15ea6a704254a925f25dc94b22459ca2e0beaf5" ]
[ "normflowpy/flows/maf.py" ]
[ "import torch\nfrom normflowpy.base_nets.mlp_base_net import ARMLP\nfrom normflowpy.base_flow import UnconditionalBaseFlowLayer\n\n\nclass MAF(UnconditionalBaseFlowLayer):\n \"\"\" Masked Autoregressive Flow that uses a MADE-style network for fast forward \"\"\"\n\n def __init__(self, dim, parity, net_class=A...
[ [ "torch.exp", "torch.zeros_like", "torch.sum" ] ]
Huhanlin/MusicGenreClassification
[ "fa6e412b94630139e994d51d7963de711717d946" ]
[ "music_gen_lib.py" ]
[ "# store the function/object used in the project\n\n# import modules\nfrom __future__ import print_function\nimport numpy as np\nimport librosa\nimport keras\nfrom keras.models import Sequential, load_model, Model\nfrom keras.layers import Dense, Dropout, Flatten, Input, Reshape, Add\nfrom keras.layers import Conv2...
[ [ "numpy.unique", "numpy.asarray", "numpy.arange", "numpy.flatnonzero", "numpy.concatenate", "numpy.append", "numpy.random.permutation", "numpy.argmax", "numpy.zeros", "numpy.sum", "numpy.vstack", "numpy.random.randint" ] ]
FractalArt/chaos_exercises
[ "ce86858ceb887560a30f6fd313d920a18f2da5c7" ]
[ "ch2/ex2_8_6.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef f(x):\n return x + np.exp(-x)\n\n\ndef plot_gradient_field(ax, func, title=None):\n X = np.arange(-4, 4, 0.1)\n Y = np.arange(-4, 4, 0.1)\n U, V = np.meshgrid(np.ones(len(X)), func(X))\n ax.quiver(X, Y, U/3, V/3)\n\n ax.set_xlabel('x')\...
[ [ "numpy.exp", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
biggates/wfdb-python
[ "5bb2e3c19a196a4efda0762f7596889a3eed5cee" ]
[ "tests/test_record.py" ]
[ "import os\nimport pdb\nimport shutil\nimport unittest\n\nimport numpy as np\nimport wfdb\n\n\nclass TestRecord(unittest.TestCase):\n \"\"\"\n Test read and write of single segment WFDB records, including\n PhysioNet streaming.\n\n Target files created using the original WFDB Software Package\n versi...
[ [ "numpy.testing.assert_equal", "numpy.abs", "numpy.array_equal", "numpy.genfromtxt", "numpy.round", "numpy.full", "numpy.concatenate", "numpy.max", "numpy.nanmean", "numpy.repeat", "numpy.array", "numpy.zeros" ] ]
JoshJson/nummethod
[ "e9380f873a029205e2f843d4629e363a8f2f2f92" ]
[ "build/lib/NMisS/optimization.py" ]
[ "import pip\n\ntry:\n __import__('math')\nexcept ImportError:\n pip.main([ 'install', 'math' ])\n\ntry:\n __import__('pandas')\nexcept ImportError:\n pip.main([ 'install', 'pandas' ])\n\ntry:\n __import__('scipy')\nexcept ImportError:\n pip.main([ 'install', 'scipy' ])\n\ntry:\n __import__('mat...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "numpy.random.choice", "numpy.ones", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot", "numpy.copy", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplo...
armand33/recommender_system
[ "6b133fa903150a5e022d44123935b78af8436ac9" ]
[ "src/utils.py" ]
[ "# !/usr/bin/env python\n\nimport numpy as np\nimport scipy.sparse as sp\n\n\ndef split_data(ratings, min_num_ratings, p_test=0.1, verbose=False, seed=988):\n \"\"\"\n Splits the data set (ratings) to training data and test data\n :param ratings: initial data set (sparse matrix of dimensions n items and p ...
[ [ "numpy.random.seed", "numpy.ones", "numpy.random.rand", "numpy.where", "scipy.sparse.csr_matrix.mean", "scipy.sparse.lil_matrix" ] ]
eyalk11/investpy
[ "621e272687d341da0a8a173fe55628a0bc2fde76" ]
[ "investpy/etfs.py" ]
[ "# Copyright 2018-2021 Alvaro Bartolome, alvarobartt @ GitHub\n# See LICENSE for details.\n\nfrom datetime import datetime, date, timedelta\nimport pytz\n\nimport json\nfrom random import randint\n\nimport warnings\n\nimport pandas as pd\nimport pkg_resources\nimport requests\nfrom unidecode import unidecode\nfrom ...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
HubBucket-Team/graphics
[ "dc22b266c225b7d667cc3836f6fc5a1d4bb47152" ]
[ "tensorflow_graphics/geometry/convolution/tests/graph_convolution_test.py" ]
[ "#Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to...
[ [ "tensorflow.convert_to_tensor", "numpy.linspace", "tensorflow.zeros", "tensorflow.as_dtype", "tensorflow.reduce_sum", "numpy.concatenate", "numpy.zeros_like", "numpy.where", "numpy.roll", "tensorflow.sparse.eye", "numpy.random.randint", "numpy.ones_like", "numpy...
hogepodge/tvm-rpi
[ "b10f0e0ac97660933197a596e44e6429f7f89125" ]
[ "postprocess.py" ]
[ "#!python3 ./postprocess.py\nimport os.path\nimport numpy as np\nfrom scipy.special import softmax\nfrom tvm.contrib.download import download_testdata\n\n# Download a list of labels\nlabels_url = \"https://s3.amazonaws.com/onnx-model-zoo/synset.txt\"\nlabels_path = download_testdata(labels_url, \"synset.txt\", modu...
[ [ "numpy.argsort", "numpy.load", "numpy.squeeze", "scipy.special.softmax" ] ]
ahmeddeladly/arch
[ "20774dce296af3716c44ecd50716d368634acbba" ]
[ "arch/unitroot/critical_values/simulation/phillips-ouliaris-simulation-process.py" ]
[ "from collections import defaultdict\nimport glob\nfrom itertools import product\nimport os\nfrom typing import Dict, List, NamedTuple, Tuple\n\nfrom black import FileMode, TargetVersion, format_file_contents\nimport matplotlib.backends.backend_pdf\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas...
[ [ "scipy.stats.norm.ppf", "numpy.asarray", "numpy.random.Generator", "matplotlib.pyplot.rc", "matplotlib.pyplot.plot", "numpy.max", "numpy.argmin", "numpy.exp", "numpy.where", "numpy.arange", "numpy.zeros", "numpy.random.PCG64", "pandas.concat", "numpy.log", ...
jsalsman/TensorNetwork
[ "9914ec04d5a783a445b8ee56c82030dc69fed3ed" ]
[ "tensornetwork/network_components.py" ]
[ "# Copyright 2019 The TensorNetwork Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable...
[ [ "numpy.arange", "numpy.dtype", "numpy.mean", "numpy.prod", "numpy.array", "numpy.zeros" ] ]
nguyenvanhoang7398/pytorch-transformers
[ "9f995b99d4c4067662c3bd4f1274315c0839deeb" ]
[ "examples/contrib/run_openai_gpt.py" ]
[ "# coding=utf-8\n# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance w...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.utils.data.TensorDataset", "torch.utils.data.SequentialSampler", "torch.utils.data.RandomSampler", "torch.utils.data.DataLoader", "numpy.full", "torch.tensor", "numpy.argmax", "torch.no_grad", "torch.cuda.manual_seed_all"...
luucv/tfjs
[ "78add066f2d6cf2c3bc51d7996fda5186b3126dc" ]
[ "tfjs-converter/python/tensorflowjs/write_weights.py" ]
[ "# Copyright 2018 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t...
[ [ "numpy.dtype" ] ]
gruebel/ignite
[ "d384dc664b0e9d7241b5f688ca0f92b600a3cb4d" ]
[ "ignite/contrib/metrics/regression/r2_score.py" ]
[ "from typing import Callable, Union\n\nimport torch\n\nfrom ignite.contrib.metrics.regression._base import _BaseRegression\nfrom ignite.exceptions import NotComputableError\nfrom ignite.metrics.metric import reinit__is_reduced, sync_all_reduce\n\n\nclass R2Score(_BaseRegression):\n r\"\"\"\n Calculates th...
[ [ "torch.device", "torch.sum", "torch.pow", "torch.tensor" ] ]
PRASAD-DANGARE/Machine_Learning-Applications
[ "e2fa540d44993dc0750d95ce6ad686facd3bb769" ]
[ "Application15/Boosting_IRIS.py" ]
[ "'''\nClassifier : AdaBoostClassifier\nDataset : Iris Dataset\nFeatures : Sepal Width, Sepal Length, Petal Width, Petal Length\nLabels : Versicolor, Setosa, Virginica \n\nTraining Dataset : 70% of 150 Entries\nTesting Dataset : 30% of 150 Entries\n\nAu...
[ [ "sklearn.ensemble.AdaBoostClassifier", "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score" ] ]
ehbussell/PatchOptimalControl
[ "8a422a2b0b85b3ea4f6898bf2df9cdd3a9e4c52f" ]
[ "patch_model/bocop_utils.py" ]
[ "\"\"\"Functions to help when using the BOCOP direct solver for optimal control\nproblems.\"\"\"\n\nimport logging\nimport os\nimport numpy as np\nfrom scipy.interpolate import interp1d\n\n\ndef readSolFile(file=\"problem.sol\", ignore_fail=False):\n \"\"\"Read BOCOP solution file and extract Xt, Lt and Ut as in...
[ [ "numpy.array", "scipy.interpolate.interp1d", "numpy.linspace" ] ]
Artia-Inspirenet/module-2
[ "7cf1d74f13d23a11ce202436d88b283d7ef1e109" ]
[ "pretraining/hed.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: hed.py\n# Author: Yuxin Wu\n\nimport cv2\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nfrom six.moves import zip\nimport os\n\n\nfrom tensorpack import *\nfrom tensorpack.dataflow import dataset\nfrom tensorpack.utils.gpu import get_num_gpu\n...
[ [ "tensorflow.get_variable", "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.equal", "tensorflow.nn.conv2d_transpose", "tensorflow.pad", "tensorflow.where", "tensorflow.train.AdamOptimizer", "tensorflow.add_n", "tensorflow.greater", "tenso...
wolfo1/IML.HUJI
[ "0b32e552774d0be747547ab8b3eedbcd19cc11e7" ]
[ "IMLearn/learners/classifiers/gaussian_naive_bayes.py" ]
[ "from typing import NoReturn\nfrom ...base import BaseEstimator\nimport numpy as np\nimport pandas as pd\n\n\nclass GaussianNaiveBayes(BaseEstimator):\n \"\"\"\n Gaussian Naive-Bayes classifier\n \"\"\"\n\n def __init__(self):\n \"\"\"\n Instantiate a Gaussian Naive Bayes classifier\n\n ...
[ [ "numpy.sqrt", "numpy.unique", "numpy.exp", "numpy.mean", "numpy.prod", "numpy.var", "numpy.array" ] ]
balopat/quantum
[ "8c85ab228c9cabceacfa0438d7886a7eca307016" ]
[ "tensorflow_quantum/core/ops/circuit_execution_ops.py" ]
[ "# Copyright 2020 The TensorFlow Quantum 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# Unl...
[ [ "tensorflow.CriticalSection" ] ]
Starry-Hu/FedML
[ "0fd4bd55b7b3122c8cb4faee9fe36dcb1998657d" ]
[ "fedml_api/data_preprocessing/cervical_cancer/datasets.py" ]
[ "import torch.utils.data as data\n\nimport pandas as pd\nimport torch\nimport matplotlib.pyplot as plt\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import preprocessing\n\n\ndef data_visualize(df,feature_name):\n # 绘制Smokes等离散变量与其相关连续变量的关系,Pie chart\n # 自定义格式\n # def my_fmt(x):\n ...
[ [ "pandas.read_csv", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", "torch.tensor", "matplotlib.pyplot.bar", "matplotlib.pyplot.text", "matplotlib.pyplot.show", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.ylabel" ] ]
jld23/python-dlpy
[ "39fe417a02da8f40975691392f5735fe02160da0" ]
[ "dlpy/images.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n#\n# Copyright SAS Institute\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# U...
[ [ "numpy.array", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure" ] ]
AspirinCode/MD-analysis-tools-scripts
[ "dfc0d282c9a844f5b8b1935a3ae74b1aff577ff9" ]
[ "network/calc_bet_centrality.py" ]
[ "import networkx as nx\nimport numpy as np\nimport pickle\n\nG = nx.Graph()\nnode1, node2 = np.loadtxt(graph_input, usecols=(0,1), unpack=True)\n\nfor i in range(len(node1)):\n G.add_edge(node1[i], node2[i])\n\ngraph_num_node = G.number_of_nodes()\nprint(f\"This graph contains {graph_num_node} nodes. \")\n\ngrap...
[ [ "numpy.array", "numpy.loadtxt", "numpy.column_stack" ] ]
teddy-lu/yolov4flask
[ "20e825cc67faf3adca3bdbe3c40d30662d39c59f" ]
[ "predict.py" ]
[ "import base64\nimport time\n\nimport cv2\nimport os\n\nimport numpy as np\n\n\ndef dect(picb64):\n # picPath = r'./27210923000000.jpeg'\n model_label = r'./cfg/obj.names'\n LABELS = open(model_label).read().strip().split('\\n')\n num_class = len(LABELS)\n\n np.random.seed(28)\n COLORS = np.random...
[ [ "numpy.random.seed", "numpy.fromstring", "numpy.argmax", "numpy.array", "numpy.random.randint" ] ]
code-cullison/gnam
[ "655feedab085d47a0dfe359c97deb2dd6cdf3de7" ]
[ "misc/flatten_test.py" ]
[ "import numpy as np\n\nxyz = np.zeros((5,5,5))\n\nfor ix in range(5):\n for iy in range(5):\n for iz in range(5):\n xyz[ix,iy,iz] = ix + 10*iy + 100*iz\n\nprint(xyz)\n\nxyz = xyz.reshape((5,5,5))\n\nprint(xyz)\n\nxyz = xyz.flatten()\n\nprint(xyz)\n\nxyz = xyz.reshape((5,5,5))\n\nprint(xyz)\n" ]
[ [ "numpy.zeros" ] ]
daynoryamil/ML-Scikit-Learn
[ "72aff95a6c046fcfa70ae21248c3d09b0dc101a8" ]
[ "exercises/6.boosting.py" ]
[ "import pandas as pd\n\nfrom sklearn.ensemble import GradientBoostingClassifier\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score\n\nif __name__ == \"__main__\":\n\n dt_heart = pd.read_csv(\"./data/heart.csv\")\n print(dt_heart['target'].describe())\n\n X =...
[ [ "sklearn.ensemble.GradientBoostingClassifier", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score" ] ]
bangab/GMVAE
[ "6522f5f4b6afa3f8415a9dacc558670b307c664b" ]
[ "tensorflow/losses/LossFunctions.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n---------------------------------------------------------------------\n-- Author: Jhosimar George Arias Figueroa\n---------------------------------------------------------------------\n\nLoss functions used for training our model\n\n\"\"\"\n\nimport tensorflow as tf\nimport numpy a...
[ [ "tensorflow.clip_by_value", "numpy.log", "tensorflow.nn.log_softmax", "tensorflow.reduce_mean", "tensorflow.reduce_sum", "tensorflow.exp", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.log", "tensorflow.square" ] ]
Nikhil-Pesaladinne/cando-web
[ "f7f07aefda259dfe4a094b2c929c838539f16599" ]
[ "cando/cando.py" ]
[ "import os, sys, pickle\nimport requests\nimport random\nimport time\nimport operator\nimport math\nimport progressbar\nimport numpy as np\nimport pandas as pd\nimport multiprocessing as mp\nimport difflib\nimport matplotlib.pyplot as plt\nimport inspect\nfrom decimal import Decimal\nfrom rdkit import Chem, DataStr...
[ [ "matplotlib.pyplot.legend", "sklearn.metrics.roc_auc_score", "sklearn.cluster.KMeans", "pandas.DataFrame", "matplotlib.pyplot.plot", "scipy.spatial.distance.squareform", "sklearn.metrics.pairwise_distances_chunked", "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", ...
jterrellSchool21/maya_tg_www
[ "b31047344afe2976969450a2160fd7c90dfc8fdf" ]
[ "train.py" ]
[ "#!/usr/bin/env python3\n# Usage:\n# PYTHONPATH=src ./train --dataset <file|directory|glob>\n\nimport argparse\nimport json\nimport os\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport tqdm\nfrom tensorflow.core.protobuf import rewriter_config_pb2\n\nimport model, sample, encoder\nfrom load_dataset...
[ [ "tensorflow.train.latest_checkpoint", "tensorflow.shape", "tensorflow.gradients", "tensorflow.placeholder", "tensorflow.trainable_variables", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.nn.sparse_...
lucifer2288/agents
[ "63a8ea8ea9095cb9ab9f7c9fcf3aa2f9ac5fa280" ]
[ "tf_agents/distributions/utils.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.not_equal", "tensorflow.is_tensor", "tensorflow.nest.flatten", "tensorflow.TensorSpec", "tensorflow.nest.map_structure", "tensorflow.nest.is_nested" ] ]