repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
alemazzeo/arduscope
[ "9671c49fb22eacd8575f80366fb95d0a8f5b33a9" ]
[ "arduscope/arduscope.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import annotations\n\nimport calendar\nimport json\nimport os\nimport pathlib\nimport threading\nimport time\nfrom collections import deque\nfrom dataclasses import dataclass, field, asdict\nfrom tqdm import tqdm\nfrom typing import List, Dict\n\nimport matplotlib.pyplot ...
[ [ "numpy.savez", "numpy.asarray", "matplotlib.pyplot.isinteractive", "matplotlib.pyplot.get_backend", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.frombuffer", "matplotlib.pyplot.ioff", "numpy.array_split", "numpy.append", "matplotlib.pyplot.close", "numpy.sav...
thoesy2010/ANN_practice
[ "79f7d5bb1a34483a802e3052ba393245768e9ab9" ]
[ "july23rd_ANN_adagrad.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Jul 23 09:47:13 2019\r\n\r\nusing adagrad + 2layer \r\n\r\n@author: hu\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\n\r\ndataset = pd.read_csv('Social_Network_Ads.csv')\r\n\r\nX = dataset.iloc[:,[1,2,3]].values\...
[ [ "numpy.dot", "pandas.read_csv", "numpy.random.random", "numpy.abs", "numpy.random.seed", "sklearn.preprocessing.OneHotEncoder", "sklearn.model_selection.train_test_split", "numpy.exp", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder" ] ]
clbarnes/numba
[ "96bf1ea40a9b2208b51b263c6ae10b55358bdb06" ]
[ "numba/tests/support.py" ]
[ "\"\"\"\nAssorted utilities for use in tests.\n\"\"\"\n\nimport cmath\nimport contextlib\nimport enum\nimport gc\nimport math\nimport platform\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport time\nimport io\nimport ctypes\nimport multiprocessing as mp\nimport warnings\nimport trace...
[ [ "numpy.random.RandomState", "numpy.dtype", "numpy.isnat" ] ]
NekoKedama/MachineLearning-Sklearn
[ "1ff8c20815c06ae3ec2dd0ab6eb9d027323b74e3" ]
[ "Decision Tree/Decision Tree.py" ]
[ "import os\nimport numpy as np\nfrom sklearn.tree import DecisionTreeClassifier\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import f1_score\n\ndata_dir = \"DT_csv\"\nx_train = []\ny_train = []\n\n\ndef get_F1(x_test, y_test, DP):\n dtc = DecisionTreeClassifier(max_depth=DP)\n dtc.fit(x_train, y_tra...
[ [ "matplotlib.pyplot.plot", "sklearn.tree.DecisionTreeClassifier", "sklearn.metrics.f1_score", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Extreme-classification/ECLARE
[ "ca9f52842f2b5f45278eac50cd48c8b67bdfb4c5" ]
[ "ECLARE/models/transform_layer.py" ]
[ "from models.custom_embeddings import CustomEmbedding\nfrom libs.utils import resolve_schema_args, fetch_json\nfrom torch.nn.parameter import Parameter\nimport torch.nn as nn\nimport numpy as np\nimport torch\n\n\nclass scaled_spectral(nn.Module):\n def __init__(self, hidd_dims, k=1):\n super(scaled_spect...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.Sequential", "torch.Tensor", "torch.nn.init.eye_", "torch.nn.init.constant_", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.Identity", "torch.nn.LeakyReLU", "torch.nn.init.xavier_uniform_", "t...
Satyajeet-code/the-code-land
[ "910210eadf4cfacbc5fe6be91039253e5656c066" ]
[ "python/scikit learn-pandas- K Nearest Neighbour(KNN) Algorithm/scikit learn-pandas- K Nearest Neighbour(KNN) Algorithm.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\n#importing the required libraries\nimport pandas as pd\nfrom sklearn import preprocessing \nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn import nei...
[ [ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.confusion_matrix", "sklearn.neighbors.KNeighborsClassifier", "sklearn.preprocessing.LabelEncoder", "sklearn.metrics.accuracy_score" ] ]
aws-samples/real-time-churn-prediction-with-amazon-connect-and-amazon-sagemaker
[ "967cd117d87b12b8efed2a314948a6cabc2554e6" ]
[ "scripts/create_dataset.py" ]
[ "import argparse\nimport pathlib\n\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n# Parse argument variables passed via the CreateDataset processing step\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--athena-data\", type=str)\nargs = parser.parse_args()\n\n\ndataset = pd...
[ [ "pandas.read_parquet", "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
erigler-usgs/bezpy
[ "9f9e5727cb80496802424292562ac3ec447e5b34" ]
[ "bezpy/mt/utils.py" ]
[ "\"\"\"Helper functions for magnetotelluric data.\"\"\"\n\n__all__ = [\"apparent_resistivity\"]\n\nimport numpy as np\n\n\ndef apparent_resistivity(periods, Z, Z_var=None):\n \"\"\"Calculates the apparent resistivity for the given periods and Z.\"\"\"\n if Z_var is None:\n Z_var = np.ones((Z.shape)) + ...
[ [ "numpy.abs", "numpy.sqrt", "numpy.ones", "numpy.errstate", "numpy.angle" ] ]
sytk/SidebySide
[ "891e311391b59dd0900908b68a89df00a1cda44b" ]
[ "ML/learning.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np\n\nX_train = np.load('./X_train.npy')\nY_train = np.load('./Y_train.npy')\nX_test = np.load('./X_test.npy')\nY_test = np.load('./Y_test.npy')\nprint(X_train.shape)\nprint(X_train.min())\n\nmodel = keras.Sequential([\n # keras.layers.Flatt...
[ [ "numpy.load", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Input" ] ]
jorgessanchez7/Global_Forecast_Validation
[ "d3178acaa2a67801e832554a3f871b36c266fe3a" ]
[ "Evaluate_Monthly_Seasonality_Blue_Nile_Corrected.py" ]
[ "import pandas as pd\nfrom os import path\nimport hydrostats.data as hd\nimport hydrostats.visual as hv\nimport matplotlib.pyplot as plt\n\ndf = pd.read_csv('/Users/student/Dropbox/PhD/2020 Winter/Dissertation_v9/Africa/Blue_Nile/Blue_Nile_Stations_v2.csv')\n\nCOMIDs = df['COMID'].tolist()\nNames = df['Station'].to...
[ [ "pandas.read_csv" ] ]
Sanzeed/balanced_influence_maximization
[ "0797b8a8f536cac8023e128ab13eb532f902bcad" ]
[ "models/net_gen/homophilic_net_gen.py" ]
[ "import numpy as np\nimport networkx as nx\n\nfrom base import NetGen\n\n\nclass HomophilicNetGen(NetGen):\n def __init__(self, n, p_M, h, alpha, beta, gamma, delta_in, delta_out):\n super(NetGen, self).__init__(n, p_M, alpha, beta, gamma, delta_in, delta_out)\n self.h = h\n \n def __get_...
[ [ "numpy.sum", "numpy.multiply", "numpy.random.choice" ] ]
dominicamartinez/clustehr
[ "0ce893a666974674fad36591f0156bd720910b4d" ]
[ "src/MASPC.py" ]
[ "import numpy as np\nimport pandas as pd\nimport scipy\nfrom sklearn import metrics\nfrom FPMax import FPMax\nfrom Apriori import Apriori\nfrom scipy.cluster.hierarchy import fcluster\nfrom scipy.cluster.hierarchy import linkage\n\n# MASPC algorithm\nclass MASPC():\n def __init__(self,demographic,dignosisCodes):...
[ [ "scipy.cluster.hierarchy.linkage", "scipy.cluster.hierarchy.fcluster" ] ]
kant/Multilingual-RDF-Verbalizer
[ "227219883d88d67fefd3aad8df54e2b49f165d6d" ]
[ "hierarchical-decoding/layers/PositionalEncoding.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport math\n\nclass PositionalEncoding(nn.Module):\n\n def __init__(self, hid_dim, device, max_length=100):\n super().__init__()\n\n # Compute the positional encodings once in log space.\n self.pe = torch.zeros(max_l...
[ [ "torch.sin", "torch.arange", "torch.cos", "torch.zeros" ] ]
eugval/RoboPlay
[ "90a2bdb5077b4c9eed6f0fd63ae33c5cb283eab9" ]
[ "armRobot/RobotArm.py" ]
[ "import numpy as np\nimport collections\n\n\nclass RobotArm(object):\n def __init__(self, initial_effector_positions, dynamics_params_no=-1, dynamics_reset_min=0.3,\n dynamics_reset_range=0.4):\n '''\n Class for a 2D robot arm, with determined dynamics and an arbitrary number of jo...
[ [ "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.concatenate", "numpy.copy", "numpy.argmax", "numpy.random.rand", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.isclose" ] ]
pyplanes/pyplanes
[ "0b69ac4cfff0d278497fe2ad5ae096721c983f6f" ]
[ "pyplanes/mesh/edge.py" ]
[ "#! /usr/bin/env python3\n# -*- coding:utf8 -*-\n#\n# edge.py\n#\n# This file is part of pyplanes, a software distributed under the MIT license.\n# For any question, please contact mathieu@matael.org.\n#\n# Copyright (c) 2018 The pyplanes authors\n#\n# Permission is hereby granted, free of charge, to any person obt...
[ [ "numpy.lib.scimath.sqrt" ] ]
anacost/tuning_guit
[ "cb6a4294f102b4ee21b95bdba7f49079bd1cc690" ]
[ "tuning_recorded.py" ]
[ "import sounddevice as sd\nfrom scipy.io.wavfile import write\nimport librosa\n\nfs = 44100 #Sample rate\nseconds = 4 #duration of recording\n\nprint('start recording')\nmyrecording = sd.rec(int(seconds*fs), samplerate=fs, channels=1)\nsd.wait() #wait until recording is finished\nprint('finished recording')\nwrite(...
[ [ "scipy.io.wavfile.write" ] ]
Addy81/hla_assimilator
[ "845e0958d58185c4bcb12a38fdffc3708456d118" ]
[ "archive/NIHR_Assimilator/NIHR_Assimilator/user_uploads/wooey_scripts/wooey_assimilate_tkAUeI5.py" ]
[ "#!/usr/bin/python\n#\n#\n#\n#\n# Adriana Toutoudaki (October 2018), contact: adriana.tou@gmail.com\n\nimport pandas as pd\nimport re\nimport sys\nimport numpy as np\nimport argparse\n\n\nparser = argparse.ArgumentParser(description='Assimilate low res HLA type data.')\nparser.add_argument('input', help='input file...
[ [ "pandas.read_excel", "pandas.isnull", "pandas.ExcelWriter" ] ]
cfwelch/longitudinal_dialog
[ "9f2de780026565df6447301a134a3f2126b0e64b" ]
[ "equal_bin_response_times.py" ]
[ "\n\nimport msgpack, nltk, math, os\nimport dateutil.parser\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom tqdm import tqdm\nfrom utils import DEFAULT_TIMEZONE, settings\n\nSPLIT_INTO = 5\n\n# To split into 5 bins we will need 39315.6 points per bin.\n# The bin cutoffs are: [-1, 7, 21, 59, 256, 2669...
[ [ "numpy.array", "numpy.sum" ] ]
rterbush/mljar-supervised
[ "a85c90f7be59278bf856b0665380954890053989" ]
[ "supervised/tuner/mljar_tuner.py" ]
[ "import os\nimport copy\nimport json\nimport numpy as np\nimport pandas as pd\n\nfrom sklearn.preprocessing import OneHotEncoder\n\nfrom supervised.tuner.random_parameters import RandomParameters\nfrom supervised.algorithms.registry import AlgorithmsRegistry\nfrom supervised.preprocessing.preprocessing_categorical ...
[ [ "numpy.unique", "sklearn.preprocessing.OneHotEncoder", "pandas.DataFrame", "numpy.round", "numpy.max", "numpy.argsort", "numpy.array" ] ]
ParisNeo/pygameui
[ "685d8b09fe95901821db3240a512c7e8b5bdfe02" ]
[ "OOPyGame/__init__.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"=== Face Analyzer Helpers =>\n Module : ui\n Author : Saifeddine ALOUI (ParisNeo)\n Licence : MIT\n Description :\n User interface helpers\n<================\"\"\"\nimport time\nimport pygame\nimport cssutils\nfrom FaceAnalyzer.helpers.geometry.euclidian import is_...
[ [ "numpy.swapaxes" ] ]
kstisser/DeepLearningPointCloud
[ "646e8e20ec62e502c0dc95d73f755809df05706b" ]
[ "ModelBackbone/pointPillarModel.py" ]
[ "import numpy as np\nfrom DataTools import defs\nimport tensorflow as tf\nimport os\nfrom . import losses\n\nclass PointPillarModel:\n def __init__(self, modelFileLocation, logDir=\"../Logs/\"):\n self.modelFileLocation = modelFileLocation\n self.logDir = logDir\n\n #reference to https://github....
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.losses.BinaryCrossentropy", "tensorflow.keras.optimizers.Adam", "tensorflow.keras....
liangstein/ChabBot-PyTorch
[ "0095afe636dfe3fa09ffa666b00cae377b0e66bf" ]
[ "train_chatbot.py" ]
[ "import torch\nfrom torch import nn,optim\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom models_are_here import Attention_layer,EncoderRNN,DecoderRNN\nimport pickle\nimport numpy as np\n'''with open(\"less_length_questions\",\"rb\") as f:\n questions_tok=pickle.load(f)\n\nwith open(\...
[ [ "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.from_numpy", "numpy.random.shuffle", "numpy.mean", "numpy.zeros" ] ]
drwaterman/yellowbrick
[ "aa37696219747137b5ae9e5482c8397c086b89d8" ]
[ "docs/api/regressor/alphas.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom sklearn.linear_model import LassoCV\n\nfrom yellowbrick.regressor import AlphaSelection\n\n\nif __name__ == '__main__':\n # Load the regression data set\n df = pd.read_csv(\"../../../examples/data/concrete/concrete.csv\")\n\n feature_names = ['cement', 'slag...
[ [ "numpy.logspace", "pandas.read_csv", "sklearn.linear_model.LassoCV" ] ]
pdxgx/pepsickle
[ "ca4f336c8437b8ee21dfe29b8ae84cbaf8725986" ]
[ "pepsickle/model_functions.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nmodel_functions.py\n\nFor issues contact Ben Weeder (weeder@ohsu.edu)\n\nThis script contains functions for wrapping generated proteasomal cleavage\nprediction models and handling fasta protein inputs for easy model\nimplementation.\n\"\"\"\n\nimport os\nimport warnings\nimport peps...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.from_numpy", "torch.tensor", "torch.nn.Linear", "torch.no_grad", "torch.nn.Conv1d", "numpy.array" ] ]
ayshwaryas/pegasus
[ "b44f0f7c9cdb0da89de385ab6074a2b22bd29d0e" ]
[ "pegasus/annotate_cluster/annotate_cluster.py" ]
[ "import numpy as np\nimport pandas as pd\nimport json\n\nfrom sys import stdout\nfrom natsort import natsorted\nfrom typing import List, Dict, Union\nfrom anndata import AnnData\nfrom io import IOBase\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom pegasusio import timer, MultimodalData, UnimodalDat...
[ [ "pandas.DataFrame" ] ]
csdenboer/hummingbot
[ "8a799675a325ebdbb74d76b2a44472cdbf74d691" ]
[ "hummingbot/connector/exchange/radar_relay/radar_relay_api_order_book_data_source.py" ]
[ "#!/usr/bin/env python\n\nimport asyncio\nimport aiohttp\nimport logging\nimport pandas as pd\nfrom typing import (\n AsyncIterable,\n Dict,\n List,\n Optional,\n)\nimport re\nimport time\nimport ujson\nimport websockets\nfrom websockets.exceptions import ConnectionClosed\n\nfrom hummingbot.core.data_ty...
[ [ "pandas.DataFrame.from_records", "pandas.Timedelta", "pandas.Timestamp.utcnow" ] ]
ElnazP/MonoAlg3D_C
[ "3e81952771e8747f8fb713c31225b50117c61a2d" ]
[ "scripts/elnaz/plot_comparison_potential.py" ]
[ "import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef read_transmembrane_potential(input_file, dt, print_rate):\n data = np.genfromtxt(input_file)\n n = len(data)\n ms_each_step = dt*print_rate\n\n end_simulation = n / ms_each_step\n\n timesteps = np.arange(0,n)*ms_each_step\n ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.arange", "numpy.genfromtxt", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
predict-drone/drone-control
[ "2054ccec2f5e6c002727a5561b494a1046484504" ]
[ "simulator/ply.py" ]
[ "# MIT LICENSE\r\n# https://github.com/bponsler/kinectToPly/blob/master/kinectToPly.py\r\nimport numpy as np\r\n\r\n\r\nclass Ply(object):\r\n '''The Ply class provides the ability to write a point cloud represented\r\n by two arrays: an array of points (num points, 3), and an array of colors\r\n (num poin...
[ [ "numpy.savetxt", "numpy.squeeze", "numpy.column_stack" ] ]
Vakihito/multilogue-net
[ "fd67c78b4b6797c0e2aeae858023d4b67703d62d" ]
[ "train_regression.py" ]
[ "import numpy as np, torch, torch.nn as nn, torch.optim as optim\r\nimport argparse, time, pandas as pd, os\r\nfrom tqdm import tqdm\r\nfrom torch.utils.tensorboard import SummaryWriter\r\nfrom torch.utils.data import DataLoader\r\nfrom torch.utils.data.sampler import SubsetRandomSampler\r\nfrom sklearn.metrics imp...
[ [ "numpy.random.seed", "sklearn.metrics.mean_absolute_error", "scipy.stats.pearsonr", "torch.utils.data.DataLoader", "torch.utils.data.sampler.SubsetRandomSampler", "numpy.concatenate", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "torch.cuda.device", "...
oesst/Sound_Analytics
[ "4008c43b82e0b991bb3b37d8e61d63208fd67a69" ]
[ "crosscorrelation_tests.py" ]
[ "import wave\nimport numpy as np\nimport struct\nimport soundfile as sf\nimport matplotlib.pyplot as plt\n\nsignal_r ='/home/oesst/ownCloud/PhD/Sounds/sinus_500Hz_wn_bg.wav'\nsignal_l = '/home/oesst/ownCloud/PhD/Sounds/sinus_500Hz_different_wn_bg_quarter_phase_shifted.wav'\n\n\ndef gcc(a, b,max_delay = 0):\n a_f...
[ [ "numpy.conj", "numpy.fft.fft", "numpy.fft.rfft", "numpy.abs", "numpy.flipud", "numpy.fft.fftshift", "matplotlib.pyplot.plot", "numpy.fft.ifft", "numpy.concatenate", "numpy.argmax", "matplotlib.pyplot.show", "numpy.flip" ] ]
JCH222/dfqueue
[ "890606e41e78d7bf8eaca96683b5a3cfaa7d2813" ]
[ "dfqueue/tests/scenarios/__init__.py" ]
[ "# coding: utf8\n\nfrom typing import Tuple, Dict, NoReturn, List, Any\nfrom pandas import DataFrame, Series\n\n\ndef create_queue_item(result: tuple, selected_columns: List[Any]) -> Tuple[str, Dict]:\n return [(result[0], {column: result[1][column] for column in selected_columns})]\n\n\ndef create_queue_items(r...
[ [ "pandas.Series" ] ]
Tnutlyrehc/MachineLearningExam
[ "29dfda9c814290288955a5f504c924f45f32f291" ]
[ "plain_cnn.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\nimport re\nimport tensorflow as tf\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport keras\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import OneHotEncoder\nfrom keras.preprocessing import image\nfrom tensorflow...
[ [ "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "sklearn.preprocessing.OneHotEncoder", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPool2D", "numpy.save", "numpy.array", "tensorflow.keras.layers.Input" ] ]
DiMorten/FCN_ConvLSTM_Crop_Recognition_Generalized
[ "2749c90fab6c3854c380f6bca945dd4e99c17239" ]
[ "networks/convlstm_networks/train_src/model_input_mode.py" ]
[ "import deb\nimport numpy as np\nimport pdb\nclass ModelInputMode():\n pass\nclass MIMFixed(ModelInputMode):\n def __init__(self):\n pass\n def batchTrainPreprocess(self, batch, data, label_date_id, batch_seq_len=12):\n input_ = batch['in'].astype(np.float16)\n input_ = data.addDoty(in...
[ [ "numpy.zeros", "numpy.random.randint" ] ]
Cospel/addons
[ "af6866a2e6d9ddbc79d612d7cb04a8a5befe4a47" ]
[ "tensorflow_addons/optimizers/tests/yogi_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.keras.optimizers.deserialize", "tensorflow.constant", "tensorflow.Variable", "numpy.sqrt", "numpy.abs", "tensorflow.cast", "numpy.sign", "numpy.asanyarray", "tensorflow.test.is_gpu_available", "tensorflow.math.pow", "numpy.array", "tensorflow.keras.optim...
joamatab/photonic-coupling-drivers
[ "c12581d8e2158a292e1c585e45c0207c8129c0f1" ]
[ "plab/smu/sweep_current.py" ]
[ "from typing import Iterable, Union, Optional\nfrom time import strftime, localtime\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport qontrol\nfrom plab.config import logger, CONFIG\nfrom plab.measurement import measurement, Measurement\nfrom plab.smu.smu_control import smu_control\n\n\n@measu...
[ [ "numpy.zeros_like", "numpy.linspace" ] ]
watsonjj/oxpytools
[ "99f01d0a979d4592d5295b431f32676ba452d39a" ]
[ "jason_testbench/chec_time_pipeline.py" ]
[ "import argparse\nimport numpy as np\nimport target_calib\nfrom astropy import log\nfrom ctapipe.calib.camera.integrators import local_peak_integration\nfrom targetpipe.io.files import CHECInputFile as InputFile\nfrom targetpipe.io.pixels import Pixels\nfrom targetpipe.utils.plotting import intensity_to_hex\n\nfrom...
[ [ "numpy.empty" ] ]
trsavi/Machine-Learning-Web-App
[ "fd7567bfa588c06e0d564ef1dd72e8466003e33c" ]
[ "carClass.py" ]
[ "\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Nov 17 19:42:00 2021\r\n\r\n@author: Vukasin\r\n\"\"\"\r\n\r\n\r\nimport pandas as pd\r\n\r\ndata = pd.read_csv('./Data/usedCleanedPre.csv')\r\n\r\n\r\n# Get bradns\r\ndef get_brands():\r\n return sorted(list(data['Marka'].unique()))\r\n\r\n# Get models\r\...
[ [ "pandas.read_csv" ] ]
TheGreymanShow/House.Viz
[ "86773ebd8ed1802c7f38ace647ca28679b00f8fb" ]
[ "Scripts/Normalize_data.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport random\n\ndataset = pd.read_csv(\"C:/Users/admin/Desktop/Stevens Internship 2017/Datasets/Final/final_plotset500.csv\")\ndataset2 = pd.read_csv(\"C:/Users/admin/Desktop/Stevens Internship 2017/Datasets/Final/final_plotset500.csv\")\n\...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
ranocha/riemann
[ "d7b4d72d1147eee12e60a64f46a7e076b28a212d" ]
[ "riemann/shallow_1D_py.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\nr\"\"\"\nRiemann solvers for the shallow water equations.\n\nThe available solvers are:\n * Roe - Use Roe averages to caluclate the solution to the Riemann problem\n * HLL - Use a HLL solver\n * Exact - Use a newton iteration to calculate the exact solution to the\n ...
[ [ "numpy.sqrt", "numpy.min", "numpy.max", "numpy.zeros", "numpy.where", "numpy.empty" ] ]
jajokine/Neural-Networks-Image-Recognition
[ "e00c176d40a577fd799827fd9a2255e546119340" ]
[ "mlp.py" ]
[ "# ---------------------------------------------------------------------------------------------#\n# #\n# Neural Network - PyTorch - Double Digit #\n# Fully conne...
[ [ "torch.nn.Linear", "torch.manual_seed", "numpy.random.seed", "numpy.random.shuffle" ] ]
korawat-tanwisuth/Proto_DA
[ "332e6ed5814db98d33cd92842012e57298b631fb" ]
[ "examples/proto.py" ]
[ "import random\nimport time\nimport warnings\nimport sys\nimport argparse\nimport copy\n\nimport torch\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nfrom torch.optim import SGD\nimport torch.utils.data\nfrom torch.utils.data import DataLoader\nimport torch.utils.data.distributed\nimport torchvisi...
[ [ "torch.abs", "torch.Tensor", "torch.cat", "torch.manual_seed", "torch.nn.functional.cross_entropy", "torch.utils.data.DataLoader", "torch.matmul", "torch.no_grad", "torch.cuda.is_available", "torch.split" ] ]
GwynWilson/H2L
[ "201557dea156c8340108fecaa130ba3d3bac33df" ]
[ "PYH2L/TrainingSetCreator.py" ]
[ "import os\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom matplotlib.widgets import RectangleSelector, Cursor\n\nplt.switch_backend('QT5Agg')\npositive_response = ['Yes', 'yes', 'y', 'yeah', 'Yeah', 'Y']\n\n\"\"\"\nThis script allows the reading of the test images as a...
[ [ "matplotlib.pyplot.imshow", "numpy.abs", "matplotlib.widgets.Cursor", "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.get_current_fig_manager", "matplotlib.widgets.RectangleSelector", "matplotlib.pyplot.show" ] ]
xindi-dumbledore/NetInfoAccEqua
[ "f4b52166afb5504566b6e6bcfcfb9d01612ce30a" ]
[ "codes/simulation_param.py" ]
[ "import numpy as np\nM, E, N = 0.2, 2, 5000\nH, ALPHA = 0.8, 1\nPD, ED = 0.6, 1\n\nN_TRIALS = 10\nN_GRAPHS = 20\nBETA_ARRAY_SYM = np.array([[0.7, 0.7], [0.7, 0.7]])\nBETA_ARRAY_ASY = np.array([[0.7, 0.3], [0.3, 0.7]])\nGAMMA = 0.1\nSEED_NUM = 10\n\nMINORITY_SEEDING_PORTION_DICT = {\n \"low\": [0, 0.3], \"mid\": ...
[ [ "numpy.array" ] ]
jsandersen/MRTviaHIL
[ "eaed679d014183b9b5bc4846db543c64e80592c8" ]
[ "src/model/stats.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom matplotlib import pyplot as plt\n\nfrom sklearn.model_selection import StratifiedShuffleSplit\n\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow.keras.utils import to_categorical\nfrom sklearn.metrics import f1_score, roc_auc_score\n\nfrom tenso...
[ [ "matplotlib.pyplot.legend", "sklearn.metrics.roc_auc_score", "numpy.sum", "numpy.unique", "matplotlib.pyplot.ylim", "numpy.save", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.concatenate", "tensorflow.keras.utils.to_categorical", "scipy.stats.entropy", "matp...
yujiatay/deep-motion-editing
[ "19604abdc0ead66f8c82d9211b8c5862c6a68089" ]
[ "options/options.py" ]
[ "import argparse\nimport torch\nimport models\n\n\nclass Options():\n\n def __init__(self):\n self.initialized = False\n\n def initialize(self, parser):\n parser.add_argument('--input_A', required=True, help='path to first bvh file')\n parser.add_argument('--input_B', required=True, help=...
[ [ "torch.cuda.set_device" ] ]
abonaca/spur_rv
[ "5b90a4b62732f9c6941fc053e4cec0f9e90fb3e4" ]
[ "scripts/vel.py" ]
[ "import numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom matplotlib.backends.backend_pdf import PdfPages\n\nfrom astropy.table import Table\nimport astropy.units as u\nimport astropy.coordinates as coord\nfrom astropy.io import asc...
[ [ "matplotlib.cm.Oranges", "matplotlib.pyplot.legend", "numpy.polyfit", "numpy.poly1d", "numpy.savez", "matplotlib.ticker.MultipleLocator", "numpy.linspace", "numpy.sqrt", "matplotlib.pyplot.minorticks_on", "matplotlib.pyplot.plot", "numpy.concatenate", "numpy.max", ...
carlosal1015/active_subspaces
[ "caaf108fcb89548a374fea7704b0d92d38b4539a", "caaf108fcb89548a374fea7704b0d92d38b4539a" ]
[ "tutorials/test_functions/piston/piston.py", "tutorials/test_functions/robot/robot.py" ]
[ "##########################################################################\n#\n# PISTON SIMULATION FUNCTION\n#\n# Authors: Sonja Surjanovic, Simon Fraser University\n# Derek Bingham, Simon Fraser University\n# Questions/Comments: Please email Derek Bingham at dbingham@stat.sfu.ca.\n#\n# Copyright 2013. De...
[ [ "numpy.array", "numpy.sqrt" ], [ "numpy.array", "numpy.cos", "numpy.sin" ] ]
martanto/pyts
[ "1c0b0c9628068afaa57e036bd157fcb4ecdddee6" ]
[ "pyts/preprocessing/discretizer.py" ]
[ "\"\"\"Code for discretizers.\"\"\"\n\nimport numpy as np\nfrom numba import njit, prange\nfrom scipy.stats import norm\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.utils.validation import check_array\nfrom warnings import warn\n\n\n@njit()\ndef _uniform_bins(sample_min, sample_max, n_sam...
[ [ "sklearn.utils.validation.check_array", "numpy.linspace", "numpy.min", "numpy.full", "numpy.max", "numpy.diff", "numpy.any", "numpy.digitize", "numpy.empty" ] ]
arshadshk/greyatom-python-for-data-science
[ "3383a57abf5e389a83842af23b3add74aba752d8" ]
[ "Numpy-assignment/code.py" ]
[ "# --------------\n# Importing header files\r\nimport numpy as np\r\n\r\n# Path of the file has been stored in variable called 'path'\r\n\r\n\r\ndata = np.genfromtxt(path, delimiter=\",\",skip_header = 1)\r\n\r\nprint(data)\r\n\r\n\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\ncensus = ...
[ [ "numpy.concatenate", "numpy.genfromtxt" ] ]
smithj382/groundmotion-processing
[ "b6c8284dc945deb868e90c6e674b1743a424b4f9" ]
[ "gmprocess/utils/download_utils.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# stdlib imports\nimport os\nimport json\nimport logging\nimport warnings\nimport glob\nimport requests\n\n# third party imports\nfrom libcomcat.search import get_event_by_id\nfrom obspy.geodetics.base import locations2degrees\nfrom obspy.core.utcdatetime import UT...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.linspace" ] ]
jxtrbtk/bindex
[ "8feee8ff9db371d9e691e10ea70467446c0412b1" ]
[ "operatorQS.py" ]
[ "import sys\nimport pandas as pd\n\nfrom decimal import Decimal\n\nimport lib\nimport lib.features\n\nimport operatorQN\nSAFETY_K = 1.0\n\ndef makeup_prices(data_price_mid, data_price_std, t_data):\n symbol = t_data[\"pair\"]\n \n ask, bid = 1/3, 1/3 \n try:\n ask, bid = lib.features.optimized_as...
[ [ "pandas.DataFrame" ] ]
lukeandshuo/IR2VI_journal
[ "faf46b41e25e4bf9521466f76c5d688d198da9ee" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.autograd import Variable\nfrom torch.optim import lr_scheduler\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom util.visualizer import util\nimport cv2\n###########################################################...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.cuda.is_available", "torch.nn.init.xavier_normal", "torch.autograd.Variable", "torch.nn.ReplicationPad2d", "torch.nn.Dropout", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.nn.Sigmoid", "torch.nn.init.constant", "torch.opti...
ROCmSoftwarePlatform/translate
[ "32a6380d914ebe1a6c38c4992aac9600ed3d9810" ]
[ "pytorch_translate/beam_search_and_decode_v2.py" ]
[ "#!/usr/bin/env python3\n\nfrom typing import List, Tuple\n\nimport numpy as np\nimport torch\nimport torch.jit\nimport torch.jit.quantized\nfrom pytorch_translate.beam_decode import BeamDecode\nfrom pytorch_translate.ensemble_export import (\n DecoderBatchedStepEnsemble,\n EncoderEnsemble,\n FakeCharSourc...
[ [ "torch.jit.save", "torch.LongTensor", "torch.jit.quantized.quantize_rnn_modules", "torch.jit.trace", "torch.cat", "torch.topk", "torch.jit.Attribute", "torch.jit.quantized.quantize_linear_modules", "torch.jit.quantized.quantize_rnn_cell_modules", "torch.jit.annotate", "...
bomtorazek/carrier-of-tricks-for-classification-pytorch
[ "94ef8f4c38c5c872a615e9f2bca0060bb8c973b2" ]
[ "network/regnet.py" ]
[ "import torch.nn as nn\nimport numpy as np\nimport os\nfrom network.anynet import AnyNet\n\ndef quantize_float(f, q):\n \"\"\"Converts a float to closest non-zero int divisible by q.\"\"\"\n return int(round(f / q) * q)\n\n\ndef adjust_ws_gs_comp(ws, bms, gs):\n \"\"\"Adjusts the compatibility of widths an...
[ [ "numpy.log", "numpy.unique", "numpy.power", "numpy.arange", "numpy.divide" ] ]
mcengija/riggingtools
[ "a9e725d3e4419da87f787ff6a0c67bfd28c8f1bb" ]
[ "rig2py/py/plot.py" ]
[ "\"\"\"\nThis file uses matplotlib to render a single frame from a CSV file.\nThe CSV file is just data where every line is a frame. Rig keypoints are assumed to be in the following order:\n\n| Index | Joint |\n| -- | -- |\n| 0 | pelvis |\n| 1 | rHIp |\n| 2 | rKnee |\n| 3 | rAnkle\n| 4 | rToe...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure" ] ]
pedrodaniel10/CRC
[ "faf16f163fc1ac682ed993a63a71fd0a46d6463e" ]
[ "project2/src/mention_network.py" ]
[ "from igraph import *\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom statistics import mean\n\nBINS = 1\n\n\n# Prints degree distribution properties\ndef print_degree_dist_props(histogram):\n print(\"Results:\")\n print(\"Mean:\", round(histogram.mean, 2))\n print(\"Variance:\"...
[ [ "matplotlib.pyplot.yscale", "matplotlib.pyplot.plot", "numpy.delete", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xscale", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
kishorkuttan/pytorch-lightning
[ "f8996385fb48f18c5655937ca199a0b5a9d7e320" ]
[ "pytorch_lightning/accelerators/base_backend.py" ]
[ "import math\nfrom enum import Enum\nfrom typing import Any\n\nimport torch\n\nfrom pytorch_lightning.utilities import AMPType, rank_zero_warn\nfrom pytorch_lightning.utilities.apply_func import move_data_to_device\nfrom pytorch_lightning.utilities.exceptions import MisconfigurationException\nfrom pytorch_lightning...
[ [ "torch.norm", "torch.ones_like", "torch.tensor" ] ]
prtkbansal/search_with_machine_learning_course
[ "654ec9563c651de8be83658cd13e2beacaee91ec" ]
[ "week2/utilities/data_prepper.py" ]
[ "# This file processes our queries, runs them through OpenSearch against the BBuy Products index to fetch their \"rank\" and so they can be used properly in a click model\n\nimport ltr_utils as lu\nimport numpy as np\nimport pandas as pd\nimport query_utils as qu\nfrom opensearchpy import RequestError\nimport os\n\...
[ [ "pandas.merge", "pandas.read_csv", "pandas.concat", "pandas.DataFrame", "numpy.random.default_rng" ] ]
nat-chan/matplotlib-sixel
[ "5364fcae0a5851d292c7f68911ee3bd164141433" ]
[ "matplotlib-sixel/sixel.py" ]
[ "\n\n\"\"\"\nA matplotlib backend for displaying figures via sixel terminal graphics\n\nBased on the ipykernel source code \"backend_inline.py\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\n\"\"\"\n\n\nimport matplotlib\n\nfrom matplotlib._pylab_helper...
[ [ "matplotlib.pyplot.close", "matplotlib._pylab_helpers.Gcf.get_all_fig_managers", "matplotlib.is_interactive", "matplotlib._pylab_helpers.Gcf.get_active" ] ]
MikeD89/Advent2020
[ "84dd3723ceefb69fea45bc53d4116649fd58ff47" ]
[ "code/day17.py" ]
[ "from utils import utils\nimport numpy as np\nfrom scipy.signal import convolve\n\nday = 17\n\ntD = \"\"\"\n.#.\n..#\n###\n\"\"\"\n\nactive = '#'\ninactive = '.'\n\n\nclass DimentionalConway:\n # The game of seats\n def __init__(self, data, dimensions):\n self.dimensions = dimensions\n\n # Load ...
[ [ "numpy.expand_dims", "numpy.pad", "numpy.ones", "numpy.logical_or", "numpy.logical_and", "scipy.signal.convolve", "numpy.sum" ] ]
segalon/SpectralNet-pytorch
[ "a9077f6d71e64e3ba9c215fd2edeb743359b18f4" ]
[ "spectral_net/network.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\n\ndef orthonorm(Q, eps=1e-7):\n m = torch.tensor(Q.shape[0]) # batch size\n outer_prod = torch.mm(Q.T, Q)\n outer_prod = outer_prod + eps * torch.eye(outer_prod.shape[0])\n\n L = torch.linalg.cholesky(outer_pro...
[ [ "torch.linalg.inv", "torch.linalg.cholesky", "torch.mm", "torch.sqrt", "torch.eye", "torch.tensor", "torch.nn.Linear", "torch.no_grad", "torch.rand" ] ]
AGOberprieler/GinJinn2
[ "527feac125f476165e332277823c11016565f99d" ]
[ "ginjinn/segmentation_refinement/eval_helper.py" ]
[ "import torch\nimport torch.nn.functional as F\n\ndef resize_max_side(im, size, method):\n h, w = im.shape[-2:]\n max_side = max(h, w)\n ratio = size / max_side\n if method in ['bilinear', 'bicubic']:\n return F.interpolate(im, scale_factor=ratio, mode=method, align_corners=False, recompute_scale...
[ [ "torch.where", "torch.zeros_like", "torch.nn.functional.interpolate", "torch.zeros" ] ]
philmcp/TheRemoteFreelancer
[ "7009eb0fc2c3c86dbba8c4f00a6133c35d21f016" ]
[ "docs/scripts/sites_history_script.py" ]
[ "from pathlib import Path\n\nimport pandas\nimport pydriller\nfrom git import Repo\nimport io\n\nrepo_path = Path(__file__).parent.parent.parent\nsite_data = repo_path / \"docs\" / \"_data\" / \"sites.csv\"\nrepo = Repo(str(repo_path))\ndf = None\n\n\ndef get_change_hashes():\n for commit in pydriller.Repository...
[ [ "pandas.concat", "pandas.read_csv" ] ]
RashidLadj/OpenSfM
[ "a1b611a8c8056791f5e0e250ebd9f736fb9eda86" ]
[ "opensfm/large/tools.py" ]
[ "import cv2\nimport itertools\nimport logging\nimport networkx as nx\nimport numpy as np\nimport scipy.spatial as spatial\n\nfrom collections import namedtuple\nfrom networkx.algorithms import bipartite\nfrom functools import lru_cache\n\nfrom opensfm import align\nfrom opensfm import context\nfrom opensfm import p...
[ [ "numpy.diag", "numpy.linalg.inv", "numpy.arange", "numpy.union1d", "numpy.mean", "numpy.linalg.cholesky", "numpy.array", "numpy.where", "scipy.spatial.cKDTree" ] ]
yellowpsyduck/OccamFusionnet
[ "bafdda07939c6370792c5db2b50bca27729804e2" ]
[ "occam/layers.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n# Origin: https:/...
[ [ "torch.nn.functional.softmax", "torch.nn.GLU", "torch.nn.Dropout2d", "torch.max", "torch.load", "torch.cat", "torch.nn.functional.dropout", "torch.zeros", "torch.sin", "torch.nn.Embedding", "torch.nn.utils.rnn.pad_packed_sequence", "torch.FloatTensor", "torch.sp...
jfcarr/GFPGAN
[ "d37467fe8a4f7ead994a6dfe87f8de191b3010b4" ]
[ "gfpgan/utils.py" ]
[ "import cv2\nimport os\nimport torch\nfrom basicsr.utils import img2tensor, tensor2img\nfrom basicsr.utils.download_util import load_file_from_url\nfrom facexlib.utils.face_restoration_helper import FaceRestoreHelper\nfrom torchvision.transforms.functional import normalize\n\nfrom gfpgan.archs.gfpgan_bilinear_arch ...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
xiaoyw71/Feature-engineering-machine-learning
[ "6fb78d29ef696e3aa2dd2eeceaa07a347358ba0f" ]
[ "src/DataBase/ComboDataAnalysis.py" ]
[ "# -*- coding: utf-8 -*-\r\n'''\r\nCreated on 2020年12月21日\r\n\r\n@author: 肖永威\r\n'''\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport json\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.ensemble import RandomForestClassifier\r\n#多维特征数据进行聚类分析\r\nfrom ...
[ [ "pandas.merge", "sklearn.cluster.KMeans", "sklearn.cluster.MiniBatchKMeans", "pandas.DataFrame", "pandas.crosstab", "matplotlib.pyplot.tight_layout", "sklearn.ensemble.RandomForestClassifier", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.cm.ScalarMappable", ...
tiancaishaonvjituizi/Paddle
[ "5d08a4471973e1c2b2a595781d0a0840875a0c77" ]
[ "python/paddle/fluid/tests/unittests/ipu/test_optimizer_ipu.py" ]
[ "# Copyright (c) 2022 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 re...
[ [ "numpy.random.uniform", "numpy.array", "numpy.allclose", "numpy.random.seed" ] ]
vdogmcgee/Machine-Learning-Demo
[ "5c8cddf4ba397bcf2dab0cfc942f5d1223d7dfed" ]
[ "logisitc_regression_demo.py" ]
[ "# -*- encoding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\n\n\ndef create_data():\n iris = load_iris()\n df = pd.DataFrame(iris.data, columns=iris.feature_names)\n df['...
[ [ "numpy.dot", "matplotlib.pyplot.legend", "numpy.expand_dims", "matplotlib.pyplot.scatter", "numpy.arange", "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "numpy.ones", "matplotlib.pyplot.plot", "numpy.exp", "matplotlib....
scheckmedia/photils-api
[ "c1f06608573221cf76b63303126c44f5c0242353" ]
[ "api/autotagger.py" ]
[ "from flask import Blueprint, request, jsonify, current_app\nfrom .utils import ApiException\nimport base64\nimport numpy as np\n\napi = Blueprint('auto_tagger_api', 'auto_tagger_api')\n\n\n@api.route('/tags', methods=['POST'])\ndef get_tags_by_feature():\n tagger = current_app.tagger\n data = request.get_jso...
[ [ "numpy.array" ] ]
iydon/homework
[ "253d4746528ef62d33eba1de0b90dcb17ec587ed" ]
[ "DCC/1/main.py" ]
[ "#!/usr/bin/python3\n'''\n@Reference: https://github.com/wenj18/HW_TV3d\n'''\nimport collections\nimport numpy as np\n\n\nclass Worker:\n '''\n '''\n def __init__(self, I, dt=1e-1, lam=1e-2, eps=1e-4):\n '''\n '''\n self.I = I\n self._dt = dt\n self._lam = lam\n se...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.savefig", "numpy.ones", "numpy.random.normal", "numpy.empty", "matplotlib.pyplot.figure" ] ]
Alpus/text
[ "41413d193fd502e8a0754ac4b60b4c645bdf9ac7" ]
[ "tensorflow_text/public_names_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 TF.Text 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 appl...
[ [ "tensorflow.python.platform.test.main" ] ]
venkateshIedge7/Streamlit_Stock
[ "988376d853f07dc4aa031cad170f5a84e490e3f2" ]
[ "reddit_extraction.py" ]
[ "# Reddit date time is converted into readable date time \r\n\r\nimport pandas as pd\r\n\r\nimport praw\r\nfrom praw.models import MoreComments\r\n\r\nimport datetime as dt\r\nimport reddit_config as r_cnf\r\nimport streamlit as st\r\n\r\n \r\n \r\ndef get_date(created):\r\n return dt.datetime.fromtime...
[ [ "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
LaudateCorpus1/Bella-5
[ "7de51ff4914bdefbcf05e490b85517c5fb014595" ]
[ "bella/word_vectors.py" ]
[ "'''\nContains classes that train and/or load semantic vectors. All classes are sub\nclasses of WordVectors\n\nClasses:\n\n1. WordVectors - Base class of all classes within this module. Ensures\nconsistent API for all word vectors classes.\n2. GensimVectors - Creates `Word2Vec <https://arxiv.org/pdf/1301.3781.pdf>`...
[ [ "numpy.asarray", "numpy.zeros", "numpy.linalg.norm" ] ]
physycom/minimocas-tools
[ "bf1ad6f5f5f95942cc99d99e8b1a543c68f3a646" ]
[ "python/heatmap-server.py" ]
[ "#! /usr/bin/env python3\n\nfrom http.server import BaseHTTPRequestHandler\nimport os\nimport json\nimport re\nfrom matplotlib import cm\nfrom datetime import datetime\nimport pandas as pd\nimport collections\nimport numpy as np\n\ndatafile = ''\ngrid = {}\ndata = collections.defaultdict(dict)\n\nclass Server(BaseH...
[ [ "pandas.read_csv", "numpy.mean" ] ]
zjZSTU/GoogLeNet
[ "a0801e45006d34b4901a8834397961ce17f24e2e" ]
[ "py/models/googlenet.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n@date: 2020/4/7 下午2:47\n@file: googlenet.py\n@author: zj\n@description: GoogLeNet实现\n\"\"\"\n\nfrom __future__ import division\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.jit.annotations import Optional, Tuple\nfrom torch import Tensor\n\n_...
[ [ "torch.nn.Dropout", "torch.cat", "torch.nn.functional.dropout", "torch.nn.init.constant_", "scipy.stats.truncnorm", "torch.nn.Conv2d", "torch.unsqueeze", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.functional.relu", ...
zarzarj/MinkowskiEngine
[ "1c1c09d23bd2147fa41cae25fa8837290c2bd07b" ]
[ "examples/PointTransformer/PointTransformer.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom examples.PointTransformer.pointops.functions import pointops\n\n\nclass PointTransformerLayer(nn.Module):\n def __init__(self, in_planes, out_planes, share_planes=8, nsample=16):\n super().__init__()\n self.mid_planes = mid_planes = out_planes // 1\n ...
[ [ "torch.nn.Softmax", "torch.nn.BatchNorm1d", "torch.nn.Sequential", "torch.cat", "torch.cuda.IntTensor", "torch.nn.Linear", "torch.nn.MaxPool1d", "torch.nn.ReLU" ] ]
neonsecret/Real-Time-Voice-Cloning
[ "07442ca1e73957440b3c8c55b50b124fb813db55" ]
[ "synthesizer/g2p/__init__.py" ]
[ "import re\n\nimport torch\nimport threading\nimport _thread\n\nfrom alphabet_detector import AlphabetDetector\nfrom contextlib import contextmanager\n\nfrom .config import DataConfigEn, DataConfigRu, ModelConfigEn, ModelConfigRu, TestConfigEn, TestConfigRu\nfrom .data import PersianLexicon\nfrom .model import Enco...
[ [ "torch.ones", "torch.zeros", "torch.load", "torch.tensor", "torch.no_grad" ] ]
kiwikuma/modred
[ "989ac1881fbd8e24e57ca6dd26ee08432e874754" ]
[ "examples/hermite.py" ]
[ "\"\"\"\nSpectral differentiation from J.A.C. Weideman and S.C. Reddy 1998, ACM TOMS.\n\"\"\"\n\nimport numpy as N\nimport numpy.ma as ma\n\ndef herroots(n):\n \"\"\"Returns the roots of the Hermite polynomial of degree n.\"\"\"\n # Jacobi matrix\n J = N.diag(N.arange(1, n)**0.5, 1) + N.diag(N.arange(1, n)...
[ [ "numpy.diag", "numpy.arange", "numpy.eye", "numpy.tile", "numpy.ones", "numpy.delete", "numpy.identity", "numpy.fill_diagonal", "numpy.prod", "numpy.linalg.eigvalsh", "numpy.exp", "numpy.zeros" ] ]
WLM1ke/PortfolioOptimizer
[ "477430951984e9018143ce09b01ea96aa490ea40" ]
[ "src/local/moex/tests/test_index.py" ]
[ "import arrow\nimport pandas as pd\n\nfrom local.moex import iss_index\nfrom local.moex.iss_index import IndexDataManager\nfrom web.labels import CLOSE_PRICE\n\n\ndef test_index():\n df = iss_index.index()\n assert isinstance(df, pd.Series)\n assert df.name == CLOSE_PRICE\n assert df.index.is_monotonic_...
[ [ "pandas.to_datetime" ] ]
hungyiwu/mixed-distance
[ "12d933d834ae79bf3512a688c31be760b4be9322" ]
[ "code/autoencoder.py" ]
[ "import tensorflow as tf\nimport tensorflow.keras as tfk\n\n\nclass conv_ae(tfk.Model):\n def __init__(\n self,\n input_shape: tuple,\n latent_dim: int,\n num_conv_layer: int,\n num_conv_filter: int,\n **kwargs\n ):\n super(conv_ae, self).__init__(**kwargs)\n ...
[ [ "tensorflow.keras.Input", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.Model", "tensorflow.keras.layers.Reshape", "ten...
coolsidd/ActivityNet
[ "f442b853a483606654ed415369acf8b6dbd3e958" ]
[ "Crawler/Kinetics/download.py" ]
[ "import argparse\nimport glob\nimport json\nimport os\nimport shutil\nimport subprocess\nimport uuid\nimport csv\nfrom collections import OrderedDict\nfrom tqdm import tqdm\nfrom joblib import delayed\nfrom joblib import Parallel\nimport pandas as pd\n\n\ndef create_video_folders(dataset, output_dir, tmp_dir):\n ...
[ [ "pandas.read_csv" ] ]
xKHUNx/xgboost
[ "e3aa7f1441e87b039a5db9a27e86bd60a017cd55" ]
[ "python-package/xgboost/dask.py" ]
[ "# pylint: disable=too-many-arguments, too-many-locals\n\"\"\"Dask extensions for distributed training. See\nhttps://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple\ntutorial. Also xgboost/demo/dask for some examples.\n\nThere are two sets of APIs in this module, one is the functional API including...
[ [ "numpy.concatenate", "numpy.empty" ] ]
dmitryshendryk/mask_rcnn_carplate
[ "c0b8de45f3ce95712140259a7ad520e118dee0ed" ]
[ "workspace/eval_new.py" ]
[ "import os\nimport sys\nimport time\nimport numpy as np\nimport imgaug # https://github.com/aleju/imgaug (pip3 install imgaug)\nimport json\nimport skimage\nimport cv2\nfrom mrcnn import visualize\nfrom PIL import ImageEnhance\nimport matplotlib.pyplot as plt\nfrom mrcnn.config import Config\nfrom mrcnn import mod...
[ [ "numpy.all", "numpy.any", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
nohamanona/poke-auto-fuka
[ "9d355694efa0168738795afb403fc89264dcaeae" ]
[ "stm/volatile_class_get.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport serial\r\nfrom stm.send_serial import SendSerial\r\n\r\nclass VolatileClassGet(object):\r\n def __init__(self):\r\n self.next_state = 'None'\r\n self.send_command = 'None'\r\n self._control_frame_count =0\r\n self.hatched_egg =0\r\n s...
[ [ "numpy.int8" ] ]
rishavsen1/transit-simulator
[ "e5ae747b304243f8fed06e34b99f9b0d61547e5a" ]
[ "manual_files/codes/process.py" ]
[ "import dask.dataframe as dd\nimport pandas as pd\n## trajectory for all vehicles during the simulation time interval\nmotion = dd.read_csv(\"trajectories_outputmotionState.csv\",sep=';',low_memory=False)\nprint(\"motion file imported. length\",motion.shape[0])\nvehtype = pd.read_csv(\"trajectories_outputactorConfi...
[ [ "pandas.merge", "pandas.read_csv" ] ]
wassname/transfer-learning-conv-ai
[ "879fedf136cc84d93c41f3fdfa58c6f42857f796" ]
[ "interact_server.py" ]
[ "# # Copyright (c) 2019-present, HuggingFace Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\npython interact_server.py --max_history 4 --top_p 0.8 --fp16 O2 --model_checkpoint runs/Jul19_14-38...
[ [ "torch.nn.functional.softmax", "torch.cuda.manual_seed", "torch.random.manual_seed", "torch.multinomial", "torch.tensor", "torch.no_grad", "torch.sort", "torch.cuda.is_available", "torch.topk" ] ]
maoyingxue/meterReader
[ "bf1fe1858e084f2c4e8f82346bdadd66cf51faeb" ]
[ "algorithm/OCR/utils.py" ]
[ "import sys\nimport cv2\nimport os\nimport numpy as np\nimport torch\n\nfrom algorithm.debug import *\n\nsys.path.append(\".\")\n\n\ndef fillAndResize(image):\n \"\"\"\n 将输入图像填充为正方形且变换为(28,28)\n :param image:\n :return:\n \"\"\"\n h, w = image.shape\n l = max(w, h)\n ret = np.zeros((l, l), n...
[ [ "torch.max", "torch.Tensor", "torch.load", "numpy.array", "numpy.zeros" ] ]
j96w/CoGail
[ "fe61a5af262cf30967adc070d7a364b832d1763d" ]
[ "configs/exp1_config.py" ]
[ "import argparse\nimport torch\n\ndef get_args():\n parser = argparse.ArgumentParser(description='CoGAIL')\n parser.add_argument(\n '--render-mode',\n default='headless',\n help='which visualization mode to use: headless or gui')\n parser.add_argument(\n '--algo',\n defau...
[ [ "torch.cuda.is_available" ] ]
justinbt1/Multimodal-Document-Classification
[ "794eb1e1235efc9c81f1edca881db576d754628a" ]
[ "experimental_models/utils/data.py" ]
[ "import os\nimport json\nimport PIL\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow import keras\n\nfrom utils.database import get_db_table\n\n\nclass DocumentData:\n \"\"\" Loads and prepares text and image data prior to modelling.\n\n Attribute...
[ [ "tensorflow.keras.preprocessing.text.Tokenizer", "sklearn.model_selection.train_test_split", "numpy.array", "numpy.zeros", "tensorflow.keras.utils.to_categorical", "tensorflow.keras.preprocessing.sequence.pad_sequences" ] ]
mlvc-lab/VDSR_pytorch
[ "37b403b61006ac604a6ef44485aa248d25a17200" ]
[ "main.py" ]
[ "from __future__ import print_function\nimport argparse\nfrom math import log10, sqrt\nimport time\nimport os\nfrom os import errno\nfrom os.path import join\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nfrom torch.autograd import Variable\nfrom torch.uti...
[ [ "torch.cuda.set_device", "torch.load", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.cuda.is_available", "torch.cuda.device", "torch.nn.DataParallel", "torch.nn.MSELoss", "torch.save" ] ]
anonymous202201/fast_transferable_blackbox_attack
[ "765294e195b32766e11cd71f89500fdc5e44dcdc" ]
[ "fta/models/surrogates/mobilenetv2.py" ]
[ "\"\"\" Adapted mobilenet_v2 pytorch model that is used as surrogate. \"\"\"\r\nimport torch\r\nimport torchvision\r\n\r\nfrom fta.models.surrogates.base import BaseSurrogate\r\nfrom fta.utils.dataset_utils.imagenet_utils import get_imagenet_normalize\r\nfrom fta.utils.torch_utils.model_utils import Normalize\r\n\r...
[ [ "torch.nn.ModuleList", "torch.unsqueeze", "torch.load" ] ]
kencan7749/bdpy
[ "75b909742aa4767f09823cc98a588c41848292a9" ]
[ "bdpy/bdata/bdata.py" ]
[ "'''BrainDecoderToolbox2/BdPy data class\n\nThis file is a part of BdPy\n\n\nAPI list\n--------\n\n- Data modification\n - add\n - update\n - add_metadata\n - rename_metadata\n - set_metadatadescription\n- Data access\n - select\n - get\n - get_metadata\n - show_metadata\n- File I/O\n ...
[ [ "numpy.hstack", "numpy.ix_", "numpy.logical_not", "numpy.logical_and", "numpy.isnan", "numpy.asarray", "scipy.io.loadmat", "numpy.ndarray", "numpy.logical_or", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.vstack" ] ]
tlambert03/pycudadecon
[ "66eedccd11d738c1ec4afac8da542dfbcc3a26a0" ]
[ "pycudadecon/_ctyped.py" ]
[ "import ctypes\nimport functools\nimport os\nimport sys\nfrom ctypes.util import find_library\nfrom inspect import Parameter, signature\nfrom typing import Callable, Optional, Type\n\nimport numpy as np\n\nif sys.version_info >= (3, 7):\n from typing_extensions import Annotated, get_args, get_origin\nelse:\n ...
[ [ "numpy.ctypeslib.ndpointer", "numpy.dtype" ] ]
jonahcullen/Camoco
[ "2e95950f996329e27c00e5155e3768c0de9b8b7b" ]
[ "camoco/Ontology.py" ]
[ "#!/usr/bin/python3\n\nfrom .Camoco import Camoco\nfrom .RefGen import RefGen\nfrom .Locus import Locus\nfrom .Term import Term\n\nfrom pandas import DataFrame\nfrom scipy.stats import hypergeom\nfrom itertools import chain\nfrom functools import lru_cache\nfrom collections import OrderedDict\n\nimport sys\nimport ...
[ [ "pandas.DataFrame.from_records", "pandas.concat", "scipy.stats.hypergeom.sf" ] ]
davidmccandlish/vcregression
[ "25f5c0148798fa6936088eb6eee6e3e52d67f449" ]
[ "vcregression/vc_pos_var.py" ]
[ "import argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"a\", help=\"alphabet size\", type=int)\nparser.add_argument(\"l\", help=\"sequence length\", type=int)\nparser.add_argument(\"-name\", help=\"name of output folder\")\nparser.add_argument(\"-data\", help=\"path to input data\",\n ...
[ [ "numpy.array", "pandas.read_csv", "numpy.shape", "pandas.DataFrame" ] ]
daniel-schaefer/CompEcon-python
[ "d3f66e04a7e02be648fc5a68065806ec7cc6ffd6" ]
[ "compecon/demos/demqua04.py" ]
[ "\n# coding: utf-8\n\n# ### DEMQUA04\n# # Area under normal pdf using Simpson's rule\n\n# In[1]:\n\n\nimport numpy as np\nfrom compecon import qnwsimp, demo\nimport matplotlib.pyplot as plt\n\n\n# In[2]:\n\n\nn, a, z = 11, 0, 1\n\ndef f(x):\n return np.sqrt(1/(2*np.pi))*np.exp(-0.5*x**2)\n\n\n# In[3]:\n\n\nx, w ...
[ [ "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.hlines", "matplotlib.pyplot.gcf", "matplotlib.pyplot.yticks", "numpy.exp", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure" ] ]
verlab/DEAL_NeurIPS_2021
[ "02480e12035c20227f9d9bba05c07048927ea774" ]
[ "evaluation/distmat_tools.py" ]
[ "# Copyright 2021 [name of copyright owner]\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...
[ [ "numpy.repeat", "numpy.array", "numpy.linalg.norm", "numpy.sqrt" ] ]
rollno4/tensorflow
[ "169124c0c9630b719e7f0e55722c38c7ecd6c5ac" ]
[ "tensorflow/python/distribute/tpu_strategy.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.tpu.ops.tpu_ops.all_to_all", "tensorflow.python.framework.tensor_shape.TensorShape", "tensorflow.python.tpu.tpu.core", "tensorflow.python.distribute.values.ReplicaDeviceMap", "tensorflow.python.distribute.cross_device_ops.reduce_non_distributed_value", "tensorflow.python...
santhalakshminarayana/AutoML
[ "275bd4fab6c0cfa82c2458520b3e685591b174e7" ]
[ "utils/data_preprocess_clustering.py" ]
[ "import pandas as pd\nimport csv\n\nfrom utils.update_logs import update_pass, update_fail\n\ndef data_preprocess_clustering(file_name):\n\t'''\n\tParams:\n\t------\n\t\tfile_name (str) : path to dataset file\n\n\tReturns:\n\t--------\n\t\tstatus (str) : fail or pass of data pre-processing\n\t\tlogs (list) : runnin...
[ [ "pandas.read_csv" ] ]