repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
OlegPt/spark
[ "c79fd911ca85f883c493c5e888f7690868d7b5ea" ]
[ "python/pyspark/statcounter.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.minimum", "numpy.maximum" ] ]
Jackqu/mmpose
[ "ad8acc5ff5da7993c6befdc4b1ced2c2ecb64533" ]
[ "mmpose/models/detectors/mesh.py" ]
[ "import numpy as np\nimport torch\n\nfrom mmpose.models.misc.discriminator import SMPLDiscriminator\nfrom .. import builder\nfrom ..builder import POSENETS\nfrom .base import BasePose\n\ntry:\n from smplx import SMPL\n has_smpl = True\nexcept (ImportError, ModuleNotFoundError):\n has_smpl = False\n\n\ndef ...
[ [ "numpy.array", "numpy.zeros", "torch.nn.Sequential", "numpy.load", "numpy.prod" ] ]
MuliangDu-sudo/thermal-semantic-segmentation
[ "8a37af1cd0b5ca3f41eb9c2235157c9f727aed38" ]
[ "data/base_dataset.py" ]
[ "from abc import ABC\n\nfrom torch.utils import data\nimport torch\nfrom PIL import Image\nimport os\nimport numpy as np\nimport tqdm\nfrom typing import Sequence, Optional, Dict, Callable\n\n\nclass BaseDataset(data.Dataset):\n \"\"\"A generic Dataset class for domain adaptation in image segmentation\n\n Arg...
[ [ "numpy.array", "numpy.ones", "numpy.asarray" ] ]
jiahuei/test-caption-actions
[ "cbf68dc29a0fdafe92730bf4881319bcbd41eb7f" ]
[ "caption_vae/scripts/collect_captions_plus_OLD.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 28 Aug 2019 17:15:59\n\n@author: jiahuei\n\"\"\"\nfrom link_dirs import pjoin\nimport os\nimport json\nimport pickle\nimport math\nimport random\nimport textwrap\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.font_manager as fmng\nfrom PIL import...
[ [ "numpy.reshape", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.font_manager.findSystemFonts", "matplotlib.pyplot.imshow" ] ]
puneetjain-iclp/xgboost
[ "9d40789faa2361bb95c6532342fbaa3a9fd5ddf5" ]
[ "tests/python/test_sparse_dmatrix.py" ]
[ "import numpy as np\nimport xgboost as xgb\nfrom scipy.sparse import rand\n\nrng = np.random.RandomState(1)\n\nparam = {'max_depth': 3, 'objective': 'binary:logistic', 'verbosity': 0}\n\n\ndef test_sparse_dmatrix_csr():\n nrow = 100\n ncol = 1000\n x = rand(nrow, ncol, density=0.0005, format='csr', random_...
[ [ "numpy.random.binomial", "scipy.sparse.rand", "numpy.random.RandomState" ] ]
dscho15/LUDO_AE
[ "39cc60f3913353ecfe842319a60864ec60eeac82" ]
[ "mutator.py" ]
[ "import numpy as np\n\nclass mutator_uniform:\n\n def __init__(self, L, U):\n self.prob = 0.01\n self.L = L\n self.U = U\n\n def mutate(self, genes):\n \n # Indices \n indices_to_update = np.random.uniform(0, 1, genes.shape) > (1-self.prob)\n\n # Uniform mutati...
[ [ "numpy.random.uniform" ] ]
h4iku/bug-localization
[ "1d3150c4a7aa65eb0f84674938ca64d1462cc190" ]
[ "buglocalizer/semantic_similarity.py" ]
[ "import json\nimport pickle\n\nimport spacy\nimport numpy as np\nfrom sklearn.preprocessing import MinMaxScaler\n\nfrom datasets import DATASET\n\n\ndef calculate_similarity(src_files, bug_reports):\n\n # Loading word vectors\n nlp = spacy.load('en_core_web_lg')\n\n src_docs = [nlp(' '.join(src.file_name['...
[ [ "sklearn.preprocessing.MinMaxScaler" ] ]
akulaarora/pre-training
[ "474d549aa402b4cdd5e3629d23d035c31b60a360" ]
[ "uncertainty/utils/calibration_tools.py" ]
[ "import numpy as np\n\n\ndef calib_err(confidence, correct, p='2', beta=100):\n # beta is target bin size\n idxs = np.argsort(confidence)\n confidence = confidence[idxs]\n correct = correct[idxs]\n bins = [[i * beta, (i + 1) * beta] for i in range(len(confidence) // beta)]\n bins[-1] = [bins[-1][0...
[ [ "numpy.square", "numpy.array", "torch.FloatTensor", "numpy.mean", "numpy.std", "numpy.nanmean", "torch.nn.functional.cross_entropy", "torch.LongTensor", "numpy.sqrt", "numpy.argsort", "numpy.maximum" ] ]
yanghr/vision
[ "bb8e9ddd60d4682044017e889fa073664eba77ed" ]
[ "references/classification/utils.py" ]
[ "from __future__ import print_function\nfrom collections import defaultdict, deque\nimport datetime\nimport time\nimport torch\nimport torch.distributed as dist\n\nimport errno\nimport os\n\n\nclass SmoothedValue(object):\n \"\"\"Track a series of values and provide access to smoothed values over a\n window o...
[ [ "torch.distributed.get_world_size", "torch.distributed.is_available", "torch.distributed.init_process_group", "torch.no_grad", "torch.save", "torch.cuda.max_memory_allocated", "torch.cuda.device_count", "torch.cuda.set_device", "torch.distributed.is_initialized", "torch.ten...
yudasong/Reinforcement-Learning-Branch-and-Bound
[ "052a64425ca969f421a079dc62049fb68b4957c5" ]
[ "REINFORCE/BB.py" ]
[ "import numpy as np\nimport pyibex as pi\n\n\nclass BB():\n \"\"\"\n This class specifies the base Game class. To define your own game, subclass\n this class and implement the functions below. This works when the game is\n two-player, adversarial and turn-based.\n\n Use 1 for player1 and -1 for playe...
[ [ "numpy.zeros" ] ]
maskot1977/scikitallstar
[ "ff376cc73d2c9448f97eb4bac99eb68a7f138aaf" ]
[ "scikitallstars/depict.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import (auc, confusion_matrix, precision_recall_curve,\n r2_score, roc_curve)\n\n\ndef best_scores(allstars_model):\n keys = list(allstars_model.best_scores.keys())\n values = allstars_m...
[ [ "numpy.array", "sklearn.metrics.precision_recall_curve", "matplotlib.pyplot.grid", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.barh", "sklearn.metrics.auc", "matplotlib.pyplot.show", "sklearn.metrics.roc_curve" ] ]
rbeauchemin/SUOD
[ "560b49a2aff4dea0443895c69e2bc6064ba4aed0" ]
[ "examples/demo_base.py" ]
[ "import os\nimport sys\n\nimport scipy as sp\n\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\n\nfrom pyod.models.iforest import IForest\nfrom pyod.models.lof import LOF\nfrom pyod.utils.data import evaluate_print\n\nfrom combo.models.score_comb import majori...
[ [ "sklearn.model_selection.train_test_split", "sklearn.preprocessing.StandardScaler" ] ]
kiminh/cmaes
[ "0e7847b555b350324e2873af3d53c99bf4f38680" ]
[ "cmaes/_sepcma.py" ]
[ "import math\nimport sys\nimport numpy as np\n\nfrom typing import Any\nfrom typing import Dict\nfrom typing import List\nfrom typing import Optional\nfrom typing import Tuple\n\n\nclass SepCMA:\n \"\"\"Separable CMA-ES stochastic optimizer class with ask-and-tell interface.\n\n Example:\n\n .. code::\...
[ [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.min", "numpy.where", "numpy.sqrt", "numpy.all" ] ]
AJSVB/pytorch-lightning
[ "00211c1de3c5901789417263f14a36c846cc42d1" ]
[ "tests/models/data/horovod/train_default_model.py" ]
[ "\"\"\"This script is meant to be executed from `../../test_horovod.py`.\n\nBecause Horovod uses a parallel programming model similar to MPI, unit tests for collective\nops like allreduce need to be run in parallel. The most common approach for running parallel\nHorovod workers is to launch multiple replicas of the...
[ [ "torch.device", "torch.tensor" ] ]
jbalint/aurum-datadiscovery
[ "443b777c13be47e6da60b4af528e19a02608e158" ]
[ "benchmarking/query_processing_benchmarks.py" ]
[ "from knowledgerepr import syn_network_generator as syn\nfrom api.apiutils import Relation\nimport numpy as np\nfrom ddapi import API\n\nimport timeit\nimport time\n\n\napi = None\n\n\"\"\"\nGlobal variables to use by the queries\n\"\"\"\nin_drs = None\n\ndef query2():\n # Neighbor queries\n s = time.time()\n...
[ [ "numpy.percentile", "numpy.array" ] ]
harshkothari410/snn-image-segmentation
[ "18fb28e8b2fee3d7583f6e62fd512ba90863c0ee" ]
[ "test.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nimport nengo\n\nfrom nengo.dists import Uniform\n\nmodel = nengo.Network(label='A Single Neuron')\n\nwith model:\n neuron = nengo.Ensemble(1, dimensions=1, # Represent a scalar\n intercepts=Uniform(-.5, -.5), # Set intercept to 0...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.figure" ] ]
yoshi8102-p/smalysis-register
[ "5fc76e75a532e128fe36cf0b74325a54dc2fd4d6" ]
[ "result-analyzer/main/src/image/MaskGenerator.py" ]
[ "import cv2\nimport numpy as np\n\nfrom constant.Constant import Constant\nfrom model.Range import Range\nfrom util.ImageUtil import ImageUtil\n\n\nclass MaskGenerator:\n BLACK_IMG = np.zeros((1080, 1920))\n WHITE = (255, 255, 255)\n\n @staticmethod\n def createResultMask():\n mask = MaskGenerato...
[ [ "numpy.array", "numpy.zeros" ] ]
exemplary-citizen/dask
[ "9748ca2898d592a959df45f8f0abe7fb13db0f2f" ]
[ "dask/array/routines.py" ]
[ "import inspect\nimport math\nimport warnings\nfrom collections.abc import Iterable\nfrom functools import wraps, partial\nfrom numbers import Real, Integral\nfrom distutils.version import LooseVersion\n\nimport numpy as np\nfrom toolz import concat, sliding_window, interleave\n\nfrom ..compatibility import apply\n...
[ [ "numpy.promote_types", "numpy.min", "numpy.where", "numpy.apply_along_axis", "numpy.cumsum", "numpy.gradient", "numpy.bincount", "numpy.histogram", "numpy.count_nonzero", "numpy.empty", "numpy.vectorize", "numpy.take", "numpy.unravel_index", "numpy.array", ...
PMBio/limix-backup
[ "1e201fdb5c694d0d5506f207f3de65d8ef66146c" ]
[ "limix/stats/pca.py" ]
[ "# Copyright(c) 2014, The LIMIX developers (Christoph Lippert, Paolo Francesco Casale, Oliver Stegle)\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/...
[ [ "numpy.cov", "scipy.eye", "numpy.linalg.eigh", "numpy.random.randn", "numpy.newaxis", "numpy.linalg.svd", "numpy.sqrt", "numpy.diag", "scipy.cov" ] ]
nelsonsw5/3DDet
[ "e554becde1815a62459834a41336dd45d86f955e" ]
[ "tools/viz_display_audit.py" ]
[ "scene_data = [{'upc': '818094005777',\n 'normal': {'x': 0.0, 'y': 0.0, 'z': 1.0},\n 'centroid': {'x': -0.2110433280467987,\n 'y': -0.15601402521133423,\n 'z': -0.19092947244644165},\n 'quantity': 6,\n 'confidence': 0.8571581840515137,\n 'dimensions': {'x': 0.09343475103378296,\n 'y': 0.16350924968719482...
[ [ "numpy.concatenate", "numpy.array", "torch.tensor", "numpy.random.randint", "numpy.repeat", "torch.flatten" ] ]
Fang-Lansheng/C-3-Framework
[ "82e22c93231d2609421d27d594bb18d26ef5be59" ]
[ "models/SCC_Model/NewNet.py" ]
[ "import cv2\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torchvision\n\nfrom misc.networks.cnn import make_layers, cfg\nfrom misc.networks.rnn import BiConvLSTM\nfrom misc.networks.vision_transformer import VisionTransformer\n\n\nclass NewNet(nn.Module):\n def __init__(self, backbone='csrne...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.ge", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.tensor", "torch.nn.functional.upsample_bilinear", "torch....
lxzzhy/VITAD-Fast-Online-Network-Traffic-Anomaly-Detection-Based-on-Variational-Inference
[ "7704b5984ec87fff35b98509f11b4883ffd6ccc1" ]
[ "utils/plot.py" ]
[ "import matplotlib\nimport numpy as np\nimport os\nimport json\nfrom matplotlib import pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nmatplotlib.use('Agg')\n\n\ndef plot_R(dataset_name):\n x = range(2, 51, 2)\n pre = os.path.join(os.path.join('results', dataset_name))\n\n ...
[ [ "matplotlib.use", "matplotlib.pyplot.text", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "numpy.load", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", ...
shahid313/embedding-propagation
[ "f3da33939ddd3eba195c9c8e0f433944a8b02ef6" ]
[ "src/models/backbones/wrn.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn.functional as F\n\n\nclass Block(torch.nn.Module):\n def __init__(self, ni, no, stride, dropout=0):\n super().__init__()\n self.conv0 = torch.nn.Conv2d(ni, no, 3, stride=stride, padding=1, bias=False)\n self.bn0 = torch.nn.BatchNorm2d...
[ [ "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.nn.functional.relu", "torch.Tensor", "torch.nn.Dropout2d" ] ]
uwoseis/zephyr-cli
[ "e4228be3947021f2b983c919c51bb1f67df90eb0" ]
[ "zephyr/middleware/fields.py" ]
[ "from __future__ import print_function, unicode_literals, division, absolute_import\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom builtins import range\n\nimport numpy as np\nimport scipy.sparse as sp\nfrom ..backend import BaseModelDependent\nimport SimPEG\n\nclass HelmFields(SimPE...
[ [ "numpy.concatenate", "numpy.array", "numpy.ones", "numpy.arange" ] ]
gulnazaki/performer-pytorch
[ "b423eed3550099e718e6318f5b501dc3417347c0" ]
[ "performer_pytorch/autoregressive_wrapper.py" ]
[ "from functools import partial\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_sequence\n\ndef exists(val):\n return val is not None\n\ndef top_p(logits, thres = 0.9):\n sorted_logits, sorted_indices = torch.sort(logits, descending=True)\n cum_probs ...
[ [ "torch.cat", "torch.no_grad", "torch.full_like", "torch.multinomial", "torch.full", "torch.nn.functional.softmax", "torch.nn.functional.pad", "torch.sort", "torch.topk" ] ]
adam-dziedzic/time-series-ml
[ "81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a" ]
[ "cnns/graphs/fft_visualize/technique_tensorflow.py" ]
[ "import tensorflow as tf\nimport numpy as np\ntf.enable_eager_execution()\n\nx = np.array([[6., 5., 0., 2., 4., 1.],\n [4., 2., 8., 5., 6., 8.],\n [0., 0., 4., 2., 0., 2.],\n [2., 9., 9., 9., 1., 6.],\n [3., 0., 9., 4., 6., 6.],\n [7., 3., 4., 7., 9., 0.]])\nprint(\"sum: \", x.sum...
[ [ "numpy.array", "tensorflow.enable_eager_execution", "tensorflow.signal.rfft2d" ] ]
antoine-spahr/Label-Efficient-Volumetric-Deep-Semantic-Segmentation-of-ICH
[ "61e74a6188fe82843085e87da7d9c4ec7bdbf85e" ]
[ "code/scripts/AE/AD_AE_scripts.py" ]
[ "\"\"\"\nauthor: Antoine Spahr\n\ndate : 01.03.2021\n\n----------\n\nTO DO :\n\"\"\"\nimport sys\nsys.path.append('../../')\nimport click\nimport os\nimport logging\nimport json\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.cuda\nimport numpy as np\nimport pandas as pd\nimport skimage.io as io\n...
[ [ "torch.device", "numpy.quantile", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "numpy.random.seed", "pandas.DataFrame", "torch.no_grad", "torch.any", "torch.manual_seed", "torch.abs", "torch.cuda.is_available", "torch.load" ] ]
tranduchuy682/HarDNet-MSEG
[ "e32fb15a93e17ef953ad415fd2d51480e89678a7" ]
[ "utils/dataloader.py" ]
[ "import os\nfrom PIL import Image\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nimport numpy as np\nimport random\nimport torch\n\n\nclass PolypDataset(data.Dataset):\n \"\"\"\n dataloader for polyp segmentation tasks\n \"\"\"\n def __init__(self, image_root, gt_root, tr...
[ [ "torch.manual_seed", "numpy.random.randint", "torch.utils.data.DataLoader" ] ]
springcoil/pandas
[ "945075ad78cef652039feb50d60092b0580604e6" ]
[ "pandas/core/config_init.py" ]
[ "\"\"\"\nThis module is imported from the pandas package __init__.py file\nin order to ensure that the core.config options registered here will\nbe available as soon as the user loads the package. if register_option\nis invoked inside specific modules, they will not be registered until that\nmodule is imported, whi...
[ [ "matplotlib.pyplot.rcParams.update", "pandas.core.config.is_one_of_factory", "pandas.core.config.config_prefix", "pandas.core.format.detect_console_encoding", "pandas.core.config.register_option", "pandas.core.config.get_default_val", "pandas.core.common._use_inf_as_null", "pandas....
shriya999/MultiStage-ActionDetection
[ "bb74152536d368b9fcb9e430f551ea64de00be4b" ]
[ "models/rcnn_predictor.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\r\nimport logging\r\nfrom typing import Dict, List, Tuple, Union\r\nimport torch\r\nfrom fvcore.nn import giou_loss, smooth_l1_loss\r\nfrom torch import nn\r\nfrom torch.nn import functional as F\r\nfrom class_ids import coco_obj_class_to_id\r\nfrom class_ids impo...
[ [ "torch.isfinite" ] ]
batra-mlp-lab/vln-chasing-ghosts
[ "f819aea21b94d9d3e23d9b6b9264054ee50c007b" ]
[ "tracker/evaluator.py" ]
[ "from abc import abstractmethod\n\nimport math\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom tqdm import tqdm\n\nfrom trainer import Trainer\nfrom modules.mapper import Mapper\nimport metrics\nimport utils\n\n\nclass Evaluator(Trainer):\n \"\"\" Generic class for running evaluations fo...
[ [ "numpy.array", "torch.no_grad" ] ]
LoganAMorrison/Hazma
[ "e9612729767ff48d5ce50633393f81ee021242d2", "e9612729767ff48d5ce50633393f81ee021242d2" ]
[ "test/vector_mediator/herwig4dm/PhiPi.py", "hazma/rh_neutrino/_rh_neutrino_spectra.py" ]
[ "# Libraries to load\nimport cmath,math,Resonance,alpha,os,FPhiPi\nimport matplotlib.pyplot as plt\n\n# set DM parameters\n# DM to mediator coupling\ngDM = 1.\n#DM mass\nmDM = (FPhiPi.mpi+FPhiPi.mPhi)/2.\n# mediator mass\nmMed = 10\n# mediator width, own width.py will be added with all channels (work in progress)\n...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.cla", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf" ], [ "numpy.array", "nump...
mindriot101/gaia-webgl
[ "da86e89e5a9d591009c9a96b00ed9f77a0595e92" ]
[ "convert_to_cartesian.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport glob\nimport os\nimport fitsio\nimport numpy as np\n\n\ndef convert_to_cartesian(ra, dec, dist_parsec):\n r = dist_parsec # np.log10(dist_parsec)\n theta = np.radians(ra)\n phi = np.radians(dec)\n\n x = r * np.cos(theta) * np.cos(phi)\n y = r ...
[ [ "numpy.radians", "numpy.sin", "numpy.cos" ] ]
sofiadutta/deep-learning-v2-pytorch
[ "34fec1c48dab31d74b3f73df4aa7cf161268b0dc" ]
[ "project-bikesharing/my_answers.py" ]
[ "import numpy as np\n\n\nclass NeuralNetwork(object):\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\n # Set number of nodes in input, hidden and output layers.\n self.input_nodes = input_nodes\n self.hidden_nodes = hidden_nodes\n self.output_nodes = out...
[ [ "numpy.random.normal", "numpy.dot", "numpy.exp", "numpy.zeros" ] ]
mgraupe/SPySort
[ "da0f1710bd7dfe0881e1ded18052e868f151aec9" ]
[ "examples/example_nonintract.py" ]
[ "import numpy as np\nimport matplotlib.pylab as plt\n# from guppy import hpy\n\nfrom SPySort.ReadData import data\n# from Events import spikes\n# from Events import events\n# from Events import clusters\n# from Events import alignment\n\nif __name__ == '__main__':\n # Define the raw data location\n folder = '...
[ [ "numpy.array", "matplotlib.pylab.show" ] ]
rileynwong/soundscape-instrument-design
[ "8d7eabe85e07a86107a89c907f229867479ab6e2" ]
[ "main.py" ]
[ "import numpy as np\nimport cv2\nimport pygame.mixer\n\n\n### Set up sounds\npygame.init()\npygame.mixer.init()\n\n# Melody\nred_sound = pygame.mixer.Sound('loops/red_melody.wav')\nred_sound.set_volume(0.0)\nred_sound.play()\n\n# Chords\ngreen_sound = pygame.mixer.Sound('loops/green_chords.wav')\ngreen_sound.set_vo...
[ [ "numpy.array", "numpy.ones" ] ]
IzayoiRin/MstarHe2R
[ "938d83acdfa5ec4464cf9113fef104a6e80ad662" ]
[ "mstarhe/core/nn/models.py" ]
[ "import copy as cp\nimport time\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport torch as th\nfrom tqdm import tqdm\n\nfrom mstarhe.conf import LazySettings\nfrom mstarhe.errors import ConfigureError, ObjectTypeError, AnalysisRuntimeError, ParametersError\n\n\nsettings = LazySettings()\nTORCH_PATH_ = s...
[ [ "pandas.DataFrame", "torch.no_grad", "numpy.mean", "torch.abs", "torch.cuda.is_available", "torch.pow" ] ]
fsschneider/cockpit-experiments
[ "a9eaf3dc5da5a58356ac0eef25a11235bf0891c4" ]
[ "experiments/01_benchmark/plot_grid.py" ]
[ "\"\"\"Benchmark Heatmap Plot of the Overhead of Cockpit Configurations.\"\"\"\n\nimport os\nimport sys\n\nimport matplotlib.pyplot as plt\nimport run_grid\nimport seaborn as sns\nfrom benchmark_utils import _fix_dev_naming, _fix_tp_naming, read_data\n\nsys.path.append(os.getcwd())\nfrom experiments.utils.plotting ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
goncaloperes/Library_Lasagne
[ "5d3c63cb315c50b1cbd27a6bc8664b406f34dd99" ]
[ "lasagne/tests/layers/test_local.py" ]
[ "import numpy as np\nimport pytest\nimport theano\n\nfrom lasagne.utils import floatX\n\n\ndef locally_connected2d(input, W, flip_filters=True):\n \"\"\"\n 2D convolution with unshared weights, no stride, 'same' padding,\n no dilation and no bias\n \"\"\"\n num_batch, input_channels, input_rows, inpu...
[ [ "numpy.allclose", "numpy.zeros", "numpy.random.random" ] ]
wanliuhuo/rafiki
[ "602679cc294d3e14f74e42d0184cbbffb90f9c88" ]
[ "examples/models/image_classification/TfVgg16.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nimport json\nimport os\nimport tempfile\nimport numpy as np\nimport base64\nimport abc\nfrom urllib.parse import urlparse, parse_qs \n\nfrom rafiki.model import BaseModel, InvalidModelParamsException, test_model_class, \\\n IntegerKnob, ...
[ [ "numpy.asarray", "tensorflow.Graph", "tensorflow.Session", "tensorflow.ConfigProto", "tensorflow.keras.models.load_model", "numpy.stack", "tensorflow.keras.applications.VGG16", "tensorflow.keras.optimizers.Adam" ] ]
e93fem/Hands-On-Transfer-Learning-with-Python
[ "57e38231380aa95d753f1c7f7a711b5107436038" ]
[ "Chapter02/example2.py" ]
[ "# EXAMPLE of Tensor Operations using tensorflow.\nimport tensorflow as tf\n\n# Initialize 3 constants: 2 vectors, a scalar and a 2D tensor\nx1 = tf.constant([1, 2, 3, 4])\nx2 = tf.constant([5, 6, 7, 8])\nb = tf.constant(10)\nW = tf.constant(-1, shape=[4, 2])\n\n# Elementwise Multiply/subtract\nres_elem_wise_mult =...
[ [ "tensorflow.multiply", "tensorflow.scalar_mul", "tensorflow.tensordot", "tensorflow.subtract", "tensorflow.Session", "tensorflow.transpose", "tensorflow.constant", "tensorflow.add" ] ]
pjhartout/fastwlk
[ "deb78923c9a8450099c26bac09da94ae87892d0d" ]
[ "tests/test_kernel.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Tests for `fastwlk` package.\"\"\"\n\nimport json\nimport pickle\nfrom typing import Iterable\n\nimport numpy as np\nimport pytest\nfrom fastwlk.kernel import WeisfeilerLehmanKernel\nfrom grakel import WeisfeilerLehman, graph_from_networkx\nfrom pyprojroot im...
[ [ "numpy.array", "numpy.testing.assert_array_equal", "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_array_less", "numpy.linalg.eig" ] ]
dair-iitd/CDNet
[ "5e9b03e898070d62ef3a5453d777b1f0af824504" ]
[ "code/utils/config.py" ]
[ "import argparse\nimport torch\n\ndef str2bool(v):\n if isinstance(v, bool):\n return v\n if v.lower() in (\"yes\", \"true\", \"t\", \"y\", \"1\"):\n return True\n elif v.lower() in (\"no\", \"false\", \"f\", \"n\", \"0\"):\n return False\n else:\n raise argparse.ArgumentType...
[ [ "torch.device", "torch.cuda.is_available" ] ]
0shimax/pytorch-sam-lr
[ "bc9c25a65a98d360306e8b9aec79da6dd739f483" ]
[ "src/data/loader.py" ]
[ "from typing import List\nimport pandas\nimport numpy\nimport torch\nfrom torch.utils.data import Dataset\n\n\nclass CvrDataset(Dataset):\n def __init__(self,\n features: numpy.matrix,\n labels: numpy.ndarray,\n transform=None):\n super().__init__()\n ...
[ [ "torch.FloatTensor", "torch.LongTensor", "torch.utils.data.DataLoader" ] ]
exityan/PySyft
[ "6477f64b63dc285059c3766deab3993653cead2e" ]
[ "packages/grid/apps/worker/src/main/utils/monkey_patch.py" ]
[ "# stdlib\nimport math\n\n# third party\nimport numpy\n\n\ndef mask_payload_fast(self, payload: bytes) -> str:\n \"\"\"Monkey patch geventwebsocket.websocket.Header.mask_payload(). Version\n currently in geventwebsocket does a very slow python for loop to mask the\n payload.\n\n We take advantage of num...
[ [ "numpy.fromstring", "numpy.dtype" ] ]
indranil1997/CAL
[ "36000a2ed08ec2d1f6ae23f9d7ffd164e72d4aba" ]
[ "PythonClient/agents/CAL_agent/perception/model_functions.py" ]
[ "import os, re\nfrom keras.models import Model\nfrom keras.layers import Input, BatchNormalization, Conv1D, TimeDistributed, LSTM, \\\n multiply, Cropping1D, GRU, CuDNNGRU\nfrom keras.layers.core import Flatten, Dense, Dropout, Lambda\nfrom keras.applications import vgg16\nfrom keras import ...
[ [ "tensorflow.constant", "numpy.arange", "numpy.load", "tensorflow.gather" ] ]
mrware91/PhilTransA-TRXS-Limits
[ "5592c6c66276cd493d10f066aa636aaf600d3a00" ]
[ "Libraries/trxsToolBox/chiSquare/sphericalBesselChiSquare.py" ]
[ "\"\"\"\nConverts input data from momentum to real space by fitting to a spherical\nbessel model\nAuthor: Matthew R. Ware (mrware91@gmail.com)\nDescription: Tools to convert noisy, undersampled Fourier-space distributions\ninto real-space images.\n\"\"\"\n\nimport numpy as np\nfrom scipy import optimize, special\nf...
[ [ "numpy.arange", "scipy.special.spherical_jn", "numpy.meshgrid" ] ]
Stargrazer82301/ChrisFuncs
[ "8d577fa74123e742ab5360fd6f90337cbc8ecddb" ]
[ "ChrisFuncs/FromGitHub/martynbristow.py" ]
[ "import numpy\n\ndef rebin(array, dimensions=None, scale=None):\n \"\"\" Return the array ``array`` to the new ``dimensions`` conserving flux the flux in the bins\n The sum of the array will remain the same\n\n >>> ar = numpy.array([\n [0,1,2],\n [1,2,3],\n [2,3,4]\n ])\n >>>...
[ [ "numpy.zeros" ] ]
aekruijssen/RaceOn
[ "7636e712883bb8c166568614a3dcba45a702446e" ]
[ "Resources/selfdrivingcar/project_1_lane_finding_basic/lane_detection.py" ]
[ "import numpy as np\nimport cv2\nfrom Line import Line\n\n\ndef region_of_interest(img, vertices):\n \"\"\"\n Applies an image mask.\n\n Only keeps the region of the image defined by the polygon\n formed from `vertices`. The rest of the image is set to black.\n \"\"\"\n\n # defining a blank mask t...
[ [ "numpy.uint8", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.median", "numpy.round", "numpy.mean", "numpy.abs" ] ]
ENVIRO-Module/nis-backend
[ "fd86cf30f79f53cdccddd2a5479507d32f914d4e" ]
[ "nexinfosys/model_services/workspace.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n* Registry of objects. Add, remove, search\n* Support for high level operations: directly create and/or modify objects, calling the specification API. Create connections\n\"\"\"\nimport copy\nimport datetime\nimport json\nimport logging\nimport uuid\nfrom enum import Enum\nfrom typ...
[ [ "pandas.MultiIndex.from_tuples" ] ]
RPrenger/NeMo
[ "e8912ca6e3321347272a6a7da18e052812fb2062" ]
[ "nemo/collections/nlp/modules/common/transformer/transformer_decoders.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "torch.cat", "torch.nn.LayerNorm" ] ]
rkeb/rgn
[ "2cd76ce2b0fcfbb376946bb98997db916609c659" ]
[ "model/model.py" ]
[ "\"\"\" Recurrent geometric network model for protein structure prediction.\n\n In general, there is an implicit ordering of tensor dimensions that is respected throughout. It is:\n\n NUM_STEPS, BATCH_SIZE, NUM_DIHEDRALS, NUM_DIMENSIONS\n\n All tensors are assumed to have this orientation unless otherw...
[ [ "tensorflow.reduce_min", "tensorflow.train.start_queue_runners", "tensorflow.constant_initializer", "tensorflow.contrib.layers.summarize_activations", "tensorflow.group", "tensorflow.contrib.layers.fully_connected", "tensorflow.ones_like", "numpy.min", "tensorflow.reshape", ...
kellyjelly0904/macros_29id
[ "573946d13eee7f85da049ac666b5dd2d18d19bb1" ]
[ "IEX_29id/utils/plot.py" ]
[ "import matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\n\n\n\n# filepath='/home/beams/29IDUSER/Documents/User_Folders/Topp/S089.tif'\ndef plot_image(filepath,h=20,v=10):\n \"\"\"\n filepath = '/home/beams/29IDUSER/Documents/User_Folders/UserName/TifFile.tif'\n \"\"\"\n image = mpimg.imread(...
[ [ "matplotlib.image.imread", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
vsingh-group/DatasetPooling
[ "fcede46a949def869b777dfaec4863b39f926945" ]
[ "code/src/train_equivariance.py" ]
[ "import argparse\nfrom src import dataloader as mydatasets, model as models\nfrom src import adni_models\nimport os, sys, time, shutil\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport datetime as dt\n\nfrom src.average_meter imp...
[ [ "torch.trunc", "torch.optim.lr_scheduler.StepLR", "torch.unique", "torch.normal", "torch.nn.functional.mse_loss", "torch.nn.functional.cross_entropy", "torch.tensor", "torch.utils.data.DataLoader", "torch.zeros_like", "torch.exp", "torch.argmax", "torch.sum" ] ]
mayukh18/keras-yolo2
[ "166c9e1356758881fb744f27ce968aad19c1c5bc" ]
[ "train.py" ]
[ "#! /usr/bin/env python\nimport pickle\nimport argparse\nimport os\nimport numpy as np\nfrom preprocessing import parse_annotation\nfrom frontend import YOLO\nimport json\nfrom sklearn.model_selection import train_test_split\n\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"]...
[ [ "sklearn.model_selection.train_test_split" ] ]
clemkoa/u-net
[ "554ed1b20de71659974c7049114700bc9db94008" ]
[ "unet/unet.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nclass double_conv(nn.Module):\n def __init__(self, in_ch, out_ch):\n super(double_conv, self).__init__()\n self.conv = nn.Sequential(\n nn.Conv2d(in_ch, out_ch, 3, padding=1),\n nn.BatchNorm2d(out_ch),\n ...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.pad" ] ]
lkilcommons/esabin
[ "423411338a35f1882a0b6e7c6d838b48079f3e14" ]
[ "esabin/esafile.py" ]
[ "# (C) 2019 University of Colorado AES-CCAR-SEDA (Space Environment Data Analysis) Group\n# Liam Kilcommons - University of Colorado, Boulder - Colorado Center for Astrodynamics Research\n# Originally created May, 2016\nimport numpy as np\nimport h5py,os,shutil\nfrom collections import OrderedDict\nfrom esabin.esag...
[ [ "numpy.concatenate", "numpy.array", "numpy.isclose", "numpy.abs", "numpy.isfinite", "numpy.unique", "numpy.floor" ] ]
hepaccelerate/hepaccelerate
[ "6415fe3d6b569cc94ec33d06180869b0b0773c6c" ]
[ "examples/atlas_hzz.py" ]
[ "# usr/bin/env python3\n# Run as PYTHONPATH=. python3 examples/atlas_hzz.py\n\n# In case you use CUDA, you may have to find the libnvvm.so on your system manually\nimport os, time, glob, argparse, multiprocessing\nimport numba\nimport sys\nimport numpy as np\nimport uproot\nimport hepaccelerate\nimport hepaccelerat...
[ [ "matplotlib.use", "numpy.logical_or", "numpy.zeros_like", "numpy.log", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.close", "numpy.logical_and", "matplotlib.pyplot.figure", "numpy.diff", "numpy.where" ] ]
qiang2100/ParaLS
[ "d4a37d2e19976e20d331dec752b1e4463405fef6" ]
[ "fairseq/modules/transformer_layer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom typing import Dict, List, Optional\n\nimport pdb\nimport torch\nimport torch.nn as nn\nfrom fairseq import utils\nfrom fairseq....
[ [ "torch.nn.Linear", "torch.cat", "torch.mul", "torch.einsum", "torch.ones" ] ]
snkas/floodns
[ "1c7c4f5e34b279f1ed0f8b0cc134c698f9b0fc5a" ]
[ "simulator/external/analyze.py" ]
[ "##\n# The MIT License (MIT)\n#\n# Copyright (c) 2019 snkas\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use,...
[ [ "numpy.max", "numpy.median", "numpy.percentile", "numpy.min", "numpy.mean", "numpy.std" ] ]
sanoussi82/turicreate
[ "bcc3166c9ca3a399010130d642c783f75132865a" ]
[ "src/python/turicreate/test/test_activity_classifier.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\nfrom __future__ import print_function as _\nfrom __future__ import divisio...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.array", "numpy.concatenate", "numpy.random.RandomState" ] ]
gsy/moonlight
[ "1eca6c903b7334afca7555b9aeb7a212c76fef9d" ]
[ "moonlight/structure/beams.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.shape", "numpy.asarray", "tensorflow.less", "tensorflow.greater_equal", "tensorflow.constant", "tensorflow.reduce_mean", "tensorflow.boolean_mask" ] ]
charliecb/habitat-sim
[ "1357956e33884ddf1c39811e5d05e7f3c17695d7" ]
[ "tests/test_data_extraction.py" ]
[ "# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport numpy as np\nfrom torch import nn as nn\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader, Dataset\n\nimport habitat_sim\nfrom examples.settings import...
[ [ "torch.nn.functional.relu", "torch.utils.data.DataLoader" ] ]
janjagusch/meetup-analytics
[ "1d923f6353bd95edbd98dd8ee914606e6f944e77" ]
[ "cloud_functions/meetup-api-to-bigquery/main.py" ]
[ "\"\"\"\nRequests data from Meetup API and inserts it into Google BigQuery.\n\"\"\"\n\nimport datetime\nimport os\nimport warnings\n\nimport pandas as pd\nfrom meetup.client import Client\nfrom meetup.client.errors import RequestError\nfrom meetup.token_manager import TokenCacheGCS, TokenManager\nfrom tqdm import t...
[ [ "pandas.to_datetime" ] ]
duncanhobbs/OG-Core
[ "699a7030739e5b3f44ab4dd58fecf4cefbdc24a6" ]
[ "ogcore/parameters.py" ]
[ "import os\nimport numpy as np\nimport scipy.interpolate as si\nimport pkg_resources\nimport paramtools\n\n# import ogcore\nfrom ogcore import elliptical_u_est\nfrom ogcore.utils import rate_conversion\nfrom ogcore.constants import BASELINE_DIR\nCURRENT_PATH = os.path.abspath(os.path.dirname(__file__))\n\n\nclass S...
[ [ "numpy.zeros_like", "numpy.cumprod", "numpy.reshape", "numpy.zeros", "numpy.minimum", "numpy.round", "numpy.ones", "numpy.tile", "numpy.linspace", "numpy.squeeze" ] ]
Howal/pyc_repo
[ "0d50d03967b78a089494f7f98b57c6b6f6fc8e81" ]
[ "pose_ae/symbols/archives_20191202/posenet_v1_hourglass4_relation_cat_sqrtdim.py" ]
[ "import mxnet as mx\nimport numpy as np\nfrom common.lib.utils.symbol import Symbol\nfrom common.backbone.hourglass_v1 import hourglass_v1, conv_sym_wrapper, CurrentBN\nfrom common.gpu_metric import *\nfrom common.operator_py.select_part import *\nfrom common.operator_py.monitor_op import *\n\nclass posenet_v1_hour...
[ [ "numpy.sqrt" ] ]
livenson/Cirq
[ "b2fa642895089fba385999d675ab65d57a53e0df" ]
[ "cirq-core/cirq/json_resolver_cache.py" ]
[ "# Copyright 2020 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.array" ] ]
MarionLepert/stable-baselines
[ "f55ac2dec40a46457d00a49548fa8fd6c889569a" ]
[ "stable_baselines/ddpg/ddpg.py" ]
[ "from functools import reduce\nimport os\nimport time\nfrom collections import deque\nimport pickle\nimport warnings\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib as tc\nfrom mpi4py import MPI\n\nfrom stable_baselines import logger\nfrom stable_baselines.common import tf_util...
[ [ "numpy.random.rand", "tensorflow.group", "numpy.mean", "tensorflow.clip_by_value", "tensorflow.global_variables_initializer", "tensorflow.shape", "tensorflow.summary.histogram", "tensorflow.global_variables", "tensorflow.variable_scope", "numpy.array", "tensorflow.summa...
robinycfang/NovelQuant
[ "8e36f2ea6accad435b0b4a43a87fa843e07ff6c4" ]
[ "NovelQuant.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nimport argparse\nimport subprocess\nimport os\nimport pandas as pd\n\n\ndef findRI():\n\tparser = argparse.ArgumentParser(usage = 'python NovelQuant findRI -a annotated.gtf -n novel.gtf')\n\tparser.add_argument('findRI')\n\trequired = parser.add_argument_group('required argume...
[ [ "pandas.read_csv", "pandas.merge" ] ]
arjunnlp/hedwig-anlp
[ "b8f6c50d788509bc9e5670caeee3503257d716d0" ]
[ "hedwig/models/reg_lstm/__main__.py" ]
[ "import logging\nimport os\nimport random\nfrom copy import deepcopy\n\nimport numpy as np\nimport torch\n\nfrom common.evaluate import EvaluatorFactory\nfrom common.train import TrainerFactory\nfrom datasets.aapd import AAPD\nfrom datasets.imdb import IMDB\nfrom datasets.reuters import Reuters\nfrom datasets.yelp2...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "torch.optim.Adam", "torch.manual_seed", "torch.cuda.set_device", "torch.cuda.is_available", "torch.load" ] ]
AmazingDD/DeepFM-torch
[ "76daa619e5e6cf70ba55f5180173d2b1e6fdbe1a" ]
[ "main.py" ]
[ "import torch\nimport pandas as pd\nimport numpy as np\nfrom torch.utils.data import Dataset, DataLoader\nfrom sklearn.model_selection import train_test_split\n\nfrom deepfm import DeepFM\n\ntorch.manual_seed(2022)\ndata = pd.read_csv('./temp_data.csv').reset_index(drop=True)\n\ncategory_cols = ['CODE_GENDER', 'FLA...
[ [ "numpy.asarray", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "numpy.cumsum", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
ChandrakantKate/ga-learner-dsmp-repo
[ "e6c53282bbd42c8055c18a2f1203ea76eafa102a" ]
[ "pandas-loan-approval-project/code.py" ]
[ "# --------------\n# code starts here\nmask1 = banks['Self_Employed']=='Yes'\nmask2 = banks['Loan_Status']=='Y'\nloan_approved_se = banks.loc[mask1 & mask2].shape[0]\n#print (loan_approved_se)\nmask3 = banks['Self_Employed']=='No'\nloan_approved_nse = banks.loc[mask2 & mask3].shape[0]\n\npercentage_se = loan_approv...
[ [ "pandas.read_csv" ] ]
edugm94/temporal-feat-emotion-prediction
[ "6548bbf5f5d8969de97c076ebc9b5462d7b8bdd4" ]
[ "code/src/d02_intermediate/SetupDataset.py" ]
[ "# !/usr/bin/env python\n# -*- coding: UTF-8 -*-\n#\n# Author: Eduardo Gutierrez Maestro\n# Date: 2021.11.23\n# email: eduardo.gutierrez-maestro@oru.se\n#\n# Center for Applied Autonomous Sensor Systems (AASS), Cognitive Robotic Systems Labs\n# University of Orebro, Sweden\nfrom src.d00_utils.constants im...
[ [ "pandas.read_csv", "pandas.read_excel" ] ]
maxrowland/LendingClub
[ "ea5d48ba8162774364898e00b8bcb7a86bb12d67" ]
[ "Models/CL_RFC.py" ]
[ "#Author: Max H. Rowland\r\n#Email: maxh.rowland@gmail.com\r\n#Script uses a random forest classifier to predict loan defaults within the lending Club dataset\r\nimport os, errno, time, smtplib, ssl, pickle\r\nfrom datetime import datetime\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as ...
[ [ "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "sklearn.metrics.make_scorer", "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "pandas.plotting.register_matplotlib_converters" ] ]
umayaml/neuprint-python
[ "7c19ce9c97aea63d6c45196a497dce30237586b4" ]
[ "neuprint/plotting.py" ]
[ "\"\"\"\nMiscellaneous plotting functions.\n\n\nNote:\n These functions require additional dependencies,\n which aren't listed by default dependencies of neuprint-python.\n (See docs for each function.)\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\nfrom .client import inject_client\nfrom .skeleton im...
[ [ "numpy.random.seed", "numpy.asarray", "numpy.random.shuffle" ] ]
narumiruna/efficientnet-pytorch
[ "64b99dfdbbe50a9356f6c61579995bc8ac7857a1" ]
[ "efficientnet/trainer.py" ]
[ "import os\nimport shutil\nfrom abc import ABCMeta, abstractmethod\n\nimport mlconfig\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn, optim\nfrom torch.utils import data\nfrom tqdm import tqdm, trange\n\nfrom .metrics import Accuracy, Average\n\n\nclass AbstractTrainer(metaclass=ABCMeta):\n\n ...
[ [ "torch.save", "torch.nn.functional.cross_entropy", "torch.no_grad", "torch.load" ] ]
Sundragon1993/CS231n_2020
[ "47ebb67491dfedf1d9040866422b6cf369f0fbac" ]
[ "A6/a6_helper.py" ]
[ "import torch\nimport time\nimport math\nimport os\nimport shutil\nimport torch.optim as optim\nfrom torchvision import models, datasets, transforms\nfrom torch.utils.data import DataLoader\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom vae import loss_function\nfrom torch import nn\...
[ [ "torch.reshape", "torch.nn.init.xavier_uniform_", "matplotlib.pyplot.figure", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot" ] ]
GeorgeDUT/MetaRLSAS
[ "d50ca936fd116435b871ebd63a82f61cb7ff036f" ]
[ "old_file_maybe_useful/test-my-plus.py" ]
[ "\"\"\"\ntest-my-plus.py\nthis file is based on test-my.py\n\npython test-my-plus.py --config mdp-deterministic/config.json --policy mdp-deterministic/policy.th --output mdp-deterministic/results.npz --meta-batch-size 100 --num-batches 20 --num-workers 8\n\n\"\"\"\n\nimport maml_rl.envs\nimport gym\nimport torch\n...
[ [ "numpy.concatenate", "torch.device", "torch.cuda.manual_seed_all", "torch.manual_seed", "numpy.savez", "torch.cuda.is_available" ] ]
thurinj/mtuq
[ "8c539ac9da4c0e7eb72c5218b7818107c44fecc7" ]
[ "examples/GridSearch.DoubleCouple+Magnitude+Depth.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport numpy as np\n\nfrom mtuq import read, open_db, download_greens_tensors\nfrom mtuq.event import Origin\nfrom mtuq.graphics import plot_data_greens2, plot_misfit_depth, plot_misfit_dc\nfrom mtuq.grid import DoubleCoupleGridRegular\nfrom mtuq.grid_search import grid_search\n...
[ [ "numpy.array" ] ]
Candida18/Job-Portal-with-Automated-Resume-Screening
[ "19d19464ad3d1714da856656753a4afdfe257b31" ]
[ "Job Portal with Automated Resume Screening/form.py" ]
[ "from cProfile import label\nfrom docx2txt.docx2txt import process\nimport streamlit as st\nimport streamlit as st\nimport streamlit.components.v1 as stc\nimport sqlite3 as sql\nimport pandas as pd\nimport datetime\n\n# File Processing Pkgs\nimport pandas as pd\nimport docx2txt\nfrom PIL import Image\nfrom PyPDF2 i...
[ [ "pandas.read_csv", "pandas.read_sql" ] ]
ivallesp/numerai
[ "06cff73ee5dd47a7dada123d9c74dfcaafab76f8" ]
[ "src/model_helpers.py" ]
[ "__author__ = \"ivallesp\"\nimport logging\nimport numpy as np\nfrom sklearn.model_selection import GridSearchCV\n\ndef train_model_with_gridsearch(X, y, estimator, param_grid, scoring=\"neg_log_loss\", cv=10, n_jobs=1, verbose=0):\n \"\"\"\n Trains a model using gridsearch and returns the best model trained ...
[ [ "sklearn.model_selection.GridSearchCV" ] ]
mvpossum/1010Solver
[ "4cc48465675bbf9071cc57d2ab1485443d749603" ]
[ "utils.py" ]
[ "import numpy as np\nimport os\n\nRAW_SAMPLES_DIR='samples/raw'\nSCREEN_SAMPLES_DIR='samples/screen'\n\ndef get_files(input_dir):\n return [os.path.join(input_dir, file_name) for file_name in os.listdir(input_dir)]\n\ndist = lambda p,q: np.linalg.norm(q-p)\n\ndef ensure_dir(file_path):\n directory = os.path.d...
[ [ "numpy.linalg.norm" ] ]
AhmedAlaa10/Consistent_Video_Depth_Estimation
[ "1a8868eadcf0b2082cdfea8ed339865f0ba8ea01" ]
[ "third_party/flownet2/networks/correlation_package/correlation.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport torch\nfrom torch.nn.modules.module import Module\nfrom torch.autograd import Function\nimport correlation_cuda\n\n### Note(jkopf): I commented out the lines with triple comments (###) to fix the\n### following error: 'Leg...
[ [ "torch.cuda.device_of" ] ]
zongdaoming/Ambiguity
[ "ab6bdda3eceb646f69aa509a73631cfc5620f473" ]
[ "unet_utils.py" ]
[ "# _*_ coding: utf-8 _*_\n# @author : naive dormin\n# @time : 2021/03/17 18:13:38\n\n\n\n\"\"\"Architectural blocks and utility functions of the U-Net.\"\"\"\nimport sonnet as snt\nimport tensorflow.compat.v1 as tf\n\ndef res_block(input_features, n_channels, n_down_channels=None,\n activation_...
[ [ "tensorflow.compat.v1.nn.avg_pool2d", "tensorflow.compat.v1.image.resize" ] ]
angelolovatto/deep-rl
[ "9f0c1aafe71852c8973bf1ab732114a3cdbe23ad" ]
[ "proj/common/env_makers.py" ]
[ "\"\"\"\nImplements several factories for both single and vectorized environments.\n\"\"\"\nimport os\nimport gym\nimport numpy as np\nfrom baselines import logger\nfrom baselines.common.atari_wrappers import make_atari, wrap_deepmind\nfrom baselines.common.vec_env.dummy_vec_env import DummyVecEnv as _DummyVecEnv\n...
[ [ "numpy.iinfo", "numpy.append" ] ]
eddie-chiang/prca
[ "c74c21034a4fcb785faedc8069470a70a74342e6" ]
[ "ghtorrent/BigQueryCsvFileProcessor.py" ]
[ "import logging\nfrom concurrent.futures import ThreadPoolExecutor\nfrom pathlib import Path\n\nimport numpy\nimport pandas\nfrom tqdm import tqdm\n\nfrom commentprocessing import LanguageDetector\nfrom ghtorrent import CommentResourceAccess\nfrom github import PullRequestResourceAccess\n\n\nclass BigQueryCsvFilePr...
[ [ "pandas.read_csv", "pandas.Series" ] ]
gkiar/nilearn
[ "311422d0e55a2d385facb8431a37f4d69f9963e3" ]
[ "nilearn/datasets/func.py" ]
[ "\"\"\"\nDownloading NeuroImaging datasets: functional datasets (task + resting-state)\n\"\"\"\nimport warnings\nimport os\nimport re\nimport json\nimport numpy as np\nimport numbers\n\nimport nibabel\nfrom sklearn.datasets.base import Bunch\nfrom sklearn.utils import deprecated\n\nfrom .utils import (_get_dataset_...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.asarray", "numpy.sum", "numpy.genfromtxt", "sklearn.datasets.base.Bunch", "numpy.lib.recfunctions.join_by", "sklearn.utils.deprecated", "numpy.any", "numpy.loadtxt", "numpy.arange", "numpy.where", "nump...
ceshine/modern_chinese_nlp
[ "e1d5941f381431ac114f440472d3e0f976437777" ]
[ "legacy/cnlp/fastai_extended.py" ]
[ "import random\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\nimport numpy as np\n\nimport fastai.text\nfrom fastai.core import BasicModel, to_gpu\nfrom fastai.nlp import RNN_Learner\nfrom fastai.lm_rnn import SequentialRNN\nfrom fastai.dataloader impo...
[ [ "torch.nn.Linear", "numpy.random.normal", "numpy.array", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.cat", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.Parameter", "numpy.stack", "torch.nn.functional.relu", "numpy.random.random" ] ]
MengHao666/Hand-BMC-pytorch
[ "d9d1a5394ebc84079e9fc25885122c18a9ec1505" ]
[ "weakloss.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn.functional as torch_f\n\nimport config as cfg\n\n\ndef plot_hull(theta, hull):\n del_rdp_hull = hull.detach().cpu().numpy()\n theta = theta.detach().cpu().numpy()\n\n fig = plt.figure()\n figManager = plt.ge...
[ [ "torch.cat", "torch.acos", "torch.stack", "torch.where", "torch.sum", "matplotlib.pyplot.get_current_fig_manager", "torch.norm", "numpy.arange", "torch.zeros_like", "torch.Tensor", "torch.zeros", "torch.cos", "torch.min", "matplotlib.pyplot.figure", "tor...
shabie/vit-pytorch
[ "30b37c4028da42dbed259c309595d8d32fe1acea" ]
[ "vit_pytorch/rvt.py" ]
[ "from math import sqrt, pi, log\n\nimport torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\n\nfrom einops import rearrange, repeat\nfrom einops.layers.torch import Rearrange\n\n# rotary embeddings\n\ndef rotate_every_two(x):\n x = rearrange(x, '... (d j) -> ... d j', j = 2)\n x1, x2 = x.un...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LayerNorm", "torch.stack", "torch.nn.Dropout", "torch.nn.Softmax", "torch.einsum", "torch.nn.ModuleList", "torch.nn.functional.gelu", "torch.linspace", "torch.randn" ] ]
agoel00/LowFER
[ "4723cb12e1d89c58621ec34c4eb5221c1b51d018" ]
[ "model_conv.py" ]
[ "# -*- codingL utf-8 -*-\n\nimport numpy as np\nimport torch.nn as nn\nimport torch\n\nclass LowFER(nn.Module):\n def __init__(self, d, d1, d2, **kwargs):\n super(LowFER, self).__init__()\n \n self.E = nn.Embedding(len(d.entities), d1, padding_idx=0)\n self.R = nn.Embedding(len(d.rela...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.nn.Dropout", "torch.sigmoid", "torch.nn.AvgPool1d", "torch.sign", "torch.mm", "torch.abs", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "numpy.random.uniform", "torch.nn.BCELoss", "torch.nn.init.xavier_nor...
HM-SYS/Hackathon2018
[ "9cac5db855f8ca7c4a65061eba4a2e9ab60721b9" ]
[ "test/performance_test.py" ]
[ "# -*- coding: utf-8 -*-\nimport unittest\nimport time\n\nimport numpy as np\n\nfrom agent import Agent\nfrom functions import BG, FEF, LIP, PFC, Retina, SC, VC, HP, CB\nfrom oculoenv import Environment\nfrom oculoenv import PointToTargetContent, ChangeDetectionContent, OddOneOutContent, VisualSearchContent, \\\n ...
[ [ "numpy.array", "numpy.random.uniform" ] ]
derrickeckardt/mlmagic
[ "85ba9d02fd6d9fb6d5f02a2cc17ddce578b4bee2" ]
[ "data.py" ]
[ "#!/usr/bin/env python3\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\n\n# create data sets\ndef create_column_class(dataset, classcolumn, headers, index_column):\n \n # Read in Datafile\n missing_values = get_missing_values()\n raw_data = pd.read_csv(dataset,...
[ [ "pandas.read_csv" ] ]
Dranero/NeuroEvolution-CTRNN_new
[ "19751b1511cebe59c7605ba97737530b69861088" ]
[ "neuro_evolution_ctrnn/tools/env_handler.py" ]
[ "import gym\nimport pybullet_envs # unused import is needed to register pybullet envs\nimport gym_memory_environments\nimport logging\nfrom gym.wrappers.atari_preprocessing import AtariPreprocessing\nfrom tools.configurations import EpisodeRunnerCfg, ReacherMemoryEnvAttributesCfg, AtariEnvAttributesCfg\nfrom tools...
[ [ "numpy.array", "numpy.asarray" ] ]
JiangFeng07/feng-python-apply
[ "1dec2d518ea257467c9b253981cfc281d7ac108a" ]
[ "feng-ml-tf/src/DataSetExample.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Author: lionel\n\nimport tensorflow as tf\n\nfilepath = '/tmp/ner_data_test'\n\ndef gen():\n with tf.gfile.GFile(filepath, 'r') as f:\n lines = [line.strip().split(' ') for line in f]\n index = 0\n while True:\n label = lines[inde...
[ [ "tensorflow.data.Dataset.range", "tensorflow.random_uniform", "tensorflow.Session", "tensorflow.TensorShape", "tensorflow.gfile.GFile", "tensorflow.constant" ] ]
IMvision12/keras-io
[ "44997b0610db078e1109d0dbca58db8319dbc744" ]
[ "examples/vision/object_detection_using_vision_transformer.py" ]
[ "\"\"\"\nTitle: Object detection with Vision Transformers\nAuthor: [Karan V. Dave](https://www.linkedin.com/in/karan-dave-811413164/)\nDate created: 2022/03/27\nLast modified: 2022/03/27\nDescription: A simple Keras implementation of object detection using Vision Transformers.\n\"\"\"\n\n\"\"\"\n## Introduction\n\n...
[ [ "tensorflow.keras.layers.Add", "tensorflow.keras.utils.get_file", "tensorflow.reshape", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.shape", "matplotlib.pyplot.subplots", "tensorflow.image.extract_patches",...
kevinhkhsu/DA_detection
[ "6859cf3f195b3831c1899625122cc0487f60d05f" ]
[ "lib/layer_utils/proposal_layer.py" ]
[ "# --------------------------------------------------------\n# Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfr...
[ [ "torch.cat" ] ]
JoeBuzh/DeepWater
[ "9d01167517c91fb2024d2abbcbaa53b072c4fdbf" ]
[ "src/DataSimulation/run.py" ]
[ "# -*- encoding: utf-8 -*-\n'''\n@Filename : main.py\n@Datetime : 2020/08/19 16:12:29\n@Author : Joe-Bu\n@version : 1.0\n'''\n\nimport os\nimport sys\nfrom copy import deepcopy\nsys.path.append('../../')\nfrom datetime import datetime, timedelta\n\nimport numpy as np\nimport pandas as pd\nfrom sqlalc...
[ [ "pandas.concat", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler" ] ]
xfzlun/WinUIAutomation
[ "0f94388671cf0aacbc8499293b7dd31ddfa205fa" ]
[ "cutAutomation.py" ]
[ "#-*- coding:utf-8 -*-\n\nimport cv2\nimport os\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport imutils\n\n'''\n1. 辨识BIOS光标位置 两个方案:1. 颜色识别,2. 轮廓识别\n'''\n\npicPath = \"C:\\\\Users\\\\Laurence_SZH\\\\Pictures\\\\Camera Roll\\\\201124183637.BMP\"\nfullPath = os.path.expanduser(picPath)\nprin...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.ion", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imshow" ] ]
doncat99/zvt
[ "689aed45bab9e691566b308d2778170a0b3950ec" ]
[ "zvt/analysis/models/drl_agent_models.py" ]
[ "# common library\nimport pandas as pd\nimport numpy as np\nimport time\nimport gym\n\n# RL models from stable-baselines\n#from stable_baselines3 import SAC\n#from stable_baselines3 import TD3\n\nfrom stable_baselines3.dqn import MlpPolicy\nfrom stable_baselines3.common.vec_env import DummyVecEnv\n\nfrom zvt import...
[ [ "numpy.ones", "numpy.zeros" ] ]