repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
rohitvk1/pymindaffectBCI | [
"0119145a8b280c776f4c4e6cd776fed0f0156404"
] | [
"mindaffectBCI/decoder/decoder.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) 2019 MindAffect B.V. \n# Author: Jason Farquhar <jason@mindaffect.nl>\n# This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>.\n#\n# pymindaffectBCI is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Gen... | [
[
"numpy.sqrt",
"numpy.issubdtype",
"numpy.max",
"numpy.mean",
"numpy.hstack",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"numpy.flatnonzero",
"matplotlib.pyplot.gcf",
"numpy.argmax",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.close",
"numpy.zeros",
... |
csrunner/new_feat | [
"5174312634c696b022f624a047d1dcb7435dfeba"
] | [
"socket_cv_client.py"
] | [
"# -*- coding:utf-8 -*-\n__author__ = 'shichao'\n\n# 客户端\n\n\nimport socket\nimport cv2\nimport threading\nimport struct\nimport numpy\n\n\nclass Camera_Connect_Object:\n def __init__(self, D_addr_port=[\"\", 8880]):\n self.resolution = [640, 480]\n self.addr_port = D_addr_port\n self.src = ... | [
[
"numpy.fromstring"
]
] |
starsky/pymlearn | [
"f9687882aef401a7ecceab4537bdc15a44cf1356"
] | [
"tests/test_theano_loss_functios.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom context import _loss_func_semi_vectorized\nfrom context import _loss_func_theano\nimport unittest\nimport sklearn.preprocessing\nimport theano\nimport numpy as np\n\n\nclass TheanoLossFunctionsTestSuite(unittest.TestCase):\n \"\"\"Advanced test cases.\"\"\"\n\n def test_hinge_... | [
[
"numpy.random.randint",
"numpy.testing.assert_almost_equal",
"numpy.random.random",
"numpy.testing.assert_array_almost_equal"
]
] |
mmore500/dishtiny | [
"9fcb52c4e56c74a4e17f7d577143ed40c158c92e"
] | [
"microbenchmarks/script/consolidate.py"
] | [
"from collections import defaultdict\nfrom frozendict import frozendict\nimport json\nfrom keyname import keyname as kn\nimport pandas as pd\nimport sys\n\ndef load_json(filename):\n with open(filename) as json_file:\n data = json.load(json_file)\n return data\n\nres = defaultdict(list)\n\nfor filename... | [
[
"pandas.DataFrame"
]
] |
vanyaland/deep-learning-foundation | [
"05a0df56c8223547bd7e8b62653a67f265c8e5ca"
] | [
"1-neural-networks/gradient-descent/multiple/gradient_descent.py"
] | [
"import numpy as np\nfrom data_prep import features, targets, features_test, targets_test\n\n# Weight update can be calculated as:\n# Δwi = ηδxi\n#\n# with the error term δ as:\n# δ = (y − y^) f′(h) = (y − y^)f′(∑wixi)\n\ndef sigmoid(x):\n \"\"\"\n Calculate sigmoid\n \"\"\"\n return 1 / (1 + np.exp(-x)... | [
[
"numpy.dot",
"numpy.random.seed",
"numpy.random.normal",
"numpy.mean",
"numpy.exp",
"numpy.zeros"
]
] |
iSiddharth20/Covid-19-Hotspot-Detection | [
"89b7757bae248e749b7c04cc0ed83f93c7dd7a5d"
] | [
"Python_Codes/DataSource.py"
] | [
"# Importing Libraries\nimport requests\nimport pandas as pd \n\n# Data Source\nsource_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSz8Qs1gE_IYpzlkFkCXGcL_BqR8hZieWVi-rphN1gfrO3H4lDtVZs4kd0C3P8Y9lhsT1rhoB-Q_cP4/pub?output=xlsx'\n\n# Getting Data from Source\nr = requests.get(source_url, allow_redirects=T... | [
[
"pandas.read_excel"
]
] |
neighthan/pytorch-lightning | [
"03a73b37bc25d66ff78fe3e71e64e2173a04b429"
] | [
"pytorch_lightning/trainer/training_loop.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.isfinite",
"numpy.argmax",
"numpy.cumsum"
]
] |
IbrahimEl-Shal/Digital_Video_Processing | [
"ce5649dba94ba5c50bc3fe6740d3059a99a6ea8f"
] | [
"3. Motion Estimation/Assignment_3_ME.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 4 00:32:16 2019\n\n@author: Ibrahim El-Shal\nAssignment 3:\n- Develop a Motion Estimation algorithm using Window Search to encode two images in YUV format. \n- Use 8x8 block.\n- Reconstruct the images using Motion Compensation. \n- Compute PSNR between the Sou... | [
[
"numpy.array",
"numpy.abs"
]
] |
woosal1337/cv2 | [
"cae4ad1e3ba4259507acde4db74559a726b09281"
] | [
"drawing-shapes/shifting-parameters-animations.py"
] | [
"import cv2\nimport numpy as np\nimport time\nimport random\n\nimport numpy as np\nimport cv2\n\nimage_path = \"../assets/img.png\"\n\nimage = cv2.imread(image_path)\nimage = cv2.resize(image, (int(image.shape[0] * 0.25), int(image.shape[1] * 0.25)))\n\nx1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6 = 25, 25, 110, ... | [
[
"numpy.array"
]
] |
Zeng-Lecheng/Music-Genre-Classification | [
"6d489c777431af94f5167808ac4487957743f04b"
] | [
"main/rnn.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, random_split\nimport torch.optim as optim\nfrom tqdm import tqdm\nfrom matplotlib import pyplot as plt\nfrom datetime import datetime\n\nfrom util import WavData\n\nfrom torch.utils.tensorboard import SummaryWriter\n\n# fixed : pip3 inst... | [
[
"matplotlib.pyplot.legend",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.title",
"torch.nn.LSTM",
"torch.manual_seed",
"torch.nn.RNN",
"torch.utils.data.DataLoader",
"torch.argmax",
"torch.nn.Linear",
"torch.utils.data.random_split",
"torch.re... |
Moctader/Master_thesis | [
"1852b05e413d3ab3108d4018d86e35b10497f622"
] | [
"scripts/experiments_runner.py"
] | [
"# Refactored idea from https://dmitryulyanov.github.io/if-you-are-lazy-to-install-slurm/\nfrom joblib import Parallel, delayed\nfrom queue import Queue\nimport os\nimport torch\nfrom functools import partial\nimport argparse\nimport glob\nimport time\nimport subprocess\n\n\ndef experiment_worker(exp_name, queue_ob... | [
[
"torch.cuda.device_count"
]
] |
zgsbughammer/leaf | [
"7ef36df20d492c558829259611708f413ed80487"
] | [
"models/model.py"
] | [
"\"\"\"Interfaces for ClientModel and ServerModel.\"\"\"\n\nfrom abc import ABC, abstractmethod\nimport numpy as np\nimport os\nimport sys\nimport tensorflow as tf\n\nfrom baseline_constants import ACCURACY_KEY\n\nfrom utils.model_utils import batch_data\nfrom utils.tf_utils import graph_size\n\n\nclass Model(ABC):... | [
[
"tensorflow.Graph",
"tensorflow.RunMetadata",
"tensorflow.trainable_variables",
"tensorflow.set_random_seed",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.profiler.profile",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.Session",
... |
leeshinyook/RectangleCropper | [
"c83cbef3d8c0550fd5642f7c2aed759a13fbf131"
] | [
"rectanglecropper/crop.py"
] | [
"from PIL import Image\nfrom collections import deque\nimport numpy as np\nimport warnings\n\n\nclass ImageThresholdUtil:\n \"\"\"\n It has to do with the image threshold. Threshold here means filtering,\n which finds the pixels to be filtered out. So this class has static methods\n related to the thres... | [
[
"numpy.unique",
"numpy.concatenate",
"numpy.argpartition",
"numpy.array",
"numpy.zeros"
]
] |
selenecodes/MLWorkshop-Answers | [
"c2b6b56f5b5a5c2b289eefb397692a7aa971e816"
] | [
"MonteCarlo/main.py"
] | [
"import datetime as dt\n\nimport matplotlib.pylab as plt\nimport numpy as np\nimport pandas_datareader.data as web\nimport seaborn as sns\n\nsns.set(context='notebook')\n\n\ndef get_stocks_2019(stock):\n \"\"\"\n Bron: https://www.youtube.com/watch?v=_T0l015ecK4\n \"\"\"\n start = dt.datetime(2019, 1, 1... | [
[
"matplotlib.pylab.tight_layout",
"matplotlib.pylab.show",
"matplotlib.pylab.xlim",
"matplotlib.pylab.legend",
"numpy.arange",
"matplotlib.pylab.title",
"numpy.random.normal",
"numpy.std",
"numpy.mean",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.ylim",
"matplotlib.... |
BambooPalace/Federated-Learning-PyTorch | [
"9dbf5ebd65bd4d03a50f42f2d380e5faa8378778"
] | [
"classification/update.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport torch\nfrom torch import nn\nfrom torch.utils.data import DataLoader, Dataset\n\n# from train import criterion\n\n\nclass DatasetSplit(Dataset):\n \"\"\"An abstract Dataset class wrapped around Pytorch Dataset class.\n \"\"\"\n\n... | [
[
"torch.nn.NLLLoss",
"torch.max",
"torch.eq",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.cuda.is_available"
]
] |
zhangweichen2006/SRDAN_Open | [
"47c1bd9d2369d8e486b18a7aea220af7324c9011"
] | [
"pcdet/models/dense_heads/anchor_head_fuse_fpn_combine_cross_scale.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport scipy\nfrom scipy.spatial.distance import cdist\n\nfrom .anchor_head_template import AnchorHeadTemplate\n\nclass Self_Attn(nn.Module):\n \"\"\" Self attention Layer\"\"\"\n def __init__(self,in_dim,activation):\n... | [
[
"torch.nn.Softmax",
"torch.mean",
"torch.zeros",
"torch.cat",
"torch.cdist",
"torch.nn.Dropout",
"torch.ones",
"torch.randn",
"torch.nn.ModuleDict",
"torch.nn.Sigmoid",
"torch.tensor",
"torch.nn.functional.sigmoid",
"torch.mul",
"torch.bmm",
"torch.arang... |
vishalbelsare/audit-ai | [
"4891b1d3c813a0e6ce657eaee3f1b2ab50e8f429"
] | [
"auditai/utils/general.py"
] | [
"import numpy as np\nfrom scipy.stats import norm\nfrom scipy.special import gammaln\n\n\ndef two_tailed_ztest(success1, success2, total1, total2):\n \"\"\"\n Two-tailed z score for proportions\n\n Parameters\n -------\n success1 : int\n the number of success in `total1` trials/observations\n\... | [
[
"numpy.sum",
"numpy.sqrt",
"scipy.special.gammaln"
]
] |
cemfi/measure-detector | [
"024dde7c30145ec4d868d1cca6a50a3cf6bd977a"
] | [
"backend/server.py"
] | [
"from functools import cmp_to_key\nimport io\n\nimport hug\nimport numpy as np\nimport tensorflow as tf\nfrom PIL import Image\n\n\n# Initialize graph\ndetection_graph = tf.Graph()\ndetection_graph.as_default()\nod_graph_def = tf.GraphDef()\nwith tf.gfile.GFile('model.pb', 'rb') as fid:\n serialized_graph = fid.... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.expand_dims",
"tensorflow.gfile.GFile",
"tensorflow.Session",
"tensorflow.get_default_graph",
"tensorflow.GraphDef",
"numpy.array"
]
] |
petrov-lab/tuba-seq | [
"d257988659f79c2fecfec72b1d7fe260c245b7dc"
] | [
"unadulterated/preprocess.py"
] | [
"#!/usr/bin/env python3\nimport pandas as pd\nimport numpy as np\nimport re\nimport os\nimport argparse\nimport params\nfrom tuba_seq import fastq\nfrom tuba_seq.shared import logPrint\n\n############### Input Parameters that will be retained ########################\n\ncluster_flank = 7 # Parameters used... | [
[
"numpy.arange"
]
] |
richardgorham1/ds-prep-capstone | [
"69f87cb3312d160ea577b191b659c056414e837b"
] | [
"lib/least_squares.py"
] | [
"import math\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\nfrom scipy.stats import t\nfrom scipy.stats import norm\n\ndef least_squares(x, y):\n #from SciPy Stats\n slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) \n \n #Calcu... | [
[
"numpy.round",
"scipy.stats.linregress",
"numpy.sum",
"pandas.DataFrame"
]
] |
cathyhaha/DensityPeakCluster | [
"89eb5f8a67011aea16e49e485474eb76f4319a9d"
] | [
"plot_utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef plot_scatter_diagram(which_fig, x, y, x_label = 'x', y_label = 'y', title = 'title', style_list = None):\n\t'''\n\tPlot scatter diagram\n\n\tArgs:\n\t\twhich_fig : which sub plot\n\t\tx ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
525309178/fp-growth | [
"3b151021bd2b37be8c0aa6fa4ed00b603afe9a7e"
] | [
"test3.py"
] | [
"from __future__ import print_function\n# python3\n# -*- coding: utf-8 -*-\n# @Author : lina\n# @Time : 2018/5/13 11:40\nimport pandas as pd\nfrom sklearn.preprocessing import LabelEncoder,OneHotEncoder\nfrom keras.callbacks import ReduceLROnPlateau\nimport numpy as np\nfrom sklearn.model_selection import train... | [
[
"pandas.concat",
"pandas.read_csv",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.array"
]
] |
MLJeb/EstudioPopularidadBibliotecaUcab | [
"9b2ba98bff29a94d57529cae2d21013c32d22619"
] | [
"statisticsProjectI.py"
] | [
"import numpy as np \nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn; seaborn.set()\nimport openpyxl\nfrom openpyxl import load_workbook\nimport os.path\nfrom collections import Counter\nfrom statsmodels.distributions.empirical_distribution import ECDF\n\ndef percentile(n, name = None):\n ... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.concat",
"numpy.linspace",
"numpy.arange",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"pandas.ExcelWriter",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
mannyfin/PythonLabView | [
"b65624118d51a803c87147c5be0a6687541cea6e"
] | [
"Eurotherm_Interpolation.py"
] | [
"import sys\nimport pandas as pd\nimport os\nfrom thermocouples_reference import thermocouples\n\ndef interp(inputmV,mV_table, T_table):\n \"\"\"\n\n :param inputmV: input value to interpolate\n :param mV_table: the two mV values in between the input mV value\n :param T_table: the two Temp values in bet... | [
[
"pandas.read_excel"
]
] |
easilylazy/pattern-recognition | [
"2b95689bb3f34e4821a0211b19b76164aa6e615f"
] | [
"homework-12345/homework5/wholetest.py"
] | [
"\n# %%\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom torchtext.legacy import data\nfrom torchtext.legacy import datasets\nfrom torchtext.vocab import Vectors, GloVe, CharNGram#, FastTex\nfrom torch.autograd import Variable\n\nimport numpy as np\nfrom os ... | [
[
"torch.nn.init.uniform_",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.nn.Parameter",
"torch.Tensor",
"torch.load",
"torch.nn.LSTM",
"torch.manual_seed",
"torch.zeros",
"torch.nn.Embedding",
"torch.tanh",
"torch.nn.Linear",
"torch.no_grad",... |
HelmchenLabSoftware/mesostat-dev | [
"8baa7120b892fe0df893cdcf0f20f49876643d75"
] | [
"mesostat/utils/matlab_helper.py"
] | [
"import os, time\nimport scipy.io as spio\n\n# Print root level values of dict (result of loadmat)\ndef inspect_mfile(d):\n for k,v in d.items():\n if isinstance(v, float) or isinstance(v, int) or isinstance(v, list):\n print(k, v)\n else:\n print(k, v.shape)\n\n# Convert \"sc... | [
[
"scipy.io.loadmat"
]
] |
AAAI-DISIM-UnivAQ/nlpia | [
"39bf2ceff2128e5bb7ad233ced55cb55fe70be4a"
] | [
"src/nlpia/book/examples/ch10_movie_dialog_chatbot_v2.py"
] | [
"r\"\"\" Build character sequence-to-sequence training set\n\n>>> df = get_data('moviedialog')\n>>> df.columns = 'statement reply'.split()\n>>> df = df.dropna()\n>>> input_texts, target_texts = [], [] # <1>\n>>> start_token, stop_token = '\\t', '\\n' # <3>\n>>> input_vocab = set(start_token+stop_token) # <2>\n>>... | [
[
"numpy.argmax"
]
] |
poechsel/iree | [
"c242129687621a923fac192d17389bf469a6666c"
] | [
"integrations/tensorflow/e2e/explicit_backend_test.py"
] | [
"# Lint as: python3\n# 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 appl... | [
[
"tensorflow.compat.v2.enable_v2_behavior",
"numpy.array",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.test.main"
]
] |
saguilarDevel/schc-sigfox | [
"27e14edc0e350f027e6d7b300ec79b6aa92dc06d"
] | [
"stats/server_analytics.py"
] | [
"import pandas as pd\nimport json\n\npd.set_option('display.max_columns', None)\n\n# json_file = json.loads('/Users/sergioaguilar/PycharmProjects/SCHCfox/stats/files/stats_file_v2.json')\nwith open('files/server/fragments_stats_v4.0.json') as json_file:\n data = json.load(json_file)\n\ndf1 = pd.read_json(str(jso... | [
[
"pandas.set_option"
]
] |
okara83/Becoming-a-Data-Scientist | [
"f09a15f7f239b96b77a2f080c403b2f3e95c9650"
] | [
"Cloud Services and Computing/Amazon AWS/Lambdas/Lambdas-Practice-Web-Examples/aws-tutorial-code-master/lambda/lambda_read_excel_file_s3_trigger.py"
] | [
"# -*- coding: utf-8 -*-\n__author__ = \"Chirag Rathod (Srce Cde)\"\n__license__ = \"MIT\"\n__email__ = \"chiragr83@gmail.com\"\n__maintainer__ = \"Chirag Rathod (Srce Cde)\"\n\n\nimport json\nimport io\nfrom urllib.parse import unquote_plus\nimport boto3\nimport pandas as pd\n\n\ndef lambda_handler(event, context)... | [
[
"pandas.read_excel"
]
] |
rsjones94/data_inspection | [
"b3f57c3eea1b800e629ff79c3f9922daf64f7b8f"
] | [
"data_inspection/__main__.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nMain entry point for data_inspection. This script reads in\ntabular patient data and analyzes it for outliers. First, it inspects specified\ncolumns for data integrity (missing values) and produces histograms if appropriate.\n\nThen it analyzes specified 2d ... | [
[
"matplotlib.pyplot.legend",
"pandas.Series",
"pandas.DataFrame",
"sklearn.neighbors.LocalOutlierFactor",
"matplotlib.pyplot.plot",
"sklearn.preprocessing.MinMaxScaler",
"pandas.read_csv",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
... |
mismayil/kogito | [
"e62b010d6787ddae0035ed2bc596619ec31fd6b9"
] | [
"kogito/models/gpt2/comet.py"
] | [
"from typing import Optional\nimport numpy as np\nimport torch\nfrom torch import cuda\nfrom torch.utils.data import DataLoader\nfrom transformers import GPT2LMHeadModel, GPT2Tokenizer\nfrom pytorch_lightning.loggers import WandbLogger\nimport pytorch_lightning as pl\n\nfrom kogito.models.gpt2.utils import GPT2Fine... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
CLT29/pvse | [
"bf5232148396ee5051564ef68a48538de0ddbc84"
] | [
"video_transforms.py"
] | [
"from __future__ import division\nimport torch\nimport math\nimport sys\nimport random\nfrom PIL import Image, ImageOps, ImageEnhance\ntry:\n import accimage\nexcept ImportError:\n accimage = None\nimport numpy as np\nimport numbers\nimport types\nimport collections\nimport warnings\n\nimport torchvision.tran... | [
[
"torch.mm"
]
] |
anonymous-authorss/DS-Pipeline | [
"8304adfe7c1b082ad2225d6d5abf16fd30278cd9"
] | [
"notebooks/featured-70/deep-learning-in-the-deep-blue-lb-1-279.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Start-to-Finish Solution in Keras\n# \n# Here is my basic method for getting a LB submission churned out. No parameter tuning or data augmentation has been attempted, which should increase the score significantly. \n\n# In[1]:\n\n\nimport os, cv2, random\nimport numpy ... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.metrics.log_loss",
"numpy.array",
"sklearn.preprocessing.LabelEncoder"
]
] |
jpchavat/nilmtk | [
"906ad988e58d3738917a8b838d853aecaf69d150"
] | [
"nilmtk/dataset_converters/iawe/convert_iawe.py"
] | [
"from __future__ import print_function, division\nimport pandas as pd\nimport numpy as np\nfrom os.path import join\nfrom nilmtk.datastore import Key\nfrom nilmtk.measurement import LEVEL_NAMES\nfrom nilmtk.utils import check_directory_exists, get_datastore, get_module_directory\nfrom nilm_metadata import convert_y... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.MultiIndex.from_tuples",
"pandas.date_range"
]
] |
CoAxLab/brainhack-physio-project | [
"b87cd6c6db486639f271b786ca1cf4aa27a70fad"
] | [
"niphlem/tests/test_filters.py"
] | [
"import numpy as np\nfrom niphlem.clean import _transform_filter\n\n\ndef test_transform():\n\n rng = np.random.RandomState(1234)\n n_samples = 200\n\n low_pass = None\n high_pass = None\n sampling_rate = None\n\n eps = 100*np.finfo(np.float64).eps\n # Compare output for different options.\n ... | [
[
"numpy.arange",
"numpy.sin",
"numpy.finfo",
"numpy.std",
"numpy.mean",
"scipy.signal.periodogram",
"numpy.random.RandomState",
"numpy.sum"
]
] |
jayBana/InventoryMan | [
"0826f9c98062fb6600f77a721311cbf27719e528"
] | [
"scripts/01-process_pe/05_sum_items.py"
] | [
"#!/usr/bin/python3\n\n'''\nscript that sums the daily product usage for items from a list\n'''\n\nimport os\nimport os.path\nimport csv\nimport json\nimport pandas as pd\nfrom pandas import ExcelWriter, merge\n\n\ndef main():\n # first argument the path for file to be processed\n dir_path = '..' + os.sep + '... | [
[
"pandas.merge",
"pandas.read_excel",
"pandas.DataFrame"
]
] |
annalunde/master | [
"2552d43713e8ebca0b0e57bc5bebd1eaeeac1875"
] | [
"heuristic/improvement/reopt/reopt_operators.py"
] | [
"import copy\nimport math\nimport sys\n\nimport numpy.random as rnd\nfrom datetime import datetime\nimport pandas as pd\nfrom datetime import timedelta\nimport traceback\nfrom heuristic.construction.construction import ConstructionHeuristic\nfrom config.construction_config import *\nfrom heuristic.improvement.reopt... | [
[
"pandas.isnull",
"numpy.random.shuffle",
"pandas.DataFrame"
]
] |
MoritzLange/py-tedopa | [
"38558c62f5a1cb0cc43b490f50f0674f4a0464c9"
] | [
"tests/test_tmps_for_transverse_ising_model.py"
] | [
"\"\"\"\nTest to check the whole TMPS algorithm for the transverse Ising model\n\"\"\"\n\nfrom scipy.linalg import expm\nfrom scipy.linalg import sqrtm\nimport numpy as np\nimport mpnum as mp\nfrom tedopa import tmps\n\nprecision = 1e-7 # required precision of the tMPS results\n\n\ndef test_mpo_trotter2():\n n ... | [
[
"numpy.kron",
"scipy.linalg.expm",
"numpy.identity",
"scipy.linalg.sqrtm",
"numpy.array",
"numpy.zeros",
"numpy.isclose"
]
] |
tnsogs02/CVCAM | [
"5f4cd416850f5da2e8f7703c2980e9ff5068f8e3"
] | [
"cvcam.py"
] | [
"import time\nimport numpy as np\nimport cv2\nimport json\nfrom gpiozero import LED\nfrom gpiozero import Buzzer\nimport board\nimport busio\nimport adafruit_lsm9ds0\nstartTime = time.time()\nmotion = False\nusbDir = '/media/pi/SAVE'\nwith open(usbDir+'/config.json') as f:\n cfg = json.load(f)\nbuzzer = Buzzer(cfg... | [
[
"numpy.float32",
"numpy.ones"
]
] |
ndraeger/rt1 | [
"8cf30a3b3604b78b1422388e479b28c921d01c09"
] | [
"rt1/general_functions.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"helper functions that are used both in rtfits and rtplots\"\"\"\nimport sys\nimport numpy as np\nfrom itertools import tee, islice\nfrom collections import OrderedDict\n\n\ndef rectangularize(array, return_mask=False, dim=None,\n return_masked=False, dtype=None):\n ... | [
[
"pandas.Series",
"numpy.cos",
"pandas.DataFrame",
"numpy.log10",
"numpy.ma.masked_array"
]
] |
BurakHocaoglu/Dynamic-Multi-Robot-Coverage | [
"707112fb86f4fa05fad24eb52b648646fa4a51d4"
] | [
"coverage_control/scripts/voronoi.py"
] | [
"import sys\r\nimport time\r\nimport yaml\r\nimport math\r\nimport signal\r\nimport datetime\r\nimport threading\r\nimport traceback\r\nimport numpy as np\r\nfrom cvxopt import matrix, solvers\r\n#from scipy.spatial import ConvexHull\r\nimport matplotlib.patches as ptc\r\nimport matplotlib.pyplot as plt\r\nimport m... | [
[
"numpy.linalg.solve",
"numpy.sqrt",
"numpy.meshgrid",
"numpy.isnan",
"numpy.linalg.norm",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"matplotlib.pyplot.Polygon",
"matplotlib.animation.FuncAnimation",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show",
"m... |
imsodin/pyvista | [
"af3bd7dc7b5b8551b732f6e6fa74f6675027469c"
] | [
"examples/02-plot/labels.py"
] | [
"\"\"\"\nLabel Points\n~~~~~~~~~~~~\n\nUse string arrays in a point set to label points\n\"\"\"\n# sphinx_gallery_thumbnail_number = 3\nfrom pyvista import examples\nimport pyvista as pv\nimport numpy as np\n\n# Labels are not currently supported by the VTKjs conversion script\npv.rcParams[\"use_panel\"] = False\n\... | [
[
"numpy.random.rand"
]
] |
ati-ozgur/KDD99ReviewArticle | [
"621d494cf0216c2993b43f387687264116739a09"
] | [
"HelperCodes/create_table_metaDatasetsUsed.py"
] | [
"\nimport ReviewHelper\nimport pandas as pd\n\ndf = ReviewHelper.get_pandas_data_frame_created_from_bibtex_file()\n\n# find problematic ones\ndf[df.metaDatasetsUsed.isnull()]\n\nlist1 = df.metaDatasetsUsed.str.split(\",\").tolist()\n\n\ndf1 = pd.DataFrame(list1)\n\nfor i in range(df1.columns.size):\n df1[i] = df... | [
[
"pandas.DataFrame"
]
] |
loaywael/FaceRecognition | [
"5aa79ff1d8a89e2f0e530bca02ead0bdf3926284"
] | [
"src/PKG/utils/scripts/extract_landmarks_data.py"
] | [
"import io\nimport os\nimport cv2\nimport time\nimport zipfile\nimport argparse\nimport numpy as np \nimport pandas as pd\nimport concurrent.futures\nfrom decouple import config\n\n\nDATA_PATH = config(\"FACE_DATA\")+\"face_landmarks1/\"\nfiles = os.listdir(DATA_PATH)\nprint(\"files in data directory: \", files)\n\... | [
[
"numpy.hstack",
"pandas.read_csv",
"numpy.dstack",
"numpy.random.shuffle",
"numpy.savez_compressed",
"numpy.load",
"numpy.zeros",
"numpy.vstack"
]
] |
w4k2/lies | [
"b689c6d781a1a3cf96705fd2f7bae6dcd964f11b"
] | [
"process_2x5cv.py"
] | [
"#!/usr/bin/env python\nimport helper as h\nimport numpy as np\nimport pandas as pd\nimport csv\n\nnp.random.seed(1337)\n\nfrom sklearn import model_selection, metrics\nfrom tqdm import tqdm\n\nrepetitions = 10\ndatasets = h.datasets()\nclfs = h.classifiers()\n\nfor i, dataset in tqdm(enumerate(datasets)):\n # p... | [
[
"pandas.read_csv",
"numpy.random.seed",
"sklearn.metrics.accuracy_score",
"numpy.argmax",
"numpy.array",
"numpy.random.randint"
]
] |
huihui7987/Kaggle-Playground | [
"18f09371994ebf220a5a77329f13b334da18788b"
] | [
"models/rfr.py"
] | [
"# -*- encoding:ISO-8859-1 -*-\nimport warnings\nwarnings.filterwarnings('ignore')\nimport time\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.metrics import mean_squared_error, make_scorer\nfrom sklearn import pipeline, grid_search\nimport random\nrandom.seed(2016)\n\n\ndef ... | [
[
"sklearn.ensemble.RandomForestRegressor",
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.metrics.mean_squared_error",
"sklearn.grid_search.GridSearchCV",
"sklearn.metrics.make_scorer"
]
] |
mr4msm/chainer | [
"6fa28004889b260ae13484f17dc1ac68b25d52bb"
] | [
"tests/chainer_tests/functions_tests/connection_tests/test_convolution_nd.py"
] | [
"import unittest\n\nimport functools\nimport numpy\nfrom operator import mul\n\nimport chainer\nfrom chainer.backends import cuda\nimport chainer.functions as F\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chainer.utils import conv\n\n\n@testing.parameterize(*(testing.product({\n 'dims': ... | [
[
"numpy.random.uniform",
"numpy.random.normal",
"numpy.ones"
]
] |
hamza-ml/rice-grain-identifier | [
"17971727d6d3934dec25c97104332cc687754dae"
] | [
"source.py"
] | [
"import math\nimport warnings\nimport numpy as np\nimport skimage as ski\nimport skimage.io as skio\nfrom matplotlib import cm\nimport xlsxwriter as excel\nimport matplotlib.pyplot as plt\nfrom skimage.transform import rotate\nfrom skimage.morphology import square\nfrom skimage.measure import label as sml\nfrom ski... | [
[
"matplotlib.pyplot.imsave",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots",
"numpy.pad"
]
] |
luca-riboldi/HES-OFF | [
"95523c730ac46676cfe8326ef7498d1484cdf3b2"
] | [
"hes_off/core/deprecated/tests/visual_checks/plot_electrolizer_performance.py"
] | [
"## ------------------------------------------------------------------------------------------------------------------ ##\n## ------------------------------------------------------------------------------------------------------------------ ##\n## ___ ___ ________ ________ ____... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.rc"
]
] |
thilina27/ProojectRes | [
"8342ea354fb52a5f93b178b34e4a712515027590"
] | [
"Cnn/Test/test1/Untitled Folder/imagedatamake.py"
] | [
"import os\nimport random\nimport cv2\nimport numpy as np\n\n\ndef load_Imagedata(imagedir='/Images', numChannels=1, minNumSamplesPerClass=100, imsize=(28, 28), p_train=0.6,\n p_val=0.2):\n print(\"load images\")\n # run throug the folders, load the files\n onlyFolders = [f for f in os.li... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.expand_dims",
"numpy.transpose"
]
] |
LIDS-UNICAMP/FLIM | [
"49947ca8962f5c548ca543ed68e5bbaf7ed8414c"
] | [
"flim/models/lcn/_decoder.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom ...utils import compute_importance\n\n__all__ = ['Decoder']\n\nclass Decoder(nn.Module):\n def __init__(self, images, markers, n_classes, device='cpu'):\n\n super(Decoder, self).__init__()\n\n self.n_classes = n_classes\n self.device = device\n\n ... | [
[
"torch.sum"
]
] |
trisct/Software-Tutorials | [
"50d7851b861700fe256dfed97f84dc321a5286dc"
] | [
"python_packages/pytorch/4_extending_with_python/ATenCpp_exts/1_PMTS_gpu/PMTS_timetest.py"
] | [
"import torch\nimport torch.autograd\nfrom torch.autograd import gradcheck\n\nfrom PMTS_module import PMTS as pmts\nimport time\n\nmodule_name = \"PMTS\"\nprint(f\"\\n############ starting time test of module {module_name} ############\")\n\n# only double is precise enough for gradcheck\na = torch.randn(500000, req... | [
[
"torch.randn"
]
] |
garrettkatz/ghu | [
"2bf25ac6f8e82d3e7231c3381f7a4946db6dc59f"
] | [
"max.py"
] | [
"import itertools as it\r\nimport numpy as np\r\nimport torch as tr\r\nimport matplotlib.pyplot as pt\r\nfrom ghu import *\r\nfrom codec import Codec\r\nfrom controller import Controller\r\nfrom lvd import lvd\r\nfrom reinforce import *\r\nimport json\r\n\r\ndef trials(i, avgrew, avggen, gradnorm):\r\n print(\"*... | [
[
"numpy.array"
]
] |
neet-cv/indexNet_STDCSeg | [
"9165e1352711e851b6807d3848a7abee09247096"
] | [
"models/model_stages.py"
] | [
"#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom nets.stdcnet import STDCNet1446, STDCNet813\n\n# from modules.bn import InPlaceABNSync as BatchNorm2d\n\n\nBatchNorm2d = nn.BatchNorm2d\n\n\n# ConvX??\nclass ConvBNReLU(nn.Module):\n def ... | [
[
"torch.cat",
"torch.nn.init.constant_",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.mul",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_"
]
] |
JRyanShue/ldif_clone | [
"d16656d4bb75e0b6beb33ee413cb87b0ff695d35"
] | [
"ldif/training/loss.py"
] | [
"# Copyright 2020 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 ... | [
[
"tensorflow.sign",
"tensorflow.summary.scalar",
"tensorflow.reduce_mean",
"tensorflow.maximum",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.ones",
"tensorflow.expand_dims",
"tensorflow.math.reduce_variance",
"tensorflow.stop_gradient",
"tensorflow.reduce_min",
... |
albert-magyar/ParlAI | [
"3133b4e8290f8a42679b93a65fc25e76ac7f6761"
] | [
"parlai/scripts/train_model.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nTraining script for ParlAI.\n\nThe standard way to train a model. After training, also computes\nvali... | [
[
"numpy.round"
]
] |
ly1996/facenet | [
"4ac4576268dd3386cc39a690952b907d2bf6c86d"
] | [
"src/models/inception_resnet_v1.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required... | [
[
"tensorflow.concat",
"tensorflow.contrib.slim.dropout",
"tensorflow.contrib.slim.arg_scope",
"tensorflow.contrib.slim.max_pool2d",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.contrib.slim.repeat",
"tensorflow.contrib.slim.initializers.xavier_initializer",
"tensorflow.cont... |
drJfunk/gbmgeometry | [
"ca11005c349546ed962bb1bbc4f66d8022ea79a1",
"ca11005c349546ed962bb1bbc4f66d8022ea79a1"
] | [
"gbmgeometry/geometry/sphere.py",
"gbmgeometry/utils/array_to_cmap.py"
] | [
"import ipyvolume as ipv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numba as nb\nimport h5py\n\nfrom gbmgeometry.utils.package_utils import get_path_of_data_file\n\n\n# -*- coding: utf-8 -*-\nclass Sphere(object):\n def __init__(\n self,\n ax,\n x=0,\n y=0,\n ... | [
[
"numpy.dot",
"numpy.linspace",
"numpy.arcsin",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.atleast_1d",
"numpy.array",
"numpy.meshgrid",
"numpy.zeros"
],
[
"matplotlib.pyplot.cm.ScalarMappable"
]
] |
chipturner/advent-of-code-2021 | [
"52d8f84eb9243fa076c9f7c2a2e3836e138ab127"
] | [
"src/day4.py"
] | [
"import helpers\nimport numpy\n\nimport itertools\nimport collections\nfrom typing import List\n\ndef card_wins(card):\n d = numpy.array(card)\n dt = d.transpose()\n for row in d:\n if numpy.sum(row) == 0:\n return True\n for row in dt:\n if numpy.sum(row) == 0:\n ret... | [
[
"numpy.array",
"numpy.sum"
]
] |
Brain-Modulation-Lab/Paper_SpatialPatternsMovementDecoding | [
"31588def6cef875dd42ea580f76f79c4856a1353"
] | [
"Experiments/Utilities/icn_m1/online_analysis.py"
] | [
"import filter\nimport numpy as np \nimport projection\nimport time\nfrom matplotlib import pyplot as plt \n\ndef append_time_dim(X, y_=None, time_stamps=5):\n \"\"\"\n :param X: in shape(time, grid_points/channels, f_bands)\n apply added time dimension for the data array and label given time_stamps (with ... | [
[
"matplotlib.pyplot.legend",
"numpy.expand_dims",
"numpy.clip",
"numpy.reshape",
"numpy.arange",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"numpy.array",
"numpy.zeros",
"ma... |
ProjectBlackFalcon/BlackFalconCore | [
"23af1829224738c06092e3e513a0bf2753b4c35f"
] | [
"strategies/support_functions.py"
] | [
"import hashlib\nimport json\nimport random\nimport uuid\n\nimport numpy as np\nfrom heapq import *\nimport time\nimport itertools\nimport sys\n\nimport pymongo\nimport psycopg2\n\nfrom credentials import credentials\n\n\ndef cell2coord(cell):\n return cell % 14 + int((cell // 14) / 2 + 0.5), (13 - cell % 14 + i... | [
[
"numpy.array",
"numpy.zeros"
]
] |
khaiyichin/DS595-RL-Projects | [
"4add6b2adc2cb9f7cdb783d50b005ecd1b4aada3"
] | [
"Project3/dqn_model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DQN(nn.Module):\n \"\"\"Initialize a deep Q-learning network\n\n Hints:\n -----\n Original paper for DQN\n https://storage.googleapis.com/deepmind-... | [
[
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.no_grad",
"torch.gather"
]
] |
nishantsinghdev/smartdata | [
"e4a9799c76da4230e8d4edbb2e04c2a48eaa20df"
] | [
"rishabh/stats (1).py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = input('enter the data path ')#'C:\\Users\\yobin\\Desktop\\Ecommerce Purchases.csv'\nsep = input('enter the seperater ')\ndf = pd.read_csv(data,sep)\n#get only the numeric values of dataframe\npp=df... | [
[
"pandas.read_csv"
]
] |
philbull/VisModel | [
"ccdad81064082efced9d4ba940cb42873d9326c9"
] | [
"VisModel/gains.py"
] | [
"\nimport numpy as np\nimport copy\n\nclass BaseGainModel(object):\n \n def __init__(self, uvd):\n \"\"\"\n Per-antenna complex gain model.\n \n Parameters\n ----------\n uvd : UVData object\n UVData object used to define metadata etc. \n \"\"\"\n ... | [
[
"numpy.unique",
"numpy.arange",
"numpy.almost_equal",
"numpy.ones",
"numpy.exp",
"numpy.array",
"numpy.where"
]
] |
archman/phantasy | [
"ac362cd3a80f7d1cfc68c0722f8a4aad504d1edd"
] | [
"phantasy/library/lattice/lattice.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Create high-level lattice object from machine configuration files.\n\"\"\"\nimport json\nimport logging\nimport numpy as np\nimport os\nimport shelve\nimport sys\nimport tempfile\nimport time\n\nfrom collections import OrderedDict\nfrom copy import deepcopy\n... | [
[
"numpy.dot",
"numpy.loadtxt"
]
] |
Rajathbharadwaj/pytorch-lightning | [
"89d0064b33a8a8e60177ccca4fc176333941db4d"
] | [
"pytorch_lightning/trainer/trainer.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.autograd.set_detect_anomaly",
"torch._C._log_api_usage_once",
"torch.set_grad_enabled",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
d29parkar/pyrsgis | [
"394ed2dc3f5c08c06e1b258bb12a71d30caf0966"
] | [
"pyrsgis/beta/__init__.py"
] | [
"# pyrsgis/beta\r\n\r\n#Importing all the necessary libraries\r\nimport os, glob, datetime\r\n# add exception for deprecated version of gdal\r\ntry:\r\n import gdal\r\nexcept:\r\n from osgeo import gdal\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.cm as cm\r\nimport numpy as np\r\nimport warnings, ... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.nan_to_num",
"matplotlib.pyplot.colorbar",
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.show",
"numpy.random.randint"
]
] |
ekkobit/avapi | [
"0dc83e7932ceda230dcb1b124366b5de4943832e"
] | [
"avapi/data.py"
] | [
"'''The data module contains fuctions to get data from Alpha Vantage into\npython. Data may be saved as csv files or loaded as Pandas data frames.\n'''\n\n__authors__ = \"Ole Olaussen, Xuan Ling\"\n__email__ = \"ole.olaussen@ekkobit.com, xuan.ling@ekkobit.com\"\n\n\nimport requests\nimport json\nimport pandas as pd... | [
[
"pandas.DataFrame"
]
] |
leeesangwon/CNN_sentence.pytorch | [
"512a1fe1de359f01557b6441a0571d7d98335716"
] | [
"src/data/__init__.py"
] | [
"import os\n\nimport torch\n\nimport constants as const\n\nfrom .cross_val_dataset import CrossValDataset, _CrossValDataset\nfrom .sst import SSTDataset\nfrom .trec import TRECDataset\n\nDATASETS = ('MR', 'Subj', 'CR', 'MPQA', 'SST1', 'SST2', 'TREC')\n\n\ndef get_datasets(dataset_type, dataset_folder, batch_size):\... | [
[
"torch.LongTensor"
]
] |
deep-diver/great_expectations | [
"9d85b7e0543d170e73df99dcc985c649a0f395bb"
] | [
"great_expectations/dataset/sparkdf_dataset.py"
] | [
"import copy\nimport inspect\nimport json\nimport logging\nimport warnings\nfrom collections import OrderedDict\nfrom datetime import datetime\nfrom functools import reduce, wraps\nfrom typing import List\n\nimport jsonschema\nimport numpy as np\nimport pandas as pd\nfrom dateutil.parser import parse\n\nfrom great_... | [
[
"numpy.mean",
"pandas.Index"
]
] |
pyccel/spl | [
"e3a799b6791807e71660dac72324b22593804cb6"
] | [
"psydac/core/tests/test_kernels.py"
] | [
"import numpy as np\nimport pytest\nimport os\nimport itertools as it\n\nfrom sympde.topology import Domain, ScalarFunctionSpace, Square, Cube\nfrom psydac.api.discretization import discretize\nfrom psydac.fem.basic import FemField\nfrom psydac.mapping.discrete import NurbsMapping\nfrom psydac.core.bsplines import ... | [
[
"numpy.dot",
"numpy.random.random",
"numpy.allclose",
"numpy.reshape",
"numpy.eye",
"numpy.ones",
"numpy.linalg.det",
"numpy.max",
"numpy.zeros_like",
"numpy.random.rand",
"numpy.moveaxis",
"numpy.array",
"numpy.zeros"
]
] |
MLVPRASAD/KaggleProjects | [
"379e062cf58d83ff57a456552bb956df68381fdd"
] | [
"11 microsoft software prediction/lightgbm-baseline-model-using-sparse-matrix.py"
] | [
"import pandas as pd\nimport numpy as np\nimport lightgbm as lgb\n#import xgboost as xgb\nfrom scipy.sparse import vstack, csr_matrix, save_npz, load_npz\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder\nfrom sklearn.model_selection import StratifiedKFold\n#from sklearn.metrics import roc_auc_score\ni... | [
[
"pandas.merge",
"pandas.read_csv",
"scipy.sparse.load_npz",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.model_selection.StratifiedKFold",
"scipy.sparse.csr_matrix",
"sklearn.preprocessing.LabelEncoder",
"scipy.sparse.save_npz",
"numpy.array",
"numpy.zeros"
]
] |
radiasoft/sirepo | [
"db3d1737bab7a84d39d456c0e8913c88deff3c31"
] | [
"sirepo/template/rs4pi.py"
] | [
"# -*- coding: utf-8 -*-\nu\"\"\"RS4PI execution template.\n\n:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.\n:license: http://www.apache.org/licenses/LICENSE-2.0.html\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\nfrom pykern.pkcollections import PKDict\nfrom pyke... | [
[
"numpy.log",
"numpy.histogram",
"numpy.linspace",
"numpy.min",
"numpy.flipud",
"numpy.ceil",
"numpy.max",
"numpy.iinfo",
"numpy.float32",
"numpy.floor",
"numpy.array",
"scipy.ndimage.interpolation.zoom"
]
] |
pepealessio/cr_pepper_shoppingbot | [
"8d1f500ef09b1064a03de2697886dbe37f921980"
] | [
"fp_audio/scripts/reidentification.py"
] | [
"#!/usr/bin/python3\n\nfrom config import *\nfrom datetime import datetime\nfrom fp_audio.srv import GetEmbedding, GetEmbeddingResponse, SetEmbedding, SetEmbeddingResponse, GetLabel, GetLabelResponse, NextLabel, NextLabelResponse\nfrom identification.deep_speaker.audio import get_mfcc\nfrom identification.deep_spea... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.unique"
]
] |
mfzhang1/Optical-Flow-in-the-Dark | [
"4449519730f284b832884fd1fe5f304e2e07ae70"
] | [
"VBOF_dataset/raw_to_rgb.py"
] | [
"from __future__ import absolute_import, division, print_function\nimport argparse,glob,rawpy,tqdm,os,cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nparser = argparse.ArgumentParser(description='Process RAW files in VBOF to RGB')\n\nparser.add_argument('--input_raw_path', default='./VBOF_rawdata/', h... | [
[
"numpy.expand_dims",
"numpy.maximum",
"numpy.minimum",
"numpy.min",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"numpy.zeros"
]
] |
intelligent-control-lab/Composable_Agent_Toolbox | [
"39d71cdc0475ae6901cb30b63d181737bea35889"
] | [
"env/base_world/agent.py"
] | [
"import numpy as np\nfrom abc import ABC, abstractmethod\n\nclass Agent(ABC):\n \n def __init__(self, name, spec, collision=True):\n self.name = name\n self._x = spec['init_x']\n self.collision = collision\n self.broadcast = {}\n\n @abstractmethod\n def forward(self):\n p... | [
[
"numpy.zeros",
"numpy.vstack"
]
] |
leduchuy225/HairNet | [
"2d3f0b82a686d2ccc7fee4429ef5925ffabd8982"
] | [
"src/train.py"
] | [
"import os\nimport time\nimport logging\nimport argparse\n\nimport torch\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\n\nfrom dataloader import HairNetDataset\nfrom model import Net, MyLoss, CollisionLoss, CurMSE, PosMSE\n\n\nlog = logging.getLogger(\"HairNet\")\nlogging.basicConfig(level=l... | [
[
"torch.device",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.StepLR"
]
] |
nolanstr/bingo_nolan_fork | [
"fad1547105d66fe91c58fb1c771af57cb26126c1"
] | [
"tests/performance_benchmarking/island_benchmarks.py"
] | [
"import timeit\n\nimport numpy as np\n\nfrom bingo.symbolic_regression.agraph.crossover import AGraphCrossover\nfrom bingo.symbolic_regression.agraph.mutation import AGraphMutation\nfrom bingo.symbolic_regression.agraph.generator import AGraphGenerator\nfrom bingo.symbolic_regression.agraph.component_generator \\\n... | [
[
"numpy.random.seed",
"numpy.linspace"
]
] |
ksekimoto/tensorflow | [
"d913cf12d0cca9823cf740a3ccfd2decb963f086"
] | [
"tensorflow/python/data/experimental/ops/readers.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.data.ops.dataset_ops.MapDataset",
"tensorflow.python.framework.dtypes.int64.as_numpy_dtype",
"tensorflow.python.ops.gen_experimental_dataset_ops.sql_dataset",
"tensorflow.python.data.ops.dataset_ops.get_legacy_output_types",
"tensorflow.python.framework.dtypes.int32.as_numpy... |
mihikagaonkar/book-recommender-system | [
"c171f2e25018ed1c7c45ae9d62846a0823fa147e"
] | [
"database.py"
] | [
"import sqlite3\nimport pandas as pd\n\nconn = sqlite3.connect('books.db')\nc = conn.cursor()\ntiles = pd.read_csv('Titles.csv')\ntiles.to_sql('titles', conn, if_exists='append', index = False, chunksize = 1000)"
] | [
[
"pandas.read_csv"
]
] |
Rock-100/MonoDet | [
"fd50fc9f93a37cf435d3395bf85d8af85cdab5c9"
] | [
"detectron2/utils/env.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport importlib\nimport importlib.util\nimport logging\nimport numpy as np\nimport os\nimport random\nimport sys\nfrom datetime import datetime\nimport torch\n\n__all__ = [\"seed_all_rng\"]\n\n\nTORCH_VERSION = tuple(int(x) for x in torch.__v... | [
[
"torch.manual_seed",
"torch.__version__.split",
"numpy.random.seed"
]
] |
MaxOSmith/benri | [
"ef3333adc8f4c5680b8f5a8cac225eb25bb713fa"
] | [
"benri/gym/observation.py"
] | [
"\"\"\" Utility functions for observation spaces. \"\"\"\nfrom collections import defaultdict\nimport copy\nimport operator\n\nimport numpy as np\n\nimport benri.dict as dict_ops\n\n\ndef select_from_batch(observation, batch_i):\n \"\"\"\n\n :param observations: List of observations. \n :return:\n \"\"\... | [
[
"numpy.expand_dims",
"numpy.ones_like",
"numpy.tile",
"numpy.all",
"numpy.zeros"
]
] |
RuiHirano/distributed-dreamerv2 | [
"243b94d1cbecc6fc7cc91bb032d8a5d4e35ddb23"
] | [
"dreamerv2/expl2.py"
] | [
"import tensorflow as tf\nfrom tensorflow_probability import distributions as tfd\n\nimport learner_actor\nimport common\n\n\nclass Random(common.Module):\n\n def __init__(self, config, act_space, wm, reward):\n self.config = config\n self.act_space = self.act_space\n\n def actor(self, feat):\n shape = f... | [
[
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.ones",
"tensorflow.math.log",
"tensorflow.stop_gradient",
"tensorflow.tensor",
"tensorflow.GradientTape"
]
] |
MichiganCOG/Surgical_Hands_RELEASE | [
"a66bdcf4953ef4b03eb8907d833c68b436f07c20"
] | [
"models/flowtrack/flowtrack.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\... | [
[
"torch.nn.Sequential",
"torch.nn.AdaptiveMaxPool2d",
"torch.nn.ConvTranspose2d",
"torch.load",
"torch.nn.init.constant_",
"numpy.arange",
"torch.nn.Conv2d",
"numpy.tile",
"torch.from_numpy",
"numpy.concatenate",
"torch.nn.MaxPool2d",
"torch.flatten",
"torch.nn.i... |
rishabhbhardwaj15/identify-referred-object-in-image | [
"7641464008005cdbf5191f6265164e204b5cdf5c"
] | [
"code_to_train/anchors.py"
] | [
"\"\"\"\nCreates anchor based on the backbone\nBased on code from https://github.com/fastai/fastai_docs/blob/master/dev_nb/102a_coco.ipynb\nAuthor: Arka Sadhu\n\"\"\"\nimport torch\nimport numpy as np\nfrom torch import nn\n\n\ndef cthw2tlbr(boxes):\n \"Convert center/size format `boxes` to top/left bottom/right... | [
[
"torch.linspace",
"torch.ones",
"torch.max",
"numpy.sqrt",
"torch.cat",
"torch.min",
"torch.tensor",
"torch.exp",
"torch.FloatTensor",
"torch.log",
"torch.device",
"torch.clamp"
]
] |
redjerdai/iseeyourcarm8 | [
"acdad0ba2a963e47f0305b801a0418cf0b3e1548"
] | [
"compare.py"
] | [
"#\nimport sys\nimport pandas\nfrom pyxdameraulevenshtein import normalized_damerau_levenshtein_distance\n\n\n#\nfrom compare_funcs_im import deepai_im_cmp, tf_mobilenet_im_cmp\n\n\n#\ncmp_im, cmp_code = sys.argv[1], sys.argv[2]\nim0, im1 = sys.argv[3], sys.argv[4]\ncode0, code1 = sys.argv[5], sys.argv[6]\n\nif cmp... | [
[
"pandas.DataFrame"
]
] |
huangzh13/ReID.template.pytorch | [
"34ce8318bbd35db5a21e0914b429a71a4ea26998"
] | [
"models/losses/triplet.py"
] | [
"\"\"\"\n-------------------------------------------------\n File Name: triplet.py\n Author: Zhonghao Huang\n Date: 2019/9/10\n Description:\n-------------------------------------------------\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\n\ndef topk_mask(input, dim, K=10, **kwargs):\n ... | [
[
"torch.nn.MarginRankingLoss",
"torch.norm",
"torch.set_printoptions",
"torch.zeros_like",
"torch.nn.SoftMarginLoss",
"torch.arange",
"torch.pow"
]
] |
Shen-Lab/GraphCL | [
"d857849d51bb168568267e07007c0b0c8bb6d869"
] | [
"semisupervised_MNIST_CIFAR10/pre-training/train/aug.py"
] | [
"import torch\nimport torch.nn as nn\nimport dgl\nfrom random import randint\nimport random\nimport copy\nimport pdb\nimport numpy as np\nfrom collections import Counter\n\n\n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\ndouble\n''''''''''''''... | [
[
"torch.sigmoid",
"torch.randint",
"torch.cat",
"torch.randn",
"torch.zeros_like",
"torch.FloatTensor",
"torch.arange",
"matplotlib.pyplot.show"
]
] |
jjeamin/sleep | [
"c38ee3ef51405ae7ebd49b833c4cec9c6132f320"
] | [
"encoding_test.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport itertools\r\nfrom tqdm import tqdm\r\nimport torch\r\nimport torch.nn as nn\r\nimport torchvision.transforms as transforms\r\nimport argparse\r\nfrom tqdm import tqdm\r\nfrom med import resnet18\r\nfrom med.utils import make_weights_for_balanced_class... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tight_layout",
"torch.max",
"matplotlib.pyplot.title",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.colorbar",
... |
wkcn/mobula | [
"4eec938d6477776f5f2d68bcf41de83fb8da5195"
] | [
"tests/test_layers/test_softmax.py"
] | [
"import mobula.layers as L\nfrom mobula.testing import gradcheck\nfrom mobula.layers.utils.Defines import *\nimport numpy as np\n\ndef test_softmax():\n N, C, H, W = 2,3,4,5\n a = np.random.random((N, C, H, W)) - 0.5\n for axis in range(4):\n l = L.Softmax(a, axis = axis)\n label = np.random.... | [
[
"numpy.random.random",
"numpy.allclose",
"numpy.ones",
"numpy.exp",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
larrybradley/statmorph | [
"3e6d01a031fbe4518999f966ff08b3670f7a19f9"
] | [
"statmorph/utils/image_diagnostics.py"
] | [
"\"\"\"\nThis file defines the `make_figure` function, which can be useful for\ndebugging and/or examining the morphology of a source in detail.\n\"\"\"\n# Author: Vicente Rodriguez-Gomez <v.rodriguez@irya.unam.mx>\n# Licensed under a 3-Clause BSD License.\n\nimport numpy as np\nimport warnings\nimport time\nimport... | [
[
"matplotlib.colors.NoNorm",
"numpy.linspace",
"numpy.min",
"matplotlib.use",
"numpy.cos",
"numpy.sin",
"numpy.max",
"numpy.random.normal",
"matplotlib.colors.ListedColormap",
"numpy.float64",
"numpy.floor",
"numpy.array",
"numpy.where",
"matplotlib.pyplot.fi... |
ROCmSoftwarePlatform/tensorflow-upstream | [
"8bd1e3fcaee378945b11c96ed1474d8b890232fc"
] | [
"tensorflow/python/kernel_tests/reduction_ops_test.py"
] | [
"# Copyright 2015 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... | [
[
"numpy.amax",
"tensorflow.python.ops.gradient_checker.compute_gradient",
"tensorflow.python.ops.math_ops.reduce_max",
"numpy.asarray",
"numpy.issubdtype",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.python.ops.variables.Variable",
"numpy.all",
"tensorflow.python.... |
meteahishali/CycleGAN-Tensorflow-2 | [
"11f49e812aa6144d89229a86df9fa7432aeef9aa"
] | [
"tf2lib/utils/utils.py"
] | [
"import tensorflow as tf\n\n\nclass Checkpoint:\n \"\"\"Enhanced \"tf.train.Checkpoint\".\"\"\"\n\n def __init__(self,\n checkpoint_kwargs, # for \"tf.train.Checkpoint\"\n directory, # for \"tf.train.CheckpointManager\"\n max_to_keep=5,\n keep_... | [
[
"tensorflow.train.CheckpointManager",
"tensorflow.math.reduce_min",
"tensorflow.math.zero_fraction",
"tensorflow.math.reduce_max",
"tensorflow.train.Checkpoint",
"tensorflow.math.reduce_mean",
"tensorflow.math.reduce_std",
"tensorflow.name_scope",
"tensorflow.summary.scalar",
... |
MeRajat/modeldb | [
"3cf07d8292ab73016e72ac8e24d4b69938407c18"
] | [
"client/python/samples/sklearn/OttoGroup-Calibration.py"
] | [
"\"\"\"\nSource: https://www.kaggle.com/cbourguignat/otto-group-product-classification-challenge/why-calibration-works\n\"\"\"\nimport os\nimport unittest\nimport argparse\nimport pandas as pd\nimport sklearn\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.cross_validation import train_test_split\nfro... | [
[
"sklearn.ensemble.BaggingClassifier",
"sklearn.ensemble.RandomForestClassifier",
"pandas.read_csv_sync",
"sklearn.calibration.CalibratedClassifierCV",
"sklearn.preprocessing.LabelEncoder"
]
] |
Magic-Bubble/espnet | [
"5fb4077226bd62c71ec39ce5e5510552f1a05de0"
] | [
"espnet/nets/chainer_backend/e2e_asr_transformer.py"
] | [
"# encoding: utf-8\nfrom distutils.util import strtobool\nimport logging\nimport math\nimport numpy as np\n\nimport chainer\nfrom chainer import reporter\n\nimport chainer.functions as F\nfrom chainer.training import extension\n\nfrom espnet.asr import asr_utils\nfrom espnet.nets.asr_interface import ASRInterface\n... | [
[
"matplotlib.pyplot.clf",
"numpy.where",
"numpy.argmax",
"numpy.finfo"
]
] |
Tom-Davidson/logLikelihood | [
"c13ed39245c24bc74932e292151f76a084618e17"
] | [
"loglikelihood/__init__.py"
] | [
"\"\"\"\nA library for python to implement the 'Log Likelihood'\nand 'Root Log Likelihood' algorithms.\nYou most likely need to just:\n import loglikelihood\n ...\n loglikelihood.llr(numpy.matrix([[k11, k12], [k21, k22]]))\n\"\"\"\n\nimport math\nimport numpy\n\n\ndef entropymatrix(elements):\n \"\"\"Ca... | [
[
"numpy.ndenumerate"
]
] |
kepei1106/cotk | [
"29b25b9469468dfd6d2aba433c2b935831351de7"
] | [
"tests/dataloader/test_single_turn_dialog.py"
] | [
"import copy\n\nimport pytest\nfrom pytest_mock import mocker\nimport random\nimport operator\nfrom cotk.dataloader import SingleTurnDialog, OpenSubtitles\nfrom cotk.metric import MetricBase\n\nfrom version_test_base import base_test_version\n\n\ndef setup_module():\n\timport random\n\trandom.seed(0)\n\timport nump... | [
[
"numpy.random.seed"
]
] |
jimgoo/auto-sklearn | [
"a263efb49f7b7f597963bc1e787105ea7615ea75"
] | [
"setup.py"
] | [
"# -*- encoding: utf-8 -*-\nimport setuptools\nfrom setuptools.extension import Extension\nimport numpy as np\nfrom Cython.Build import cythonize\n\nextensions = cythonize(\n [Extension('autosklearn.data.competition_c_functions',\n sources=['autosklearn/data/competition_c_functions.pyx'],\n ... | [
[
"numpy.get_include"
]
] |
michaelcukier/Poker-Hand-Tracker | [
"9adae42fab9f640e6939ba06bd588ab1a2feb90f"
] | [
"db_api/plots/player_range.py"
] | [
"from GLOBAL_VARIABLES import FOLDER_PLOT_DUMP, PLAYER_NAME\nimport matplotlib.pyplot as plt\nfrom matplotlib import rcParams\nimport pandas as pd\nimport seaborn as sns\nfrom utils.run_sql_command import run_sql_command\n\n\nhand_matrix = [\n ['AA', 'AKs', 'AQs', 'AJs', 'ATs', 'A9s', 'A8s', 'A7s', 'A6s', 'A5s',... | [
[
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.figure"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.