repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
egao1980/pandas
[ "a3abb9eb7822e7bb9c1bc03181f05d40377fc628" ]
[ "pandas/tests/internals/test_internals.py" ]
[ "# -*- coding: utf-8 -*-\n# pylint: disable=W0102\n\nfrom datetime import datetime, date\nimport operator\nimport sys\nimport pytest\nimport numpy as np\n\nimport re\nfrom distutils.version import LooseVersion\nimport itertools\nfrom pandas import (Index, MultiIndex, DataFrame, DatetimeIndex,\n S...
[ [ "pandas.Series", "numpy.take", "numpy.asarray", "pandas.util.testing.assert_produces_warning", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.dtype", "pandas.util.testing.assert_index_equal", "pandas.core.internals.BlockPlacement", "pandas.util.testing.round_tr...
jdngibson/CanFlood
[ "37f738be6944ea6b68dfcffeee6b6ac6ff7eb8a0" ]
[ "canflood/model/sofda/scripts.py" ]
[ "'''\nCreated on Jun 11, 2018\n\n@author: cef\n'''\n#===============================================================================\n# HIERARCHY and RUN LOOPS --------------------------------------------------------------\n#===============================================================================\n'''\nsee d...
[ [ "pandas.concat", "pandas.merge", "pandas.Series", "pandas.DataFrame", "numpy.any", "numpy.array" ] ]
PRECISE/ROSLab
[ "2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d" ]
[ "resources/mechanics_lib/api/graphs/transforms.py" ]
[ "import numpy as np\nfrom api.symbolic import LinearExpr\n\n\ndef MirrorX():\n return np.diag([-1, 1, 1, 1])\n\ndef MirrorY():\n return np.diag([1, -1, 1, 1])\n\ndef Scale(scale):\n return np.diag([scale, scale, scale, 1])\n\ndef RotateX(angle):\n r = np.array([[1, 0, 0, 0],\n [0, np.cos(angle), ...
[ [ "numpy.diag", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.array" ] ]
finkbeiner-lab/cellpose
[ "ec859343f61988806093d65d0d6172f22596e9e7" ]
[ "cellpose/io.py" ]
[ "import os, datetime, gc, warnings, glob\nfrom natsort import natsorted\nimport numpy as np\nimport cv2\nimport tifffile\nimport logging, pathlib, sys\nfrom pathlib import Path\n\nfrom . import utils, plot, transforms\n\ntry:\n from PyQt5 import QtGui, QtCore, Qt, QtWidgets\n GUI = True\nexcept:\n GUI = Fa...
[ [ "numpy.nonzero", "numpy.clip", "numpy.concatenate", "matplotlib.pyplot.close", "numpy.transpose", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
youyexie/Learning-To-Find-Good-Correspondences-Of-Multiple-Objects
[ "01df2bd8448486fe417d4e014706e89144ba6224" ]
[ "Simulation/FaceClassifier/model_multiObject.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Youye\r\n\"\"\"\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\n\r\n#%% Define the ResNet block\r\n\r\nclass ResNetBlock(nn.Module):\r\n \r\n def __init__(self,inter_channel = 128):\r\n \r\n super(ResNetBlock, ...
[ [ "torch.nn.Sequential", "torch.nn.LogSoftmax", "torch.nn.Conv2d", "torch.tanh", "torch.nn.functional.relu", "torch.nn.InstanceNorm2d", "torch.nn.BatchNorm2d" ] ]
kunalsharma05/cclib
[ "6976824bcbf810ecd3e7f3dc25c4b6910c1e3b56" ]
[ "cclib/parser/daltonparser.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2017, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\n\"\"\"Parser for DALTON output files\"\"\"\n\n\nfrom __future__ import print_function\n\nimport numpy\n\nfrom ...
[ [ "numpy.array", "numpy.zeros", "numpy.empty" ] ]
shubham1206agra/pretrained-models.pytorch
[ "a2940f79dd65656eabe5a0cd6d5d014ef1fc2523" ]
[ "pretrainedmodels/models/xception.py" ]
[ "\"\"\"\nPorted to pytorch thanks to [tstandley](https://github.com/tstandley/Xception-PyTorch)\n\n@author: tstandley\nAdapted by cadene\n\nCreates an Xception Model as defined in:\n\nFrancois Chollet\nXception: Deep Learning with Depthwise Separable Convolutions\nhttps://arxiv.org/pdf/1610.02357.pdf\n\nThis weight...
[ [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url" ] ]
mezzX/Connect4-AlphaZero
[ "68aed3f77f939a8c93d0e3a5c3251312258877b7" ]
[ "mcts.py" ]
[ "import torch\r\nfrom copy import copy\r\nimport math\r\nimport random\r\n\r\nc = 1.0\r\n\r\n# transformations\r\nt0 = lambda x: x\r\nt1 = lambda x: x[:, ::-1].copy()\r\nt2 = lambda x: x[::-1, :].copy()\r\nt3 = lambda x: x[::-1, ::-1].copy()\r\nt4 = lambda x: x.T\r\nt5 = lambda x: x[:, ::-1].T.copy()\r\nt6 = lambda...
[ [ "torch.sum", "torch.cuda.is_available", "torch.tensor" ] ]
jingyi7777/CasRx_guide_efficiency
[ "c9e900e4c4a73215f09852bd621b30e8dcb039e8" ]
[ "models/Deep-learning/models/guide_all_cnn_hyp_ninef_classi_model.py" ]
[ "import tensorflow as tf\nfrom kerastuner import HyperParameters\nfrom tensorflow import keras\n\nfrom models.layers import recurrent_dense, strided_down, encoder_down_block\n\n\ndef guide_all_cnn_hyp_ninef_classi_model(num_strided_down=4,kernel=5,cnn_units=128, dense_units=128, recurrent_layers=8, noise=True):\n ...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.Input", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.keras.layers.GaussianNoise", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Flatten" ] ]
NCAR/dash-eol-prod
[ "4269454dbd67e470f789d556ecdffc7ccdb270c7" ]
[ "actions/CGD/create_plots.py" ]
[ "#---------------------------------------------------\n# This code will take CSV files and plot graphs\n# representing EMDAC Metadata completeness scores\n#\n# Before running, edit the text in \n# input_directory and output_directory statements\n# after the import section. All *.csv files should\n# be located in th...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
keshavashiya/Machine-Learning-with-Python
[ "fb1d08c7e4499c255c9cce5abcec9b1e18b1a1ec" ]
[ "k_nearest_neighbors/utils.py" ]
[ "import random\nfrom collections import Counter\n\nimport matplotlib.pyplot as plt\n\nfrom helpers.linear_algebra import distance\nfrom k_nearest_neighbors.data import cities\n\n\ndef raw_majority_vote(labels):\n votes = Counter(labels)\n winner, _ = votes.most_common(1)[0]\n return winner\n\n\ndef majorit...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.axis", "matplotlib.pyplot.show" ] ]
irenecortinovis/madminer
[ "2f7afd9698861d37483d7a62388e8962ee535d02" ]
[ "madminer/utils/interfaces/delphes_root.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\nimport six\n\nimport numpy as np\nfrom collections import OrderedDict\nimport uproot\nimport os\nimport logging\nimport itertools\n\n\nfrom madminer.utils.particle import MadMinerParticle\nfrom madminer.utils.various import math_co...
[ [ "numpy.ones_like", "numpy.isfinite", "numpy.invert", "numpy.logical_and", "numpy.concatenate", "numpy.argsort", "numpy.array", "numpy.sum" ] ]
Yard1/lightgbm_ray
[ "234e809f2903c8f55d34a88aebd7a232a1e7337f" ]
[ "lightgbm_ray/tests/test_tune.py" ]
[ "import os\nimport shutil\nimport tempfile\nimport unittest\nfrom unittest.mock import patch\n\nimport numpy as np\n\nimport ray\nfrom ray import tune\ntry:\n from ray.tune.integration.lightgbm import \\\n TuneReportCallback as OrigTuneReportCallback, \\\n TuneReportCheckpointCallback as OrigTuneRe...
[ [ "numpy.array" ] ]
SumitM0432/Explicit-Content-Classifier-using-ResNet
[ "2a5de322b018afd5fa32b461704f3e9f1ac44a45" ]
[ "engine.py" ]
[ "import torch\nfrom tqdm import tqdm\nfrom time import time\n\ndef training_func(model, train_dataloader, val_dataloader, epochs, device, optimizer, criterion):\n # Training the model\n train_losses, val_losses = [], []\n steps = 0\n for epoch in tqdm(range(epochs)):\n \n # Taking the aver...
[ [ "torch.no_grad", "torch.max" ] ]
GregoryEHunter/generalization_to_OOD_category_viewpoint_combinations
[ "52aacbb3420639cae64ce65085c17b245e5ef865" ]
[ "res/models/LONG_DECODER_COMBINED.py" ]
[ "import torch\nimport torch.nn as nn\n\n\ndef conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=dilation, groups=groups, bias=False, dilation=dilation)...
[ [ "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.flatten", "torch.nn.ReLU", "torch.nn.init.kaiming_normal_" ] ]
xmyqsh/fvcore
[ "364d1bb6f1ac66368dff710dee491422b8569695" ]
[ "tests/test_transform.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport itertools\nimport numpy as np\nimport unittest\nfrom typing import Any, Tuple\nfrom PIL import Image\n\nfrom fvcore.transforms import transform as T\n\n\n# pyre-ignore-all-errors\nclass TestTransforms(unittest...
[ [ "numpy.allclose", "numpy.random.seed", "numpy.clip", "numpy.asarray", "numpy.linspace", "numpy.tile", "numpy.ones", "numpy.random.rand", "numpy.repeat" ] ]
homomorfism/wise-programming
[ "e0589e8900237ddc9c3abf54c85be532cacf2d33", "e0589e8900237ddc9c3abf54c85be532cacf2d33" ]
[ "src/emotion_predictor/face_detection/yolov5_face/test.py", "src/emotion_predictor/emotion_analysis/classifier.py" ]
[ "import argparse\nimport json\nimport os\nfrom pathlib import Path\nfrom threading import Thread\n\nimport numpy as np\nimport torch\nimport yaml\nfrom tqdm import tqdm\n\nfrom models.experimental import attempt_load\nfrom utils.datasets import create_dataloader\nfrom utils.general import coco80_to_coco91_class, ch...
[ [ "torch.linspace", "torch.Tensor", "torch.zeros", "torch.cat", "torch.tensor", "numpy.concatenate", "torch.unique", "torch.no_grad", "numpy.savetxt", "numpy.zeros" ], [ "scipy.special.softmax" ] ]
xiangsheng1325/CPGAN
[ "f05d7183a28601d5af849229766ddaf1e4c5cba8" ]
[ "CPGAN/models.py" ]
[ "from torch import nn\nimport torch\nfrom torch.nn.parameter import Parameter\nimport torch.nn.functional as F\nfrom torch.nn.modules.module import Module\nimport math\nimport copy\n# from CPGAN.data_utils import timelog\n# from torch_geometric.nn.conv.gat_conv import GATConv\n\nclass GraphAttnMultiHead(Module):\n ...
[ [ "torch.nn.Softmax", "torch.nn.functional.softmax", "torch.cat", "torch.zeros", "torch.nn.GRU", "torch.FloatTensor", "torch.pow", "torch.nn.init.calculate_gain", "torch.Size", "torch.mm", "torch.randn", "numpy.stack", "torch.nn.Sigmoid", "torch.tensor", "...
huangch/PyCudaSampling
[ "a806956409b69871f49a3009beb99ec400b6cf5b" ]
[ "setup.py" ]
[ "import os\nimport pathlib\nfrom os.path import join as pjoin\nfrom setuptools import setup, Extension\nfrom setuptools.command.build_ext import build_ext\nimport shutil\n\ndef find_in_path(name, path):\n \"\"\"Find a file in a search path\"\"\"\n\n # Adapted fom http://code.activestate.com/recipes/52224\n ...
[ [ "numpy.get_include" ] ]
qxcheng/fasterrcnn-pytorch-comments
[ "05da4526fc29e7179017bc5cc00b2d602c2f2327" ]
[ "model/faster_rcnn_vgg16.py" ]
[ "from __future__ import absolute_import\nimport torch as t\nfrom torch import nn\nfrom torchvision.models import vgg16\n\nfrom model.region_proposal_network import RegionProposalNetwork\nfrom model.faster_rcnn import FasterRCNN\nfrom model.roi_module import RoIPooling2D\nfrom utils import array_tool as at\nfrom ut...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.load", "torch.cat" ] ]
sachinpro/sachinpro.github.io
[ "c3bbd8d89818f5d8bb7296c851ed5e52c19728e3" ]
[ "tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py" ]
[ "# pylint: disable=g-bad-file-header\n# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/l...
[ [ "tensorflow.python.ops.nn.softmax", "tensorflow.contrib.metrics.streaming_auc", "tensorflow.python.ops.state_ops.assign_add", "tensorflow.python.ops.logging_ops.scalar_summary", "tensorflow.python.ops.logging_ops.histogram_summary", "tensorflow.python.ops.nn.zero_fraction", "tensorflow...
cabrust/chia
[ "3eaf815b261dc8a85d64fd698e0079515ec0dde9" ]
[ "chia/components/base_models/keras/keras_featureextractor.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.applications import (\n inception_resnet_v2,\n mobilenet_v2,\n nasnet,\n resnet_v2,\n)\n\nfrom chia import components, helpers, instrumentation\n\n\nclass KerasFeatureExtractor(instrumentation.Observable):\n def __init__(\n self,\n side_le...
[ [ "tensorflow.keras.regularizers.l2", "tensorflow.keras.applications.mobilenet_v2.MobileNetV2", "tensorflow.keras.applications.resnet_v2.ResNet50V2", "tensorflow.keras.applications.inception_resnet_v2.InceptionResNetV2", "tensorflow.keras.applications.nasnet.NASNetMobile" ] ]
amrishAK/-DeviceSimulation
[ "aa06359a8a3fc1e728dc55eda6450f77ada2b309" ]
[ "Characteristics/bokeh visuals amrish.py" ]
[ "import json\nimport pandas as pd\nfrom pandas.io.json import json_normalize\nimport numpy as np\n\nfrom bokeh.io import output_file, output_notebook, save\nfrom bokeh.plotting import figure, show\nfrom bokeh.models import ColumnDataSource, LabelSet\nfrom bokeh.layouts import row, column, gridplot\nfrom bokeh.model...
[ [ "pandas.io.json.json_normalize" ] ]
nickeener/starfish
[ "7f74fb9143661929b6614b6f46b3521faa24cdaf" ]
[ "starfish/core/spots/DecodeSpots/check_all_decoder.py" ]
[ "from copy import deepcopy\nfrom typing import Any, Hashable, Mapping, Tuple\n\nimport numpy as np\nimport pandas as pd\n\nfrom starfish.core.codebook.codebook import Codebook\nfrom starfish.core.intensity_table.decoded_intensity_table import DecodedIntensityTable\nfrom starfish.core.intensity_table.intensity_table...
[ [ "numpy.asarray", "pandas.DataFrame" ] ]
mrlucasrib/inteligencia-artificial-ufop
[ "f6ce14267c56b61e1c3e6d40e7da9a937427e102" ]
[ "lesson2/main.py" ]
[ "from dataclasses import dataclass, field\nimport numpy as np\nfrom utils.definitions import ABCAgent, ABCEnvironment\nfrom scipy.spatial import distance\n\n\nclass Environment(ABCEnvironment):\n\n def __init__(self, map, start, goal):\n self.map = np.array(map)\n self.start = np.array(start)\n ...
[ [ "numpy.array", "scipy.spatial.distance.euclidean" ] ]
ErikNoren92/Exjobb
[ "eb4b36d2241043a7b81f6bf9ff5596176aebcd27" ]
[ "segmentering/plotData.py" ]
[ "import numpy as np\nfrom vispy import scene, visuals, app, gloo\nimport matplotlib.pyplot as plt\nimport sys\n#import nn\n\n\npointCloud = []\ninputFile = open(\"set2.pcd\",\"r\")\nfor line in inputFile:\n\ttry:\n\t\tfloats=[float(x) for x in line.split(\" \")]\n\t\t#if floats[2]>groundLevel and floats[0] < 40 and...
[ [ "numpy.asarray", "numpy.array" ] ]
fmckenna/BRAILS
[ "cdd4ca4bbc50cbf58f03877b46f1b3d10a281204" ]
[ "brails/modules/Year_Built_Classifier/train.py" ]
[ "'''\n@author: Sascha Hornauer\nThis code is a heavily modified but based on Progressive Multi-Granularity Training of\nDu, Ruoyi and Chang, Dongliang and Bhunia, Ayan Kumar and Xie, Jiyang and Song, Yi-Zhe and Ma, Zhanyu and Guo, Jun\n\nSee the LICENSE file for further citation information\n'''\n\nfrom __future__ ...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.LogSoftmax", "torch.nn.KLDivLoss", "torch.max", "torch.load", "torch.utils.data.DataLoader", "torch.autograd.variable.Variable", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.array" ] ]
Ynakatsuka/kaggle_utils
[ "a23b62745bd7881e1a91c74e17612189d1f08784" ]
[ "kaggle_utils/features/text.py" ]
[ "import os\n\nfrom gensim.models.doc2vec import Doc2Vec, TaggedDocument\nimport nltk\nimport numpy as np\nimport pandas as pd\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.decomposition import TruncatedSVD\nfrom sklearn.feature_extraction.text import CountVectorizer\nimport tensorflow_hub ...
[ [ "sklearn.decomposition.TruncatedSVD", "pandas.concat", "numpy.log", "numpy.min", "numpy.asarray", "numpy.issubdtype", "tensorflow.keras.preprocessing.text.text_to_word_sequence", "numpy.median", "pandas.DataFrame", "numpy.concatenate", "sklearn.feature_extraction.text.C...
almostdutch/image-denoising-algorithms
[ "1db3c71b32ada71b5613b5692e5d1233bb31afa3" ]
[ "utils/conjugate_gradient_algorithm_fft.py" ]
[ "\"\"\"\nconjugate_gradient_algorithm_fft.py\n\nReturns the minimizer of the function in the frequency domain\nX0 - initial guess\nfunc - anonimous function\nfunc_grad - anonimous function gradient\nfunc_hessian - anonimous function hessian\n\"\"\"\n\nimport numpy as np\nfrom image_restoration_utils import CapInten...
[ [ "numpy.max", "numpy.zeros", "numpy.conj", "numpy.linalg.norm" ] ]
ALEX95GOGO/nnunet_bottleneck_github
[ "75349f0fc541fd260d2e498e87bd53325a576f67" ]
[ "nnunet/training/network_training/nnUNetTrainerV2_DP.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ...
[ [ "torch.cuda.is_available", "torch.cuda.amp.autocast" ] ]
Akinduko/ml-task
[ "fc62b779656e83c0489b13628063a5f426c6551e" ]
[ "server/utils/train_model.py" ]
[ "import os\nimport sys\n#import json\nimport logging\nimport math\nfrom keras.callbacks import EarlyStopping\n\nimport keras\nimport numpy as np\nimport tensorflow as tf\n\nfrom keras.models import load_model\n\nfrom keras.preprocessing import image\nfrom keras.preprocessing.image import ImageDataGenerator\n\nfrom ...
[ [ "tensorflow.ConfigProto", "numpy.vstack", "numpy.expand_dims", "tensorflow.Session" ] ]
NarnePranay/Movie-genre-prediction-model
[ "ac3d119e89534500a42ca92b53c41d5e7e2dbe12" ]
[ "tension_measuring/textclassify.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Dec 1 05:20:35 2018\n\n@author: Half_BlooD PrincE\n\"\"\"\n\nfrom sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn import decomposition,...
[ [ "sklearn.naive_bayes.MultinomialNB", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.preprocessing.LabelEncoder", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.metrics.accuracy_score" ] ]
zoeleeee/mnist_challenge
[ "8a98f7dde35ee1d7a1fb77e85ca931000fb71631" ]
[ "keras_rnd_multi_eval.py" ]
[ "#CUDA_VISIBLE_DEVICES=0 python keras_rnd_multi_eval.py 0.9 window 16 1 100 0 4 configs/\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport math\nimport os\nimport sys\nimport time\n\nimport tensorflow as tf\nfrom tensorflow impor...
[ [ "numpy.hstack", "tensorflow.nn.softmax", "tensorflow.nn.sigmoid", "numpy.absolute", "numpy.min", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.losses.BinaryCrossentropy", "numpy.max", "numpy.argmax", "numpy.mean", "numpy.load", "numpy.re...
tianyu-lu/torchsde
[ "187a05d7615d910d362ddf013ea4039338af76e5" ]
[ "diagnostics/stratonovich_additive.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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "torch.set_default_dtype", "torch.linspace", "torch.cuda.is_available", "torch.full" ] ]
flydream0428/GPy
[ "111727e139dee0812a596304774779929c42c77d" ]
[ "GPy/examples/classification.py" ]
[ "# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\"\"\"\nGaussian Processes classification examples\n\"\"\"\nMPL_AVAILABLE = True\ntry:\n import matplotlib.pyplot as plt\nexcept ImportError:\n MPL_AVAILABLE = False\n\nimport GPy\n\ndefaul...
[ [ "numpy.random.uniform", "matplotlib.pyplot.subplots" ] ]
rishabh-16/CS231N-assignments
[ "7f73e754e185213f75598257fd86172219215375" ]
[ "assignment3/cs231n/classifiers/rnn.py" ]
[ "from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.rnn_layers import *\n\n\nclass CaptioningRNN(object):\n \"\"\"\n A CaptioningRNN produces captions from image features using a recurrent\n neural network.\n\n The RNN receives input v...
[ [ "numpy.sqrt", "numpy.ones", "numpy.zeros_like", "numpy.random.randn", "numpy.zeros" ] ]
walkevin/ParallelTopologicalSorting
[ "d2da5f8ae99a49b130a2a91429c63da90e0083ff" ]
[ "measurements/plotscripts/helper.py" ]
[ "############### Color#############################################################\nimport numpy as np\nimport scipy as sp\nimport scipy.stats\nimport sqlite3\n\nmyFGcolors = [\t(0,0,200), (0,200,0), (200,0,0), \\\n\t\t\t\t(200,0,200), (0,200,200), (200,200,0), \\\n\t\t\t\t(100,100,200), (100,200,100), (200,100,10...
[ [ "numpy.median", "numpy.array", "numpy.percentile", "numpy.min" ] ]
jb-leger/assignator
[ "6047e739b0a65be8aa0f8f685b1b20f5a0622f81" ]
[ "assignator/_cli.py" ]
[ "# Copyright 2020, Jean-Benoist Leger <jb@leger.tf>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, m...
[ [ "numpy.array", "numpy.ones" ] ]
tyunist/Kaggle_PKU_Baidu
[ "48651d8a0fc8a7beda0822a2db794861feada7c6" ]
[ "demo/duplication_check.py" ]
[ "\"\"\"\r\nThis is to example how many images are duplicated in the test train ApolloScape 3D set:\r\nhttps://github.com/idealo/imagededup\r\nPHash: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html\r\n\"\"\"\r\nimport os\r\nimport matplotlib.pylab as plt\r\nimport imagededupSt\r\nfrom im...
[ [ "matplotlib.pylab.figure" ] ]
amznero/pandas
[ "7d4757b4deb851bb44ab6bb20cdc404fa13fffcf" ]
[ "pandas/tests/reshape/concat/test_append.py" ]
[ "import datetime as dt\nfrom datetime import datetime\nfrom itertools import combinations\n\nimport dateutil\nimport numpy as np\nimport pytest\n\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n DataFrame,\n Index,\n Series,\n Timestamp,\n concat,\n isna,\n...
[ [ "numpy.array", "pandas._testing.assert_almost_equal", "pandas._testing.assert_produces_warning", "pandas.Series", "pandas.RangeIndex", "pandas.array", "pandas.Index", "pandas.DataFrame", "pandas.IntervalIndex.from_breaks", "numpy.concatenate", "numpy.timedelta64", "...
ishine/pnf-sampling
[ "d92a6b82c2abd8ce26aae6a470cd78f686c7282a" ]
[ "pnf-wavenet/wavenet_vocoder/pnf/pnf_utils.py" ]
[ "import torch\n\nfrom train import build_model\n\n\n# The various noise levels, geometrically spaced\nCHECKPOINTS = {\n 175.9 : 'checkpoints175pt9',\n 110. : 'checkpoints110pt0',\n 68.7 : 'checkpoints68pt7',\n 54.3 : 'checkpoints54pt3',\n 42.9 : 'check...
[ [ "torch.load" ] ]
ThomasRanvier/deep_rl_project
[ "6be1f655f7bbcf6aab5e7da353be3ca35fba449b" ]
[ "atari/run_trained_model.py" ]
[ "import matplotlib.pyplot as plt\nimport torch\nfrom atari import Atari\nimport sys\n\nN_EPISODES = 1\nMEAN_K = 10\nDISPLAY = False\nDYNAMIC = False\nSAVE_GIF = True\n\ndef run_episode(net, env):\n env.reset()\n episode_reward = 0\n terminal = False\n terminal_life_loss = False\n while not terminal:\...
[ [ "torch.load", "matplotlib.pyplot.subplots", "matplotlib.pyplot.ioff", "torch.cuda.is_available", "matplotlib.pyplot.show", "matplotlib.pyplot.ion", "torch.argmax" ] ]
SWhardfish/CSVtoMatplotlib
[ "f791de6029530a43fc471033494a689b1f4222ff" ]
[ "EncryptionStats.py" ]
[ "import pandas as pd\nimport glob\nimport os\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport datetime\nimport numpy as np\nfrom matplotlib.ticker import (MultipleLocator, FormatStrFormatter,\n AutoMinorLocator)\n\n\npd.set_option('display.max_rows', 10000)\n...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.read_csv", "matplotlib.ticker.AutoMinorLocator", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "pandas.Timedelta", "matplotlib.pyplot.subplots_adjust", "pandas.set_option", "matplotlib.pyplot.show" ] ]
dazhwu/pydynpd
[ "910563c28000e6200c11beddd6aa80b9602c5315" ]
[ "pydynpd/instruments.py" ]
[ "import numpy as np\n\nfrom pydynpd.info import df_info, z_info, options_info\n\n\nclass instruments(object):\n\n def __init__(self, variables: dict, gmm_tables: dict, df_information: df_info, options: options_info):\n level = options.level\n collapse = options.collapse\n transformation = op...
[ [ "numpy.isnan", "numpy.arange", "numpy.zeros", "numpy.empty" ] ]
VNOpenAI/OpenControl
[ "0087408c57bc77f34f524b28f8c4363b116700bb" ]
[ "OpenControl/visualize/visualize.py" ]
[ "import numpy as np\nimport os\nfrom torch.utils.tensorboard import SummaryWriter\n\nclass Logger(object):\n \"\"\"Real-time visualize simulation results, using Tensorboard\n \n Attributes:\n writer (class): the same as SummaryWriter_\n \n .. _SummaryWriter: https://pytorch...
[ [ "numpy.cos", "numpy.array", "torch.utils.tensorboard.SummaryWriter", "numpy.sin" ] ]
zkurtz/kaggle_malware_2019
[ "72465b2f5d5f49d1acefa9b4f6b06df2aa53e4a8" ]
[ "build_data/refactor_data.py" ]
[ "from feather import read_dataframe as read_feather\nimport numpy as np\nimport pandas as pd\nimport pdb\n\nfrom zpylib import data_path as dp\nfrom zpylib import train_colnames\nfrom zpylib.datatools import FeaturesByType\n\ndef refactor_col(infile, col):\n print(\" ... \" + col)\n series = read_feather(infi...
[ [ "pandas.DataFrame" ] ]
tannonk/datasets
[ "c59950a557d9021fb1597f266c03c47aba09cb56" ]
[ "src/datasets/fingerprint.py" ]
[ "import inspect\nimport json\nimport os\nimport random\nimport shutil\nimport tempfile\nimport weakref\nfrom dataclasses import asdict\nfrom functools import wraps\nfrom typing import TYPE_CHECKING, Any, Dict, List, Optional, Union\n\nimport numpy as np\nimport pyarrow as pa\nimport xxhash\n\nfrom datasets.table im...
[ [ "numpy.random.get_state" ] ]
pandok/openpilot
[ "d67ee20fb7ca14d6a4462a597696cf2f2bf47ecc" ]
[ "selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport numpy as np\n\nfrom common.realtime import sec_since_boot\nfrom common.numpy_fast import clip, interp\nfrom selfdrive.swaglog import cloudlog\nfrom selfdrive.modeld.constants import index_function\nfrom selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU\nfrom comm...
[ [ "numpy.diag", "numpy.min", "numpy.arange", "numpy.cumsum", "numpy.ones", "numpy.copy", "numpy.diff", "numpy.interp", "numpy.insert", "numpy.column_stack", "numpy.exp", "numpy.any", "numpy.argmin", "numpy.array", "numpy.zeros" ] ]
twangnh/Distilling-Object-Detectors-FRCNN
[ "c6583f3a2844bfbb7664c0552be17eccac03bffb" ]
[ "lib/model/faster_rcnn/vgg16.py" ]
[ "# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __fu...
[ [ "torch.nn.Linear", "torch.load" ] ]
davidhintelmann/PyQt5-
[ "bb896e7e11ab6f046d2385f7bef96c7f8516d93d" ]
[ "src/main/python/main.py" ]
[ "from fbs_runtime.application_context.PyQt5 import ApplicationContext\nfrom PyQt5.QtWidgets import QMainWindow\nfrom PyQt5 import QtCore, QtGui, QtWidgets\nimport pandas as pd\n\nimport sys\n\n\"\"\"\nClass below is for displaying a pandas dataframe on the canvas of a PyQt5 app\n\"\"\"\nclass DataFrameModel(QtCore....
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
imbillu/arche
[ "67a24b83e2f936f1f6f8d1c7bbd4aa147f128b66" ]
[ "tests/conftest.py" ]
[ "from copy import deepcopy\nfrom itertools import zip_longest\nfrom typing import Dict, Iterable, List, Optional\n\nfrom arche.readers.items import CollectionItems, JobItems\nfrom arche.rules.result import Level, Message, Result, Stat\nimport numpy as np\nimport pandas as pd\nimport pytest\n\n\nCLOUD_ITEMS = [\n ...
[ [ "numpy.array", "pandas.testing.assert_frame_equal", "pandas.testing.assert_series_equal", "pandas.DataFrame" ] ]
HuangLED/euler
[ "a56b5fe3fe56123af062317ca0b4160ce3b3ace9" ]
[ "tf_euler/python/euler_ops/mp_ops_test.py" ]
[ "# Copyright 2020 Alibaba Group Holding Limited. 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# Unle...
[ [ "tensorflow.test.compute_gradient_error", "tensorflow.constant", "tensorflow.test.main", "tensorflow.abs" ] ]
MattToast/SmartSim
[ "4bd5e231445abd9b888561930db859062708678a" ]
[ "tutorials/ml_training/surrogate/tf_model.py" ]
[ "\n# take code for VAE from Keras https://keras.io/examples/generative/vae/\nfrom tensorflow import keras\n\nfrom tensorflow.keras.layers import Conv2D, Conv2DTranspose, BatchNormalization, \\\n Add, SpatialDropout2D, Layer, InputLayer\nfrom tensorflow.keras.models import Model\n\...
[ [ "tensorflow.keras.activations.selu", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.SpatialDropout2D" ] ]
jkoessle/PRETSA
[ "93435f1ab37a87a96487496c9facae51971bcfd1" ]
[ "calculateBaselineEventLogStatistics.py" ]
[ "import sys\nimport pandas as pd\nimport numpy as np\ndictPath = sys.argv[1]\n\ncaseIDColName = \"Case ID\"\n\ndatasets = [\"Road_Traffic_Fine_Management_Process\",\"CoSeLoG\",\"Sepsis\"]\ndf = pd.DataFrame(columns=['Dataset', 'k', 'method','variants','cases'])\nfor dataset in datasets:\n for k in range(1,9):\n ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
heskarioth/crypto_investment_tracker
[ "74a4a9704df439b2a5b9160f44a8156b56e651fb" ]
[ "misc_functions/watchlist_funcs.py" ]
[ "import requests\nimport pandas as pd\nimport numpy as np\nfrom global_vars import *\n\n# functions\ndef watchlist_get_overview():\n url = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page=1&sparkline=false'\n client = requests.Session()\n r = client.ge...
[ [ "pandas.DataFrame" ] ]
zhentaoshi/Boosted_HP_filter
[ "bbc9ce517c30793496b979dadb798ea78e10544b" ]
[ "python/BoostedHP.py" ]
[ "#' Boosting the Hodrick-Prescott Filter\n#'\n#' Coded by Mei Ziwei\n#' Documented by Shi Zhentao\n#'\n#' All in one function of conducting the boosted HP-filter.\n##############################################################################\n#' Parameters: \n#'\n#' x - a raw time series to be filtered.\n#' lam - ...
[ [ "numpy.diag", "numpy.dot", "numpy.log", "pandas.read_csv", "numpy.eye", "numpy.var", "numpy.array", "numpy.zeros" ] ]
rems75/ray
[ "6f436d8805a5d97deadd6e133a2ecbda87889aee" ]
[ "python/ray/tune/logger.py" ]
[ "import csv\nimport json\nimport logging\nimport numpy as np\nimport os\nimport time\nimport yaml\n\nfrom typing import Iterable, TYPE_CHECKING, Dict, List, Optional, TextIO, Type\n\nimport ray.cloudpickle as cloudpickle\n\nfrom ray.tune.callback import Callback\nfrom ray.tune.utils.util import SafeFallbackEncoder\...
[ [ "numpy.isnan" ] ]
rushic24/python-stocks-charting-from-scratch
[ "d496f8d0373cbb9a607e08c23e5f6a982fbbf866" ]
[ "temp.py" ]
[ "import urllib.request, urllib.error, urllib.parse\nimport time\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mticker\nimport matplotlib.dates as mdates\nfrom matplotlib.finance import candlestick_ohlc\nimport matplotlib\nimport pylab\nmatplotlib.rcParams.update(...
[ [ "matplotlib.pyplot.legend", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.gca", "matplotlib.dates.strpdate2num", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.rcParams.update", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.subplots_adjust", ...
ryutok/mpl_axes_aligner
[ "bc956ffbdaad0dc6fefc1aaa98f5bc6b55e8ea8a" ]
[ "tests/test_shift.py" ]
[ "import pytest\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nfrom mpl_axes_aligner import shift\n\nfig = plt.figure()\n\n\ndef test_expand_range_simple():\n org = 0.0\n ival = 0.0\n fval = 2.0\n pos = 0.5\n ival, fval = shift._expand_range(org, pos, ival, fval)\n as...
[ [ "matplotlib.use", "matplotlib.pyplot.figure" ] ]
ZerinHwang03/SiamFC_online_finetuning
[ "b139349e993c96ad66f368ee822a688906c83d99" ]
[ "src/windows.py" ]
[ "# -*- coding:utf-8 -*-\n\n\"\"\"\nin this function, I defined some functions for the process for score map\n\nincludes:\n make_hanning_window(): create penalty for score map on the basis of hanning window\n make_guassian_window(): create penalty for score map on the basis of gaussian window\n add_window_t...
[ [ "numpy.exp", "numpy.sum", "numpy.hanning", "numpy.transpose" ] ]
bghojogh/Quantile-Quantile-Embedding
[ "5daff878a838f6dbeb04cc0b15da2ad66ab9796c" ]
[ "2_deep_codes/3_Siamese_triplet/CNN_Siamese.py" ]
[ "# import tensorflow as tf\nimport tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior()\nimport numpy as np\n\n\n# I googled: tensorflow cnn example\n# https://www.datacamp.com/community/tutorials/cnn-tensorflow-python\n\nclass CNN_Siamese:\n\n # Create model\n def __init__(self, loss_type, feature_space_di...
[ [ "tensorflow.compat.v1.math.maximum", "tensorflow.compat.v1.square", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.reduce_mean", "tensorflow.compat.v1.linalg.trace", "tensorflow.compat.v1.linalg.matmul", "tensorflow.compat.v1.nn.conv2d", "tensorflow.compat.v1.mat...
vishalbelsare/palladium
[ "3e7bd7d8f38b8ad1a175d0cd387fe5959acbfe2e" ]
[ "palladium/tests/test_dataset.py" ]
[ "import os\nfrom threading import Thread\nfrom unittest.mock import MagicMock\nfrom unittest.mock import patch\n\nfrom pandas import DataFrame\nimport pytest\nimport sklearn\n\ndummy_dataframe = DataFrame({\n 'datacol1': [10, 11, 12, 13, 14],\n 'datacol2': [20.0, 21.0, 22.0, 23.0, 24.0],\n 'targetcol': [0,...
[ [ "pandas.DataFrame" ] ]
xiedidan/sparse-coding
[ "36fb106217382dedbbea9234b10e02b0505d9b50" ]
[ "src/model/SparseNet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass SparseNet(nn.Module):\n\n def __init__(self, K:int, M:int, R_lr:float=0.1, lmda:float=5e-3, device=None):\n super(SparseNet, self).__init__()\n self.K = K\n self.M = M\n self.R_lr = R_lr\n self.lmd...
[ [ "torch.optim.Adam", "torch.nn.functional.normalize", "torch.norm", "torch.zeros", "torch.zeros_like", "torch.nn.Linear", "torch.nn.functional.relu", "torch.no_grad", "torch.device" ] ]
aliciawyy/sheep
[ "b21231dfdaee63d3f868421cba2a50be26c513f4" ]
[ "sheepts/data.py" ]
[ "from os import path, walk\nimport pandas as pd\n\n\nclass CsvDataHandler(object):\n _suffix = \".csv\"\n\n def __init__(self, data_dir):\n self.data_dir = data_dir\n\n def get_time_series_data(self, ticker):\n filename = ticker + self._suffix\n for dir_path, dir_names, filenames in wa...
[ [ "pandas.read_csv" ] ]
sneznaj/graspologic
[ "640811efb64061fee3b6ff7c94b2179aeabc0e4a" ]
[ "graspologic/datasets/base.py" ]
[ "# Copyright (c) Microsoft Corporation and contributors.\n# Licensed under the MIT License.\n\nfrom os.path import dirname, join\nfrom pathlib import Path\nfrom typing import Tuple, Union\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.utils import Bunch\n\nfrom ..utils import import_edgelist\n\n\ndef load...
[ [ "pandas.concat", "pandas.read_csv", "sklearn.utils.Bunch", "numpy.loadtxt" ] ]
floraaws/quickstart-aws-utility-meter-data-analytics-platform
[ "47e94e76ecf67c5b437b80dfca0ed0d00e868d94" ]
[ "assets/functions/meter_forecast/app.py" ]
[ "'''\nTesting event\n{\n \"Data_start\": \"2013-06-01\",\n \"Data_end\": \"2014-01-01\",\n \"Meter_id\": \"MAC004534\",\n \"ML_endpoint_name\": \"ml-endpoint-0001\"\n}\n'''\n\nimport boto3, os\nimport pandas as pd\nimport numpy as np\nimport json\nfrom pyathena import connect\n\nREGION = os.environ['AWS_REGION'...
[ [ "pandas.Timedelta", "numpy.isfinite", "pandas.read_sql", "pandas.DataFrame" ] ]
fruchart/numpy
[ "bf20e3034085716c4559ec4bf31b23b6016f266c" ]
[ "numpy/core/tests/test_numeric.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport sys\nimport warnings\nimport itertools\nimport platform\nimport pytest\nfrom decimal import Decimal\n\nimport numpy as np\nfrom numpy.core import umath\nfrom numpy.random import rand, randint, randn\nfrom numpy.testing import (\n assert_...
[ [ "numpy.binary_repr", "numpy.broadcast", "numpy.all", "numpy.searchsorted", "numpy.ma.masked_where", "numpy.complex64", "numpy.full", "numpy.outer", "numpy.zeros", "numpy.testing.assert_raises_regex", "numpy.sctypes.values", "numpy.testing.assert_raises", "numpy....
dheerajgupta0001/wrldc_mis_monthly_report_generator
[ "dd5ae6f28ec6bf8e6532820fd71dd63f8b223f0b" ]
[ "src/app/section_1_11/section_1_11_GenCurve.py" ]
[ "import datetime as dt\nfrom typing import List\nfrom src.repos.metricsData.metricsDataRepo import MetricsDataRepo\nfrom src.utils.addMonths import addMonths\nfrom src.config.appConfig import getREConstituentsMappings\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\n\n### Ge...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.pyplot.subplots", "pandas.DataFrame", "pandas.isna", "matplotlib.dates.DayLocator", "matplotlib.pyplot.xticks" ] ]
gcampax/tensorflow_estimator
[ "ef9b7fb5ab275677fdc2adee698cde2d2294d4fd" ]
[ "tensorflow_estimator/python/estimator/canned/dnn_estimator_test.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...
[ [ "numpy.linspace", "tensorflow.python.platform.test.TestCase.__init__", "tensorflow.python.platform.gfile.Exists", "tensorflow.python.platform.test.main", "tensorflow.python.feature_column.feature_column_lib.make_parse_example_spec", "tensorflow.python.summary.writer.writer_cache.FileWriter...
sisl/Chimp
[ "39aecc18a635ce2608b3f604310dedd738946574" ]
[ "chimp/simulators/pomdp/models/tools/belief.py" ]
[ "import numpy as np\nfrom copy import deepcopy\n\n#################################################################\n# Implements Belief and Belief Updater\n#################################################################\n\nclass DiscreteBelief():\n\n def __init__(self, n):\n self.bold = np.zeros(n) + 1...
[ [ "numpy.zeros" ] ]
alexanderkell/elecsim
[ "35e400809759a8e9a9baa3776344e383b13d8c54" ]
[ "elecsim/data_manipulation/data_modifications/inverse_transform_sampling.py" ]
[ "import numpy as np\nimport numpy.random as ra\n\"\"\"\nFile name: inverse_transform_sampling\nDate created: 10/01/2019\nFeature: # Generate random numbers from a custom distribution\n\"\"\"\n\n__author__ = \"Alexander Kell\"\n__copyright__ = \"Copyright 2018, Alexander Kell\"\n__license__ = \"MIT\"\n__email__ = \"...
[ [ "numpy.random.uniform", "numpy.array", "numpy.cumsum" ] ]
Siddharthm10/Face_Recognition_and_detection
[ "018a2cd5800ab69fd3bbfa76c0ac874e65845412" ]
[ "face_recognition/basic_api/f_recognition.py" ]
[ "\nif __name__ == \"__main__\":\n \n import cv2\n import numpy as np\n import face_recognition as fr\n import os\n from datetime import datetime\n import time\n import json\n\n path = 'face_recognition/basic_api/images/known'\n images = []\n classNames = []\n tolerance = 0.6\...
[ [ "numpy.argmin" ] ]
qcware/bmw
[ "761e405587bffe5dc4ca9f79432a79df2c7fd8f8" ]
[ "prod-1/2-prod/verify/data_visualization/plot_rules.py" ]
[ "import bmw \nimport numpy as np\nimport matplotlib.pyplot as plt \n\nproblem = bmw.Problem.parse(filepath='../../../../data/3-refined')\n\ndat = np.load('../../test-0.npz')\nconstellation = dat['constellation']\nconstellation_type_indices = dat['constellation_type_indices']\n\n\nconstellation = constellation[:60, ...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.bar", "matplotlib.pyplot.axis", "numpy.argsort", "numpy.load", "matplotlib.pyplot.rcParams.update", "numpy.zeros", "matpl...
ligenchang/CarND-Capstone
[ "51a45a6a897721f05123be453710756dab4b80f0" ]
[ "ros/src/waypoint_updater/waypoint_updater.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport numpy as np\n\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\n\nfrom scipy.spatial import KDTree\nimport math\n\n'''\nThis node will publish waypoints from the car's current position to some `x` dist...
[ [ "numpy.dot", "numpy.array", "scipy.spatial.KDTree" ] ]
jnwestra/self-critical.pytorch
[ "a0ccbc101fb7af547ffa9fbc115dcb4291b87261" ]
[ "captioning/utils/eval_utils.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport numpy as np\nimport json\nfrom json import encoder\nimport random\nimport string\nimport time\nimport os\nimport sys\nfrom...
[ [ "torch.nn.functional.softmax", "torch.no_grad" ] ]
ElementAI/am3
[ "fc93813b7366933273dfeaea172f68de744c6d97" ]
[ "AM3_protonet++.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"Training and evaluation entry point.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport numpy as np\nimport argparse\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom tensorf...
[ [ "tensorflow.concat", "numpy.sqrt", "numpy.asarray", "tensorflow.RunMetadata", "tensorflow.contrib.slim.losses.get_regularization_losses", "tensorflow.contrib.slim.flatten", "tensorflow.train.AdamOptimizer", "tensorflow.get_default_graph", "tensorflow.contrib.slim.metrics.aggreg...
marwan-eid/Web-Application-and-Database-System-Backend-for-Egyptian-movies
[ "5bc1f9a08b14f9917706d0f25076195bee50157d" ]
[ "Web Application.py" ]
[ "import dash\r\nimport dash_table\r\nimport dash_html_components as html\r\nimport dash_core_components as dcc\r\nimport MySQLdb\r\nimport numpy as np\r\nimport pandas as pd\r\nimport webbrowser\r\nfrom dash.dependencies import Input, Output, State\r\nfrom dash.exceptions import PreventUpdate\r\nfrom threading impo...
[ [ "numpy.array", "pandas.DataFrame" ] ]
OCopping/tiled
[ "6dd1e5f7ad495b004fa4b8053fc613232bcc8731" ]
[ "tiled/server/core.py" ]
[ "import base64\nimport collections.abc\nimport dataclasses\nimport itertools\nimport math\nimport operator\nimport re\nimport sys\nimport uuid\nfrom collections import defaultdict\nfrom datetime import datetime, timedelta\nfrom hashlib import md5\nfrom typing import Any\n\nimport dateutil.tz\nimport jmespath\nimpor...
[ [ "numpy.isscalar" ] ]
MBtech/rethinking-serverless
[ "973bfdc174ed639900fd1a3eaeefbafe5a3b48aa" ]
[ "benchmarks/linpack/linpack/handler.py" ]
[ "from numpy import matrix, array, linalg, random, amax, asscalar\nfrom time import time\n\ndef linpack(N):\n # eps=2.22e-16\n\n # ops=(2.0*N)*N*N/3.0+(2.0*N)*N\n\n # Create AxA array of random numbers -0.5 to 0.5\n A=random.random_sample((N,N))-0.5\n B=A.sum(axis=1)\n\n # Convert to matrices\n ...
[ [ "numpy.matrix", "numpy.linalg.solve", "numpy.random.random_sample" ] ]
ErmakovD/ClickHouse
[ "532cd4beaa6f2ec5c70c6f80f90c2ac34066bdab" ]
[ "docker/test/performance-comparison/perf.py" ]
[ "#!/usr/bin/python3\n\nimport argparse\nimport clickhouse_driver\nimport itertools\nimport functools\nimport math\nimport os\nimport pprint\nimport random\nimport re\nimport statistics\nimport string\nimport sys\nimport time\nimport traceback\nimport logging\nimport xml.etree.ElementTree as et\nfrom threading impor...
[ [ "scipy.stats.ttest_ind" ] ]
bolt25/Deep_Learning_in_8_weeks
[ "de9bf4dded525ec761c02bc05703ef3c6ba5f256" ]
[ "Week 4/RNN.py" ]
[ "# Recurrent Neural Network from Scratch in Python 3\n\nimport copy\nimport numpy as np\n\n# np.random.seed(0)\n\n# Sigmoid Activation Function\n# To be applied at Hidden Layers and Output Layer\ndef sigmoid(z):\n return (1 / (1 + np.exp(-z)))\n\n# Derivative of Sigmoid Function\n# Used in calculation of Back Pr...
[ [ "numpy.dot", "numpy.random.random", "numpy.abs", "numpy.round", "numpy.atleast_2d", "numpy.zeros_like", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
YangYang-SHU/SAAE-DFR
[ "b32970c278b30e0b08da2f2c6659e54ad888f82f" ]
[ "src/vit.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom utils import load_checkpoint\n\n\nclass PositionEmbs(nn.Module):\n def __init__(self, num_patches, emb_dim, dropout_rate=0.1):\n super(PositionEmbs, self).__init__()\n self.pos_embedding = nn.Parameter(t...
[ [ "torch.tensordot", "torch.nn.GELU", "torch.nn.functional.softmax", "torch.nn.Dropout", "torch.Tensor", "torch.cat", "torch.zeros", "torch.randn", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.matmul", "torch.unbind...
kalman5/tvm
[ "eb64e259546574372c8bb88eee3a4b83130b8b7d" ]
[ "python/tvm/relay/frontend/onnx.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.array", "numpy.zeros", "numpy.iinfo", "numpy.prod" ] ]
WeiXuanChan/heartFEM
[ "7f26c71434919c3141fac600f08685e5383e7137" ]
[ "heartFEM/lcleeHeart/vtk_py/addLocalFiberOrientation.py" ]
[ "########################################################################\n\nimport sys\nimport math\nimport numpy\nimport vtk\nfrom random import uniform as randuniform\nfrom heartFEM.lcleeHeart.vtk_py.addLocalFiberOrientation import *\nfrom heartFEM.lcleeHeart.vtk_py.addLocalProlateSpheroidalDirections...
[ [ "numpy.dot", "numpy.sqrt", "numpy.arange", "numpy.linalg.norm", "numpy.argmin", "numpy.cross", "numpy.array", "numpy.exp", "numpy.zeros", "numpy.loadtxt" ] ]
petercorke/machinevision-toolbox-python
[ "d7e465575ad3c512387e9486b3b556dc9faa43cf" ]
[ "machinevisiontoolbox/ImageProcessingKernel.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport spatialmath.base.argcheck as argcheck\nimport cv2 as cv\nimport scipy as sp\n\nfrom scipy import signal\n\n\nclass ImageProcessingKernelMixin:\n \"\"\"\n Image processing kernel operations on the Image class\n \"\"\"\n\n @staticmethod\n def kgauss(...
[ [ "numpy.issubdtype", "numpy.squeeze", "numpy.all", "numpy.int", "numpy.round", "numpy.mean", "numpy.iinfo", "numpy.arange", "numpy.ceil", "numpy.power", "scipy.signal.convolve2d", "scipy.ndimage.generic_filter", "numpy.floor", "numpy.transpose", "numpy.me...
jsmentch/pliers
[ "ef13552793ab5789065249a89230baced407c472" ]
[ "pliers/tests/test_stims.py" ]
[ "import tempfile\nimport os\nimport base64\nfrom os.path import join, exists\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom .utils import get_test_data_path\nfrom pliers.stimuli import (VideoStim, VideoFrameStim, ComplexTextStim,\n AudioStim, I...
[ [ "pandas.read_csv", "pandas.testing.assert_series_equal", "pandas.Series", "numpy.allclose", "numpy.array_equal", "numpy.arange", "numpy.random.normal", "numpy.array", "numpy.isclose" ] ]
filipecosta90/dlbench
[ "11dd2fb58050c38a4baa429b207aaecad9097ce3" ]
[ "tests/models/tensorflow/convert_to_tensorflow_serving.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.saved_model import signature_constants\nfrom tensorflow.python.saved_model import tag_constants\n\nexport_dir = './reference/00000002'\ngraph_pb = './creditcardfraud.pb'\n\nbuilder = tf.saved_model.builder.SavedModelBuilder(export_dir)\n\nwith tf.gfile.GFile(graph_pb...
[ [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.saved_model.builder.SavedModelBuilder", "tensorflow.get_default_graph", "tensorflow.GraphDef", "tensorflow.saved_model.signature_def_utils.predict_signature_def" ] ]
23W/Labs
[ "64cc6eb5263c2c7a13769966a31abdd6a789d630" ]
[ "SS/L3/lab3_part3.py" ]
[ "import os\nimport pandas\nimport matplotlib.pyplot as plt, numpy as np\n\ndef countryPrecipitation(country, years):\n # read data\n df = pandas.read_csv('precipitation.csv')\n\n # rename indices\n df = df.set_index(df['Country or Area'])\n df.drop(['Country or Area'], axis=\"columns\", inplace=True)...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.pie", "matplotlib.pyplot.ylabel" ] ]
scripples/scripp_gpt-2
[ "d0b5b31fce107440d48c5447cc04cce7bc5ef639" ]
[ "src/generate_snapshot.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport sys\nsys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src')]\nsys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))]\n\nimport fire\nimport json\nimport numpy as np\nimport tensorflow as tf\n\nimport...
[ [ "tensorflow.Graph", "numpy.random.seed", "tensorflow.placeholder", "tensorflow.set_random_seed", "tensorflow.train.Saver" ] ]
JoshuaWu1997/sgan
[ "8a380ae6b6c0ecb6dc516141551081a30466f221" ]
[ "sgan-attention/models.py" ]
[ "import torch\nimport torch.nn as nn\n\n\ndef make_mlp(dim_list, activation='relu', batch_norm=True, dropout=0.0):\n layers = []\n for dim_in, dim_out in zip(dim_list[:-1], dim_list[1:]):\n layers.append(nn.Linear(dim_in, dim_out))\n if batch_norm:\n layers.append(nn.BatchNorm1d(dim_o...
[ [ "torch.nn.Sequential", "torch.nn.Softmax", "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.floor", "torch.cat", "torch.nn.LSTM", "torch.randn", "torch.zeros", "torch.unsqueeze", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.rand", "torch.arange", "t...
hjjpku/adaptive_sampler
[ "cf523af233c8b02c71e07d1d599e634c5ea1d634" ]
[ "models/wide_resnet.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nimport math\r\nfrom functools import partial\r\n\r\n__all__ = ['WideResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101']\r\n\r\n\r\ndef conv3x3x3(in_planes, out_planes, stride=1):\r\n # 3x3x3 ...
[ [ "torch.nn.AvgPool3d", "torch.nn.Sequential", "torch.nn.init.kaiming_normal", "torch.cat", "torch.nn.MaxPool3d", "torch.nn.Conv3d", "torch.nn.Linear", "torch.nn.functional.avg_pool3d", "torch.nn.ReLU", "torch.nn.BatchNorm3d" ] ]
librairy/explainable-qa
[ "7ea753229769ce1f6d09d59d7eab67df7aef2f78" ]
[ "test/datasets/VQuAnDa/EQAKGMetrics.py" ]
[ "import requests\nimport json\nimport enchant\nimport csv\nimport re\nimport time\nimport itertools\nfrom sacrebleu import sentence_bleu\nimport multiprocessing as mp\nimport os\nimport pandas as pd\nimport nltk\nfrom pprint import pprint\n\ndef jsonToDict(route) -> dict:\n '''\n Funcion auxiliar que dada la ...
[ [ "pandas.DataFrame.from_records" ] ]
COFS-UWA/MPM3D
[ "1a0c5dc4e92dff3855367846002336ca5a18d124" ]
[ "PyTests/consolidation_1d_disp_curve.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py as py\n\nfrom OneDConsolidation import OneDConsolidation\n\nfig = plt.figure()\nplot1 = fig.subplots(1, 1)\nplot1.set_xlabel(\"time\")\nplot1.set_ylabel(\"displacement\")\n\nout_time = []\npcl_var = []\n\n# numerical solution\nhdf5_file = py.File(\"....
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
kpatvt/sim21
[ "4cbbfcbef6371d3dc5404429545e003a48c69ba5" ]
[ "sim21/data/twu.py" ]
[ "import math\nfrom scipy.optimize import fsolve\nfrom sim21.data.chemsep_consts import GAS_CONSTANT\nfrom sim21.data.eqn import eval_eqn, eval_eqn_int, eval_eqn_int_over_t\nimport numpy as np\n\n\ndef fixed_properties(tb, sg, mw):\n \"\"\"\n Obtain the key fixed properties using the Twu correlations\n :par...
[ [ "scipy.optimize.fsolve" ] ]
cssrivatsan/scqubits
[ "e1e81e9e7d51c070968e37161b24e7071fe87553" ]
[ "scqubits/core/bifluxon.py" ]
[ "# bifluxon.py\n#\n# This file is part of scqubits.\n#\n# Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski\n# All rights reserved.\n#\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########################...
[ [ "numpy.square", "numpy.asarray", "numpy.arange", "numpy.matmul", "numpy.cos", "numpy.sort", "scipy.sparse.identity", "numpy.outer", "scipy.sparse.kron", "scipy.sparse.dia_matrix", "scipy.sparse.linalg.eigsh" ] ]
rednodelabs/scikit-learn
[ "ddbc560603a6633b97fefeb2f2adfcfdf6bb0417" ]
[ "sklearn/cluster/_kmeans.py" ]
[ "\"\"\"K-means clustering.\"\"\"\n\n# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Thomas Rueckstiess <ruecksti@in.tum.de>\n# James Bergstra <james.bergstra@umontreal.ca>\n# Jan Schlueter <scikit-learn@jan-schlueter.de>\n# Nelle Varoquaux\n# Peter Prettenho...
[ [ "numpy.dot", "numpy.minimum", "numpy.asarray", "numpy.zeros_like", "numpy.argmin", "numpy.mean", "numpy.var", "numpy.where", "numpy.hstack", "scipy.sparse.issparse", "numpy.clip", "numpy.full", "numpy.ceil", "numpy.zeros", "numpy.log", "numpy.min", ...
FordyceLab/AcqPack
[ "e8566d9644280549093c6ad1059004718b36f477" ]
[ "acqpack/log.py" ]
[ "import pandas as pd\nimport IPython.display as disp\nimport inspect\nimport types\nimport time\nimport threading\n\n# TODO:\n# - continously updating display with new events (flag?)\n# - conditional formatting (pandas styler)\n# - plotting\n# - use python built-in logging backend (cross-notebook)?\n# - logging/ins...
[ [ "pandas.DataFrame" ] ]
kshitijahande/CV-Project-Image-Colorization
[ "26616baf5152e0dea6218712d5efee3cd35f4bac" ]
[ "src/convert_to_onnx.py" ]
[ "import segmentation_models_pytorch as smp\nimport torch\nfrom dataset import ColorizationDataset\nimport glob\nimport onnx\n\n\ndef convert_to_onnx(model_state_dict, inputs):\n \"\"\"Method to convert pytorch models to onnx format.\n Args:\n model_state_dict: The state dictionary of model.\n in...
[ [ "torch.onnx.export", "torch.load" ] ]
CognitiaAI/equippo-scraping
[ "e1f6facece5d8be9ffcd611612363f41c1c41d1a" ]
[ "equippo/spiders/docdownloader.py" ]
[ "import os\n\nimport scrapy\nimport pandas as pd\nimport numpy as np\nfrom scrapy.http import Request\n\n\nclass DocdownloaderSpider(scrapy.Spider):\n name = 'docdownloader'\n print(\"Doc Downloader Constructor Called !!!\")\n final_df = pd.read_excel('./scrapy_equippo.xlsx')\n docs_df = final_df[final_...
[ [ "pandas.read_excel" ] ]
buszk/GraKeL
[ "d257d6537fd2f849a7d53e106dd4c6f599d83244" ]
[ "grakel/graph_kernels.py" ]
[ "\"\"\"The main graph kernel class, implemented as a sci-kit transformer.\"\"\"\nimport copy\nimport time\nimport warnings\n\nimport numpy as np\n\nfrom scipy.linalg import svd\nfrom sklearn.base import BaseEstimator\nfrom sklearn.base import TransformerMixin\nfrom sklearn.utils.validation import check_is_fitted\n\...
[ [ "sklearn.utils.validation.check_is_fitted", "numpy.random.permutation", "numpy.maximum", "numpy.sqrt" ] ]