repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
marchcarax/Portfolio-stats
[ "0c52ac18d376e1adbb226fe8c41caf9573c6c517" ]
[ "PredictiveModels/Arima_Model.py" ]
[ "import src.price_calcs\nimport src.arima_calcs\nimport pandas as pd\nimport statsmodels.api as sm\nimport matplotlib.pyplot as plt\n\ndef main():\n\n #Reads csv file and takes the data we need, in this case Adjusted Close prices\n #and divide in train and test db\n series = pd.read_csv('PredictiveModels\\...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
AakashKumarNain/addons
[ "eab8deae0e6d4d33e87a748b6fa3233fd21c97cc" ]
[ "tensorflow_addons/image/transform_ops.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.shape", "tensorflow.zeros", "tensorflow.ones", "tensorflow.constant", "tensorflow.math.sin", "tensorflow.name_scope", "tensorflow.math.cos" ] ]
yizt/crnn.pytorch
[ "2f626841f35c8f69a23518ee2496554cac080cff" ]
[ "crnn.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n @File : crnn.py\n @Time : 2019/12/2 下午8:21\n @Author : yizuotian\n @Description :\n\"\"\"\n\nfrom collections import OrderedDict\n\nimport torch\nfrom torch import nn\n\n\nclass CRNN(nn.Module):\n def __init__(self, num_classes, **kwargs):\n super(CRNN, self)._...
[ [ "torch.nn.Linear", "torch.nn.GRU", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.squeeze" ] ]
espoirMur/medical-image-captionning
[ "05d23a811d800fa73ef5196e649323d060ac27a1" ]
[ "src/models/train_model.py" ]
[ "import time\nimport json\nimport math\nimport mlflow\nfrom numpy import dtype, hypot\nimport pandas as pd\nfrom pathlib import Path\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data\nimport numpy as np\nimport torchvision.transforms as transforms\nfrom torch import embedding, nn\nf...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader" ] ]
renyi533/ULTRA
[ "f22b178115e25b8cfcd4c02097f5e9eab4cbc021" ]
[ "ultra/learning_algorithm/base_algorithm.py" ]
[ "\"\"\"The basic class that contains all the API needed for the implementation of an unbiased learning to rank algorithm.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport os\nimport random\nimport sys\nimport tensorflo...
[ [ "tensorflow.exp", "tensorflow.zeros", "tensorflow.shape", "tensorflow.concat", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.ones_like", "tensorflow.math.minimum", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.math.sign", "tensorflow.variab...
melodieboillet/flashtorch
[ "d36768a96bde87241f5f158c8e3ca2d706c72bc4" ]
[ "tests/test_utils.py" ]
[ "import pytest\n\nfrom os import path\nfrom PIL import Image\n\nimport numpy as np\nimport torch\n\nfrom flashtorch.utils import (load_image,\n apply_transforms,\n denormalize,\n standardize_and_clip,\n ...
[ [ "torch.zeros", "torch.randint", "numpy.random.uniform" ] ]
khuang110/GamestonkTerminal
[ "98ac22eef1b61de73b4056debc128b66f520ffb9" ]
[ "gamestonk_terminal/cryptocurrency/crypto_controller.py" ]
[ "__docformat__ = \"numpy\"\n\nimport argparse\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom prompt_toolkit.completion import NestedCompleter\nfrom gamestonk_terminal import feature_flags as gtff\nfrom gamestonk_terminal.helper_funcs import get_flair\nfrom gamestonk_terminal.menu import session\nfrom g...
[ [ "pandas.DataFrame", "matplotlib.pyplot.close" ] ]
wesen/FastMaskRCNN
[ "bdae07702acccd85803e658f5e49690981efcdb2" ]
[ "unit_test/preprocessing_test.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\nimport numpy as np\nimport sys\nimport os\nimport tensorflow as tf \nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n\nimport libs.preprocessings.coco_v1 as coco_preprocess\nimport libs.configs.config_v1 as cfg\n\nih, iw, ic = 400,500, 3\nN = 3\nimage = np....
[ [ "numpy.zeros", "numpy.round", "numpy.sum", "tensorflow.Session", "tensorflow.constant", "numpy.random.randint", "numpy.hstack" ] ]
mayank-mst/Xtraction
[ "cab10ccce93ad844952e534c4fe2456a06556633" ]
[ "textractdemomain.py" ]
[ "import os\nimport cv2\nimport PyPDF2 \nimport textract\nimport fpdf\nimport numpy as np\nimport pytesseract\nfrom PIL import Image\n#from nltk.tokenize import word_tokenize\n#from nltk.corpus import stopwords\nimport pandas as pd\nimport re\n\n#file Path\nsrc_path = \"D:\\\\Documents\\\\MiniProject\\\\New folder\\...
[ [ "numpy.ones" ] ]
bbrighttaer/irelease
[ "632e204436027fe30c2a3a22a1040fc0cd996a94" ]
[ "proj/internal_diversity.py" ]
[ "# Author: bbrighttaer\n# Project: irelease\n# Date: 7/15/2020\n# Time: 11:59 AM\n# File: internal_diversity.py\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport numpy as np\nimport rdkit.Chem as Chem\nfrom rdkit import DataStructs\nfrom rdkit.Chem import AllChem\n\n\nd...
[ [ "numpy.mean" ] ]
choyingw/GAIS-Net
[ "ee4192976ff37b30e8c442dc17cadbcbdade0ba0" ]
[ "maskrcnn_benchmark/modeling/roi_heads/mask_head/inference.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nfrom maskrcnn_benchmark.layers.misc import interpolate\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\n\nclass MaskPostProcessor(nn.Module):\n \"\"\"\n From the results of the CNN, post process the masks\n by taking the mask corres...
[ [ "torch.zeros", "torch.cat", "numpy.array", "torch.stack", "torch.arange", "torch.zeros_like" ] ]
mitjanikolaus/EGG
[ "bbc0ae49ea3e214d969e2c7af1d1e03b7fd56e43" ]
[ "egg/zoo/language_bottleneck/guess_number/features.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\nimport numpy as np\nimport torch\nimport torch.nn.parallel\nimport torch.utils.data as data\n\n\ndef sender_receiver_examples(example...
[ [ "numpy.zeros", "numpy.random.RandomState", "numpy.copy", "torch.from_numpy", "numpy.bitwise_and", "numpy.random.randint" ] ]
ChrisHad/algorithm-reference-library
[ "bded1b62ea801ea4f4f5bd0794c18cd81d4b2810" ]
[ "tests/workflows/test_calibrate_serial.py" ]
[ "\"\"\"Unit tests for pipelines expressed via dask.delayed\n\n\n\"\"\"\n\nimport logging\nimport sys\nimport unittest\n\nimport numpy\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\n\nfrom data_models.polarisation import PolarisationFrame\nfrom workflows.serial.calibration.calibration_ser...
[ [ "numpy.max", "numpy.array", "numpy.power", "numpy.abs", "numpy.linspace" ] ]
shingtgen/OG-USA
[ "b0db1ee158944d023ea2b9fc139873f1a24001c4" ]
[ "ogusa/deterministic_profiles.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\nfrom linearmodels import PanelOLS\nimport ogcore # import just for MPL style file\n\n# Create directory if output directory does not already exist\ncur_path = os.path.split(os.path.abspath(__file__))[0]\noutput_fldr = \"csv_outpu...
[ [ "pandas.DataFrame.from_dict", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.arange", "pandas.pivot_table" ] ]
ckmganesh/Visual-Question-Answering-Flask-Application
[ "3fed82c142a5b4d926dbd78324c72d1b63c2c94a" ]
[ "VQA_main.py" ]
[ "import numpy as np\nimport pandas as pd\nimport re\nimport glob\nfrom flask import Flask, request, render_template, url_for\nfrom flask_cors import CORS\nfrom werkzeug.utils import secure_filename\nimport os\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\nimport tensorflow as tf\nimport silence_tensorf...
[ [ "tensorflow.keras.preprocessing.sequence.pad_sequences", "tensorflow.keras.layers.Input", "tensorflow.config.experimental.set_memory_growth", "tensorflow.keras.models.load_model", "pandas.Series", "tensorflow.config.experimental.list_physical_devices" ] ]
x-hacker/pkuseg-python
[ "15801afe97cb4f450a196335b38d83e1b29a3e59" ]
[ "pkuseg/viterbi.py" ]
[ "import numpy as np\nimport math\n\nclass decisionNode:\n def __init__(self):\n self._preY = -1\n self._maxPreScore = -1\n self._maxNowScore = -1\n self._initCheck = False\n\nclass Viterbi:\n def __init__(self ,w, h):\n self._w = w\n self._h = h\n self._nodeSco...
[ [ "numpy.zeros" ] ]
zmlabe/AMIP_Simu
[ "6370626fe81baf5c2280dab95fdab08a873f3a84" ]
[ "Scripts/calc_SNA_Data_Eurasia.py" ]
[ "\"\"\"\nScript calculates Eurasian snow area index for October-November following the \nmethods of Peings et al. 2017\n\nNotes\n-----\n Author : Zachary Labe\n Date : 23 July 2019\n\"\"\"\n\n### Import modules\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport read_MonthlyData as...
[ [ "numpy.empty", "numpy.zeros", "numpy.nansum", "scipy.signal.detrend", "numpy.where", "numpy.nanmean", "numpy.radians", "numpy.arange", "numpy.meshgrid", "numpy.vstack" ] ]
MohammadChalaki/morph-net
[ "83addae677195b4beba34a321ccf9c0cd55d5b62" ]
[ "morph_net/tools/configurable_ops.py" ]
[ "\"\"\"A module that facilitates creation of configurable networks.\n\nThe goal of this module is to allow centralized parameterization of a (possibly)\ncomplex deep network.\n\nAn important detail in this implementation is about the behaviour of function\ngiven a trivial parameterization. By trivial we mean the ca...
[ [ "tensorflow.compat.v1.gfile.Open", "tensorflow.compat.v1.logging.warning", "tensorflow.contrib.framework.get_name_scope" ] ]
kkanellis/MLOS
[ "f828cf2b46ed63d7c9b3bd6cef73b2027a7ad12a" ]
[ "source/Mlos.Python/mlos/OptimizerEvaluationTools/SyntheticFunctions/MultiObjectiveEnvelopedWaves.py" ]
[ "#\r\n# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT License.\r\n#\r\nimport math\r\nimport pandas as pd\r\n\r\nfrom mlos.OptimizerEvaluationTools.ObjectiveFunctionBase import ObjectiveFunctionBase\r\nfrom mlos.OptimizerEvaluationTools.SyntheticFunctions.EnvelopedWaves import EnvelopedWaves, env...
[ [ "pandas.DataFrame" ] ]
victor45664/espnet
[ "0ccacc32d25feddec5270cb3f8e08c24183755d8" ]
[ "espnet2/VC_SRC/preprocessing/cal_target_mel_kaldi_format.py" ]
[ "\nimport sys\nsys.path.append('')\nimport numpy as np\nimport os\nimport pandas as pd\nimport kaldi_io\n\nfrom espnet2.VC_SRC import melspectrogram,load_wav\nimport librosa\n\ndef load_wav(path):\n return librosa.core.load(path, sr=24000)[0]\n\n\ndef cal_mel_target(data_dir):\n wav_scp_path=os.path.join(data_d...
[ [ "pandas.read_csv" ] ]
wesm/duckdb
[ "f2fa094abc59d70a8c981d6e9f9c9c3911f08362" ]
[ "tools/pythonpkg/tests/pandas/test_timestamp.py" ]
[ "import duckdb\nimport os\nimport sys\nimport datetime\nimport pytest\nimport pandas as pd\n\nclass TestPandasTimestamps(object):\n def test_timestamp_types_roundtrip(self, duckdb_cursor):\n d = {'a': [pd.Timestamp(datetime.datetime.now(), unit='s')], 'b': [pd.Timestamp(datetime.datetime.now(), unit='ms')...
[ [ "pandas.DataFrame", "pandas.Timestamp", "pandas.Timedelta" ] ]
TiagoFilipeSousaGoncalves/web-scrapping-project
[ "06a308a453c81a7fd7b39bda6b783683bdf2c3a0" ]
[ "code/chexpert_generate_results_plots.py" ]
[ "# Imports\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\n\n# Results directory\ndirectory = os.path.join(\"results\", \"chexpert\", \"history\")\nfigs_directory = os.path.join(\"results\", \"chexpert\", \"figures\")\n\n\n# Models\nMODELS = [\"densenet121\", \"resnet50\", \"vgg16\"]\n\n# Trainin...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel" ] ]
exowanderer/exoplanet
[ "dfd4859525ca574f1936de7b683951c35c292586" ]
[ "exoplanet/theano_ops/starry/limbdark_test.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\nimport numpy as np\n\nimport theano\nimport theano.tensor as tt\nfrom theano.tests import unittest_tools as utt\n\nfrom .limbdark import LimbDarkOp\n\n\nclass TestLimbDark(utt.InferShapeTester):\n\n def setUp(self):\n super(Tes...
[ [ "numpy.zeros_like", "numpy.array", "numpy.ones_like", "numpy.linspace" ] ]
charudattapokale/Image
[ "881aaa078a400ef36906847eb23f2700ed640124" ]
[ "dataloader/datareader.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport sys\nsys.path.append('../')\nimport os\nimport random\nimport cv2\nimport matplotlib.pyplot as plt\nfrom tensorflow.python.keras.preprocessing.image import ImageDataGenerator\n\n\n\ndef read_image(path):\n \n img_path_labels_list=[os.path.join(path, img) fo...
[ [ "numpy.logical_not", "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.where", "tensorflow.python.keras.preprocessing.image.ImageDataGenerator" ] ]
space-technologies-at-california/simple-space-simulator
[ "52c0d791fed7f5804059c7680345c6865e88d247" ]
[ "simple_space_simulator/physics.py" ]
[ "import numpy as np\nimport pyIGRF\n\nimport simple_space_simulator.utils as utils\nimport simple_space_simulator.cubesat as cube\nfrom simple_space_simulator import constants\n\n\nclass Simulator:\n \"\"\"\n This class handles the step by step calculations required to simulate an orbiting body and\n the i...
[ [ "numpy.array", "numpy.dot", "numpy.sin", "numpy.linalg.norm", "numpy.zeros", "numpy.cos" ] ]
mehrdad-shokri/spartan
[ "854b26e3af75910ef57b874db7853abd4249543e" ]
[ "modules/spartan/utils/utils.py" ]
[ "__author__ = 'manuelli'\nimport numpy as np\nimport collections\nimport yaml\nfrom yaml import CLoader\nimport os\nimport datetime\nimport time\n\n# director\nfrom director import transformUtils\n\nimport spartan.utils.transformations as transformations\n\n\ndef getSpartanSourceDir():\n return os.getenv(\"SPART...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot" ] ]
cdesira/astroML
[ "503dc95945afdf7dcbe04d0e12cb4bf813bb98a5" ]
[ "astroML/filters.py" ]
[ "import numpy as np\nfrom scipy import optimize, fftpack, signal\n\n\n# Note: there is a scipy PR to include an improved SG filter within the\n# scipy.signal submodule. It should replace this when it's finished.\n# see http://github.com/scipy/scipy/pull/304\ndef savitzky_golay(y, window_size, order, deriv=0,\n ...
[ [ "numpy.dot", "scipy.signal", "numpy.exp", "numpy.mean", "numpy.iscomplexobj", "numpy.linalg.lstsq", "numpy.concatenate", "numpy.max", "scipy.signal.fftconvolve", "scipy.optimize.fmin", "scipy.fftpack.fft", "numpy.arange", "numpy.convolve", "numpy.int", "...
apostolidoum/modeling-behaviour-of-SoC-players
[ "0a97597dace9a5b279ce6644a9879894596bc59c" ]
[ "NNarchitecture/GamestatesOHE.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nTransform the gamestate data to onehot vectors\n\"\"\"\n\nfrom sklearn.preprocessing import OneHotEncoder,LabelEncoder\nimport pandas as pd \nimport numpy as np\nimport re\nimport os\nfrom pathlib import Path\n\n\n# settlements and cities are built on node c...
[ [ "pandas.read_pickle", "sklearn.preprocessing.LabelEncoder", "numpy.array", "numpy.zeros", "numpy.save", "numpy.ravel", "sklearn.preprocessing.OneHotEncoder" ] ]
Xiaoqiong-Liu/pointcloud
[ "3d77ef2896297acd103301dfa01beeee49e65057" ]
[ "models/main.py" ]
[ "import pytorch_lightning as pl\nimport argparse\nfrom dataset.KITTI import KITTI\nfrom dataset.KITTISampler import KITTISampler\nfrom torch.utils.data import DataLoader\nfrom bat import bat\nimport yaml\nfrom easydict import EasyDict\n\nkitti_path = '/mnt/Data/KITTI'\n\ndef load_yaml(file_name):\n with open(fil...
[ [ "torch.utils.data.DataLoader" ] ]
btilmon/illumiGrad
[ "14d17d18ed1cde1bd8d948003f6d188ce71cf7ef" ]
[ "camera.py" ]
[ "import torch\nimport numpy as np\nimport sys\n\nclass BackprojectDepth(torch.nn.Module):\n \"\"\"\n Backproject absolute depth from depth camera to point cloud\n (adapted from https://github.com/nianticlabs/monodepth2)\n \"\"\"\n def __init__(self, opt):\n super(BackprojectDepth, self).__init...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.ones", "torch.nn.Parameter", "torch.linalg.pinv", "torch.tensor", "torch.nn.functional.grid_sample", "torch.eye", "torch.linalg.inv", "numpy.stack", "torch.matmul" ] ]
RICE-EIC/GCoD
[ "6633859513e56b8843c4d6486e214364a0a4c74c" ]
[ "models/global_gat_conv.py" ]
[ "from typing import Union, Tuple, Optional\nfrom torch_geometric.typing import (OptPairTensor, Adj, Size, NoneType,\n OptTensor)\n\nimport torch\nfrom torch import Tensor\nimport torch.nn.functional as F\nfrom torch.nn import Parameter, Linear\nfrom torch_sparse import SparseTenso...
[ [ "torch.nn.Linear", "torch.nn.functional.dropout", "torch.Tensor", "torch.nn.functional.leaky_relu" ] ]
bds-ailab/logflow
[ "dfd9e40864494bcfe15f4c1d5a1c72b8a7b67410" ]
[ "logflow/logsparser/Embedding.py" ]
[ "# Copyright 2020 BULL SAS All rights reserved #\nimport word2vec # type: ignore\nimport os\nimport h5py # type: ignore\nfrom loguru import logger\nimport tempfile\nfrom multiprocessing import Pool\nfrom collections import Counter\nimport pickle\nfrom tqdm import tqdm # type: ignore\nimport time\nimport numpy as np...
[ [ "numpy.isin" ] ]
jamo1011/hat
[ "ffda7c9eb6d45671ca36eb6f2fdfbf856626d8df" ]
[ "gps/gpstest.py" ]
[ "\nimport gps\nimport numpy as np\n\n# Listen on port 2947 (gpsd) of localhost\nsession = gps.gps(\"localhost\", \"2947\")\nsession.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)\n\nlats = np.array([])\nlons = np.array([])\n\nfor i in range(20):\n try:\n report = session.next()\n # Wait for a 'TPV' ...
[ [ "numpy.array", "numpy.means", "numpy.mean", "numpy.append" ] ]
Panxjia/SPA_CVPR2021
[ "32bf2d5d9a49176a32b64b88eef9ea4a6a24d925" ]
[ "utils/list_factory.py" ]
[ "import os\nimport numpy as np\nimport xml.etree.ElementTree as ET\n\n\ndef cub():\n IMAGE_LIST_FILE = '../data/CUB_200_2011/images.txt'\n IMAGE_LABEL_FILE = '../data/CUB_200_2011/image_class_labels.txt'\n BOX_FILE = '../data/CUB_200_2011/bounding_boxes.txt'\n SPLIT_FILE = '../data/CUB_200_2011/train_te...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.where", "numpy.unique" ] ]
xrazis/university
[ "925bce38fa4d3a9cc013cfa6d7f1de26227cc38f" ]
[ "imageProcessing/lab2/part2.py" ]
[ "import cv2 as cv\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom skimage.util import random_noise\n\n\ndef compare_images(image_1, image_2):\n diff = image_1 - image_2\n return np.count_nonzero(abs(diff))\n\n\n# Read the image and convert to b&w\nimg = cv.imread('me-ktm.jpg', 0)\n\n# Detect e...
[ [ "matplotlib.pyplot.show", "numpy.absolute", "matplotlib.pyplot.imshow" ] ]
flourscent/DLFS_code
[ "173d72884cea4609957cb3f38557a2cacbf8df03" ]
[ "lincoln/lincoln/losses.py" ]
[ "import numpy as np\nfrom numpy import ndarray\n\nfrom lincoln.utils.np_utils import (assert_same_shape,\n softmax,\n normalize,\n #exp_ratios,\n unnormalize)\n\n\nclass Loss(object):\n\n def __init__(self):\n pass\n\n...
[ [ "numpy.max", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.stack", "numpy.power", "numpy.clip" ] ]
phareskrad/seizure-detection
[ "01da41fd0006afddda0bc87e1a7613c73d37a712" ]
[ "seizure/models.py" ]
[ "import numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nimport xgboost as xgb\nfrom keras.models import Sequential\nfrom common.utils.generator import dict_generator\nfrom common.classifiers import Model\n\n\nclass RandomForest(Model):\n def __init__(self, name, **params):\n super(Random...
[ [ "sklearn.ensemble.RandomForestClassifier", "numpy.arange", "numpy.random.shuffle" ] ]
mandy0104/ada-job-shop
[ "e9127eae7d5ce788d27af85ceb2aaefaf2918844" ]
[ "model.py" ]
[ "import os\nimport copy\nimport math\nimport numpy as np\nimport gurobipy as gp\nfrom gurobipy import GRB\n\n\ndef save_checkpoint(model, where):\n try:\n model_check_point = np.array([abs(var.x) for var in model.getVars()])\n np.save(os.path.join(\"sol\", model.ModelName), model_check_point)\n ...
[ [ "numpy.max", "numpy.array", "numpy.empty", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.load", "numpy.arange" ] ]
amznero/graph-learn
[ "77bd92f960e4d178a3606444684f7f04c7f5b738" ]
[ "graphlearn/python/tests/test_node.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...
[ [ "numpy.array" ] ]
safooray/tensor_factorization_mtl
[ "9d8257db6b54b202ad51fcc632573f1dc5e4bcb9" ]
[ "survival_mtl.py" ]
[ "import sys\nsys.path.append('../TranSurvivalNet')\nfrom IPython import embed\nfrom losses.tf_cox_loss import cox_loss\nfrom survival_analysis import calc_at_risk, c_index\nfrom utils.data_utils import load_pca_npy_data\nfrom utils.data_utils import pca \n\nimport numpy as np\nimport os\nimport tensorflow as tf\nsl...
[ [ "tensorflow.zeros", "tensorflow.Graph", "tensorflow.Session", "tensorflow.truncated_normal", "numpy.stack", "numpy.transpose", "tensorflow.placeholder", "tensorflow.device", "tensorflow.nn.xw_plus_b", "tensorflow.global_variables_initializer", "tensorflow.train.Gradient...
ckmah/scanpy
[ "300435f30f6805e27ba59a7314fe06ef21d03c17" ]
[ "scanpy/tools/louvain.py" ]
[ "\"\"\"Cluster cells using Louvain community detection algorithm.\n\nUses the pip package \"louvain\" by V. Traag.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom natsort import natsorted\nfrom .. import utils\nfrom .. import settings\nfrom .. import logging as logg\nfrom ..data_structs.data_graph import a...
[ [ "numpy.array", "numpy.unique" ] ]
ningning-718/DeepCamera
[ "b2788a884996fd7761f48fbf59094b0375e3df96" ]
[ "src/yolo_detector/work.py" ]
[ "# coding=utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport json\nimport time\n\nfrom celery import Celery\nfrom celery.signals import worker_process_init\nfrom celery.concurrency import asynpool\nfrom yolo import Yolo\nfrom fa...
[ [ "scipy.misc.imread" ] ]
dcs4cop/xcube-cci
[ "81aab9b30bb00306f783ce2f2f79cb8fab54758d" ]
[ "xcube_cci/chunkstore.py" ]
[ "# The MIT License (MIT)\n# Copyright (c) 2021 by the xcube development team and contributors\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including withou...
[ [ "pandas.to_datetime", "numpy.max", "numpy.array", "pandas.Timestamp.now", "numpy.prod" ] ]
viathor/OpenFermion-Cirq
[ "b4b7f8d82c40f0a6282873b5d2867e9d8778cea6" ]
[ "openfermioncirq/primitives/optimal_givens_decomposition.py" ]
[ "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distr...
[ [ "numpy.angle", "numpy.isclose", "numpy.diag", "numpy.real" ] ]
lindlind/ITMO_FS
[ "8662b67a98bceaac800ccc8ea3230cc9f9a250e1" ]
[ "ITMO_FS/ensembles/model_based/best_sum.py" ]
[ "import numpy as np\n\n\nclass BestSum: ## TODO refactor , not stable\n\n def __init__(self, models, cutting_rule):\n self.models = models\n self.cutting_rule = cutting_rule\n self.features = None\n\n def fit(self, x, y, feature_names=None):\n try:\n feature_names = x.c...
[ [ "numpy.zeros" ] ]
TAMUSFC/H5HutAccessor
[ "0d5495b07dcb912a2e8cdc740e93628fd16508aa" ]
[ "H5HutAccessor/__init__.py" ]
[ "\"\"\"\nUtilities for dealing with H5Hut files generated by OPAL\n\"\"\"\nimport os\nimport pathlib\nfrom datetime import datetime\nfrom functools import lru_cache\n\nimport h5py\nimport numpy as np\nfrom scipy.signal import argrelmin\nfrom matplotlib import pyplot as plt\nfrom matplotlib.gridspec import GridSpec\...
[ [ "numpy.isclose", "matplotlib.pyplot.xlim", "numpy.nanmean", "scipy.signal.argrelmin", "numpy.cumsum", "numpy.cos", "numpy.full", "numpy.sin", "numpy.linalg.norm", "matplotlib.pyplot.colorbar", "numpy.sqrt", "numpy.ndim", "numpy.isfinite", "matplotlib.pyplot....
tangunner/python-trading-robot
[ "358fbfb3ca95cb423b2fb4223481d2ac2c77b9f4" ]
[ "pyrobot/portfolio.py" ]
[ "import numpy as np\nfrom datetime import datetime, timedelta\n\nimport pandas as pd\n\nfrom pandas import DataFrame\nfrom typing import Tuple\nfrom typing import List\nfrom typing import Optional\n\n\nfrom pyrobot.stock_frame import StockFrame\nfrom td.client import TDClient\n\n\nclass Portfolio():\n\n def __in...
[ [ "pandas.DataFrame.from_dict", "numpy.array", "numpy.dot" ] ]
liuhuaijjin/epnet_det3d_rcnn_reg_dir_cls_iou3d_loss
[ "0123c341243846aa3b412addcb9e2c07fd305237" ]
[ "lib/utils/roipool3d/roipool3d_utils.py" ]
[ "import torch\nimport roipool3d_cuda\nimport numpy as np\nimport lib.utils.kitti_utils as kitti_utils\n\n\ndef roipool3d_gpu(pts, pts_feature, boxes3d, pool_extra_width, sampled_pt_num = 512):\n \"\"\"\n :param pts: (B, N, 3)\n :param pts_feature: (B, N, C)\n :param boxes3d: (B, M, 7)\n :param pool_e...
[ [ "numpy.concatenate", "torch.Size", "torch.cat", "torch.from_numpy", "torch.LongTensor" ] ]
BYU-PRISM/Grid-Energy-Management
[ "a10c6f9a9bbd9a8a8a44dc0b42fb7bd923d33cd0" ]
[ "gekko_load_follow.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 26 09:28:49 2021\n\n@author: nathanielgates\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport utilities as util\nimport feasibility as fs\nfrom gekko import GEKKO\n\n\ndef model(t, plot=False, disp...
[ [ "matplotlib.pyplot.gca", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.cos", "pandas.concat", "matplotlib.pyplot.show", "numpy.linspace", ...
gradientinstitute/ai-impact-control-panel
[ "4a00a8d8f731344b9f5599ec40748ba5b79d7904" ]
[ "deva/pareto.py" ]
[ "\"\"\"\nModule to filter pareto inefficient candidates.\n\nCopyright 2021-2022 Gradient Institute Ltd. <info@gradientinstitute.org>\n\"\"\"\n\nimport numpy as np\n\n\ndef remove_non_pareto(models):\n \"\"\"Reduces the set of models down to the efficient set.\"\"\"\n n = len(models)\n dominated = np.zeros(...
[ [ "numpy.zeros" ] ]
Emilurenius/Pool-Table-RGB
[ "209ca77b21e5fe487c65488a8b77afbd7d9982da" ]
[ "imageRecognition/testCode/colorDetection.py" ]
[ "import cv2, numpy as np\n\ndef empty(a):\n pass\n\npath = \"resources/lambo.png\"\n\ncv2.namedWindow(\"TrackBars\")\ncv2.resizeWindow(\"TrackBars\",640,240)\ncv2.createTrackbar(\"Hue Min\",\"TrackBars\",0,179,empty)\ncv2.createTrackbar(\"Hue Max\",\"TrackBars\",19,179,empty)\ncv2.createTrackbar(\"Sat Min\",\"Tr...
[ [ "numpy.array" ] ]
aws-samples/aws-sagemaker-byoc-end2end
[ "86052e858c1333757a878e73c9067a0314b9918f" ]
[ "processing/create_dataset.py" ]
[ "import argparse\nimport pathlib\nimport json\nimport pandas as pd\nimport numpy as np\nimport os\n\n# Parse argument variables passed via the CreateDataset processing step\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--athena-data\", type=str)\nargs = parser.parse_args()\n\ndataset = pd.read_parquet(...
[ [ "pandas.read_parquet" ] ]
Jayanth-kumar5566/pyro
[ "a98bb57e1704997a3e01c76a7820c0b1db909ee3" ]
[ "examples/lkj.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport argparse\n\nimport torch\n\nimport pyro\nimport pyro.distributions as dist\nfrom pyro.infer.mcmc import NUTS\nfrom pyro.infer.mcmc.api import MCMC\n\n\"\"\"\nThis simple example is intended to demonstrate how to use ...
[ [ "torch.zeros", "torch.randn", "torch.multiprocessing.set_sharing_strategy", "torch.ones" ] ]
takehuge/PYQUM
[ "bfc9d9b1c2f4246c7aac3a371baaf587c99f8069" ]
[ "TEST/FACE/pyqum/instrument/machine/TKAWG.py" ]
[ "# Communicating with Benchtop TKAWG (Tektronix AWG)\nfrom colorama import init, Fore, Back\ninit(autoreset=True) #to convert termcolor to wins color\n\nfrom os.path import basename as bs\nmdlname = bs(__file__).split('.')[0] # module's name e.g. PSG\n\nimport pyvisa as visa\nfrom pyqum.instrument.logger import add...
[ [ "numpy.array", "numpy.ceil" ] ]
sculmh/pytorch-deeplab-xception
[ "4dd5e16a389cf686aa61b4c640eb68c1ff1f97d0" ]
[ "modeling/backbone/xception_gn.py" ]
[ "# -*- coding: utf-8 -*-\nimport math\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef fixed_padding(inputs, kernel_size, dilation):\n kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)\n pad_total = kernel_size_effective - 1\n pad_beg = pad_total // 2\n pad_end = p...
[ [ "torch.rand", "torch.nn.Sequential", "torch.nn.GroupNorm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.pad" ] ]
Jeffrey-Ede/adaptive-scans
[ "a4f8f0275d5f894c34f7ae9bbd64222f635fb73e" ]
[ "dnc/dnc.py" ]
[ "# Copyright 2017 Google Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicab...
[ [ "tensorflow.ones", "tensorflow.reshape", "tensorflow.clip_by_value", "numpy.cos", "tensorflow.tile", "tensorflow.tanh", "numpy.sin", "tensorflow.concat", "tensorflow.TensorShape", "numpy.sqrt", "tensorflow.contrib.framework.nest.map_structure", "tensorflow.abs", ...
ruyueshuo/YOLOv4_Deployment
[ "b5c2c9c949b367b57a1e5f5c489b247ddaf44c83" ]
[ "split_datasets.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 2020/11/13 16:26\n# @Author : ruyueshuo\n# @File : split_datasets.py\n# @Software: PyCharm\nimport os\nimport random\n\n\ndef split_datasets(image_path, save_path, ratio=0.8, seed=41, name=None):\n \"\"\"\n Split dataset to train and validation...
[ [ "numpy.concatenate" ] ]
koki0702/chainer
[ "62c800e610ef37bffdcd32334d24a120a0641b8c" ]
[ "tests/chainer_tests/test_variable.py" ]
[ "import copy\nimport inspect\nimport platform\nimport re\nimport sys\nimport unittest\n\nimport mock\nimport numpy as np\nimport six\n\nimport chainer\nfrom chainer import cuda\nimport chainer.functions as F\nfrom chainer import initializers\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chain...
[ [ "numpy.full", "numpy.array", "numpy.ones_like", "numpy.empty", "numpy.zeros_like", "numpy.zeros", "numpy.random.rand", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.random.randn", "numpy.mean", "numpy.ndarray", "numpy.float32", "numpy.prod", "...
rgerkin/Scoreboard
[ "e072c8cecc1160509a1d2549a0185d6eba234001" ]
[ "Scoreboard19/datagrab.py" ]
[ "\"\"\"Functions for getting and analyzing data.\"\"\"\n\nimport scipy.interpolate\nimport pandas as pd\nimport numpy as np\nfrom datetime import date, datetime, timedelta\nimport os\nfrom urllib.parse import quote\nfrom . import paths\n\n\ndef read_observed(kind, writetocsv: bool = False, use_cache: bool = False)-...
[ [ "pandas.read_csv" ] ]
asuiconlab/psiz
[ "4f05348cf43d2d53ff9cc6dee633de385df883e3" ]
[ "examples/rank/vi_3ge.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 The PsiZ 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....
[ [ "numpy.max", "numpy.array", "numpy.empty", "matplotlib.cm.get_cmap", "numpy.min", "matplotlib.pyplot.rc", "matplotlib.pyplot.figure", "tensorflow.keras.initializers.RandomNormal", "numpy.argmax", "numpy.arange", "tensorflow.keras.losses.CategoricalCrossentropy", "te...
TarapongSrisongkram/paccmann_kinase_binding_residues
[ "83ae7be5f9883215da41958a8cbdf0a9d6739083" ]
[ "scripts/knn_cv.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nEvaluate lazy KNN baseline predictor in a Cross-Validation setting.\nAssumes that ligand_fp and kinase_fp contain all molecules and kinases that\nare used in training and testng dataset.\n\n\"\"\"\nimport argparse\nimport json\nimport logging\nimport os\nimport sys\nfrom typing impo...
[ [ "numpy.ceil", "sklearn.metrics.mean_squared_error", "pandas.DataFrame", "scipy.stats.spearmanr", "numpy.mean", "scipy.stats.pearsonr" ] ]
gianscarpe/udacity_deep_reinforcement_learning
[ "c45a95f27f8ebf38afa7fed6f718691ae86d5d46" ]
[ "p3_collab-compet/model.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Actor(nn.Module):\n def __init__(self, state_size, action_size, fc1=256, fc2=128, leak=0.01, seed=0):\n \"\"\" Initialize parameters and build model.\n\n Params\n ======\n state_si...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.kaiming_normal_", "torch.manual_seed", "torch.nn.BatchNorm1d", "torch.nn.init.uniform_" ] ]
Flash-Tang/MARL-Env
[ "ef40d95ba9e9b93d620009ef899c6b2e83680eee" ]
[ "smac/examples/run_mn.py" ]
[ "from smac.env import StarCraft2Env\nimport numpy as np\n\nfrom mininet.topo import Topo, SingleSwitchTopo\nfrom mininet.net import Mininet\nfrom mininet.log import lg, info\nfrom mininet.cli import CLI\n\nfrom threading import Thread\nfrom mlp import Mlp\n\nimport time\n\n\nclass simpleMultiLinkTopo(Topo):\n \"...
[ [ "numpy.array", "numpy.nonzero" ] ]
tarrade/proj_NLP_text_classification_with_GCP
[ "ac09d6dbf8c07470d03cfb8140a26db7cd5bef9f" ]
[ "src/utils/evaluation.py" ]
[ "\"\"\"\nCreated on Wed Nov 7 2018\n\n@author: Renato Durrer renato.durrer@axa-winterthur.ch\n Fabien Tarrade fabien.tarrade@axa.ch\n\"\"\"\nimport itertools\nfrom sklearn.metrics import (log_loss, f1_score, accuracy_score, average_precision_score, precision_score,\n recall_score...
[ [ "sklearn.metrics.precision_score", "numpy.mean", "sklearn.metrics.average_precision_score", "pandas.concat", "sklearn.metrics.r2_score", "sklearn.metrics.f1_score", "matplotlib.pyplot.xticks", "sklearn.model_selection.learning_curve", "matplotlib.pyplot.colorbar", "pandas.D...
amanhari-projects/Satellite-image-road-extraction
[ "92f29f7245d44b982c295358f344952cdb5389f9" ]
[ "data.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\nimport glob\r\nimport os\r\n\r\nREQ_W = 224\r\nREQ_H = 224\r\nTRAIN_IMAGES_INPUT_PATH = 'road_segmentation_ideal/training/input/'\r\nTRAIN_IMAGES_OUTPUT_PATH = 'road_segmentation_ideal/training/output/'\r\n\r\n# function to load the dataset\r\n...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
wep21/jetson-containers
[ "0071a4bd3f2f5235c99eb5fb71486d461d9e8774" ]
[ "test/test_numpy.py" ]
[ "\nprint('testing numpy...')\nimport numpy as np\n\nprint('numpy version: ' + str(np.__version__))\nprint(np.show_config())\n\nprint('numpy OK\\n')\n" ]
[ [ "numpy.show_config" ] ]
ademirmarquesjunior/multilooking_linear_solving
[ "98e01beb3c48093680195099f00545fc3dc91e39" ]
[ "multilooking_linear_solving.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 17 15:47:16 2021\n\n@author: adeju\n\"\"\"\n\n\nimport numpy as np\n\nnum_images = 9\nsquared_size = int(np.sqrt(num_images))\nimage = np.zeros((num_images, 500, 500), dtype=np.uint8)\nimage_out = np.zeros((num_images, 3*500, 3*500), dtype=np.uint8)\n\n# Create i...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.shape", "numpy.where", "numpy.sort", "numpy.sqrt", "numpy.size", "numpy.fromstring" ] ]
cfont03/Anomaly-breast-cancer-detection
[ "d0fca05747b30afb546fe55ba3851883d99eb34f" ]
[ "src/preprocess/utils/vertical_flip.py" ]
[ "import cv2\nimport numpy as np\nfrom pathlib import Path\nimport os\n\ndef vertical_flip (info_file, display = False):\n\n ''' \n \n Function to apply a vertical flip to the images\n\n Params:\n 0: reference number\n 1: features\n 2: size\n 3: class\n 4: x_coordinate of the abnormality\n 5: y...
[ [ "numpy.array" ] ]
facebookresearch/habitat-matterport3d-dataset
[ "9c1852efca7ff3db3d46455b18c154f6b08769e5" ]
[ "scale_comparison/metrics.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nfrom typing import Any, Dict, List\n\nimport habitat_sim\nimport numpy as np\nimport scipy\nimpo...
[ [ "numpy.concatenate", "numpy.isinf", "numpy.array", "scipy.spatial.cKDTree", "numpy.linalg.norm", "numpy.isnan", "numpy.copy", "numpy.stack", "numpy.arange", "sklearn.cluster.DBSCAN", "scipy.spatial.ConvexHull", "numpy.around", "numpy.cross" ] ]
loujiabin1994/crazyswarm
[ "893325b63b3b19015fe261bfa989846a1c82dc82" ]
[ "ros_ws/src/crazyswarm/scripts/cmdFullState.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\n\nfrom pycrazyswarm import *\nimport uav_trajectory\n\n\ndef executeTrajectory(timeHelper, cf, trajpath, rate=100, offset=np.zeros(3)):\n traj = uav_trajectory.Trajectory()\n traj.loadcsv(trajpath)\n\n start_time = timeHelper.time()\n while not timeHelper.is...
[ [ "numpy.array", "numpy.zeros" ] ]
higex/qpath
[ "02db9dbf1148106a576d7b4dd7965c73607efdae" ]
[ "scripts/wsi_import_he_slide.py" ]
[ "#!/usr/bin/env python2\n\n\"\"\"\nWSI_IMPORT_SLIDE: imports a scanned slide into a structure used for image processing.\nThis structure is saved on the disk as a hierarchy of folders and files:\n\n .../original image name/\n +---- meta.xml <- meta data about the file\n ...
[ [ "numpy.arange" ] ]
Kaushal28/FOTS-PyTorch
[ "30f6180754899c7f5fb35845ab5d6f108eb1b4a8" ]
[ "trainer.py" ]
[ "import os\nfrom time import time\n\nimport torch\n\nimport numpy as np\n\nfrom tqdm import tqdm\n\nfrom utils import TranscriptEncoder, classes\n\nclass Train:\n \"\"\"\n Trainer class which defines model training and evaluation methods.\n \"\"\"\n\n def __init__(self, model, train_iterator, valid_iter...
[ [ "numpy.array", "torch.cuda.is_available", "torch.no_grad", "numpy.zeros" ] ]
Ruomei/model-optimization
[ "b6a97f26e240c39a1d4290f4639f7136168774aa" ]
[ "tensorflow_model_optimization/python/core/quantization/keras/quantize_wrapper_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array", "numpy.random.rand", "numpy.ones", "tensorflow.test.main", "tensorflow.quantization.fake_quant_with_min_max_vars" ] ]
harunpehlivan/LightGBM
[ "8ba65be9c93b79c095ea06e74de2cc5bf35ab169" ]
[ "examples/python-guide/simple_example.py" ]
[ "# coding: utf-8\n# pylint: disable = invalid-name, C0111\nimport json\nimport lightgbm as lgb\nimport pandas as pd\nfrom sklearn.metrics import mean_squared_error\n\n\n# load or create your dataset\nprint('Load data...')\ndf_train = pd.read_csv('../regression/regression.train', header=None, sep='\\t')\ndf_test = p...
[ [ "pandas.read_csv", "sklearn.metrics.mean_squared_error" ] ]
sulaimanvesal/vertebraeSegementation
[ "eafdc946d31918194a83cbd79b66569ce19127de" ]
[ "src/model/dilated_unet.py" ]
[ "\"\"\"\r\n@Author: Sulaiman Vesal\r\nDate: Tuesday, 04, 2020\r\n\r\n\r\n\"\"\"\r\nfrom torch import nn, cat\r\nfrom torch.utils.tensorboard import SummaryWriter\r\nfrom torch import rand\r\n\r\nclass Encoder(nn.Module):\r\n\r\n def __init__(self, filters=64, in_channels=3, n_block=3, kernel_size=(3, 3), batch_n...
[ [ "torch.rand", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.UpsamplingNearest2d" ] ]
flynnbr11/QMD
[ "ac8cfe1603658ee9b916452f29b99460ee5e3d44", "ac8cfe1603658ee9b916452f29b99460ee5e3d44" ]
[ "qmla/remote_bayes_factor.py", "qmla/shared_functionality/probe_set_generation.py" ]
[ "import copy\nimport pickle\nimport random\nimport time as time\nimport numpy as np\nimport os as os\nimport pandas as pd\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec\n\ntry:\n from lfig import LatexFigure\nexcept:\n from qmla.shared_functionality.latex_figure import LatexFigur...
[ [ "matplotlib.pyplot.switch_backend", "numpy.ceil", "numpy.round", "matplotlib.pyplot.savefig", "numpy.exp", "matplotlib.pyplot.subplots", "numpy.shape", "numpy.tensordot", "numpy.sqrt", "numpy.log10", "matplotlib.pyplot.figlegend", "matplotlib.gridspec.GridSpec" ],...
hari-sikchi/spinningup
[ "6098384a9cb78e3b30c777bc3d7b9bcd19d63498" ]
[ "spinup/algos/pytorch/ppo/ipo.py" ]
[ "import numpy as np\nimport torch\nfrom torch.optim import Adam\nimport gym\nimport time\nimport spinup.algos.pytorch.ppo.core as core\nfrom spinup.utils.logx import EpochLogger\nfrom spinup.utils.mpi_pytorch import setup_pytorch_for_mpi, sync_params, mpi_avg_grads\nfrom spinup.utils.mpi_tools import mpi_fork, mpi_...
[ [ "torch.min", "numpy.zeros", "numpy.random.seed", "torch.clamp", "torch.manual_seed", "numpy.append", "torch.as_tensor", "torch.exp" ] ]
brucespang/plorts
[ "78194a64128a0bba9cdf49279bcc09807df62fcf", "78194a64128a0bba9cdf49279bcc09807df62fcf" ]
[ "plorts/style.py", "examples/histogram.py" ]
[ "# Most of this is lifted from Seaborn (https://stanford.edu/~mwaskom/software/seaborn/)\n#\n# Copyright (c) 2012-2013, Michael L. Waskom\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n\n...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout" ], [ "numpy.logical_or", "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyp...
amn32/ML_implementations
[ "e54e363ac3ed19f16faf3ac47bc1c41469592bc7" ]
[ "regression/util_funcs.py" ]
[ "import numpy as np\nimport random\nimport pandas as pd\nimport os\nimport gc\nfrom sklearn.model_selection import train_test_split\n\ndef load_data(dataset, train_size = 10000, test_size = 0, standardise = False, validation_size = 0, noise = False):\n\n X_val = None\n Y_val = None\n \n if dataset == 'S...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.random.uniform" ] ]
lvclark/pyseer
[ "21ad8f2f00eb8b17e4de55a1a7f4954be7f3ddf6" ]
[ "scripts/phylogeny_distance.py" ]
[ "#!/usr/bin/env python\n# Copyright 2017 Marco Galardini and John Lees\n\n'''Extract a distance matrix from a phylogeny'''\n\n\ndef get_options():\n import argparse\n\n description = 'Extract a distance matrix from a phylogeny'\n parser = argparse.ArgumentParser(description=description)\n\n parser.add_a...
[ [ "pandas.DataFrame" ] ]
MatteoLacki/msspec
[ "587fb7dc91d5f2d3618aa4ba8a2803969a40ea97" ]
[ "msspec/__init__.py" ]
[ "try:\n import matplotlib.pyplot as plt\nexcept ModuleNotFoundError:\n plt = None\n\n\ntry:\n import plotly\nexcept ModuleNotFoundError:\n plotly = None\n\n\nprint('Setting matplotlib style to dark.')\nplt.style.use('dark_background')" ]
[ [ "matplotlib.pyplot.style.use" ] ]
yanxurui/portfolio
[ "032cf47ccac1c5815fd4827bf0d5f3cf43cec990" ]
[ "portfolio_env.py" ]
[ "import gym\nfrom gym import spaces\nimport numpy as np\nimport pandas as pd\nfrom dataset import Dataset\n\nclass PortfolioEnv(gym.Env):\n def __init__(self, features, stocks, batch_num=1, batch_size=10, window=10):\n self.features = features\n self.stocks = stocks\n self.batch_num = batch_...
[ [ "numpy.array", "numpy.zeros", "numpy.testing.assert_equal", "numpy.sum", "numpy.finfo", "numpy.clip" ] ]
michaelgzt/kaggle-digit-recognizer
[ "0e1b98f2e7f391e78950d1b55484166293aa2a24" ]
[ "dataloader.py" ]
[ "import torch\nimport pandas as pd\nimport numpy as np\nimport math\nimport time\nfrom random import shuffle, randint\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader, sampler\nfrom torchvision import transforms\n\n\n\"\"\"\nDataset for Digit Data\nand Transformation functions\n\"\...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.ones", "torch.from_numpy", "numpy.amax", "numpy.amin", "pandas.read_csv", "numpy.argwhere" ] ]
SgtVincent/Robothor-2020---VIPL-ICT
[ "5eee00c077c07e69120fb8108f574c2339688f34" ]
[ "runners/nonadaptivea3c_val.py" ]
[ "from __future__ import division\n\nimport time\nimport torch\nimport setproctitle\nimport copy\nfrom datasets.glove import Glove\nfrom datasets.prototypes import Prototype\n\nfrom datasets.robothor_data import (\n preload_metadata,\n get_curriculum_meta,\n load_offline_shortest_path_data\n)\n\nfrom models...
[ [ "torch.manual_seed", "torch.cuda.manual_seed", "torch.load" ] ]
MCG-NJU/MMN
[ "64641d12d4e1197b7378b3f786916b4cfd1a5080" ]
[ "mmn/data/datasets/evaluation.py" ]
[ "from terminaltables import AsciiTable\nfrom tqdm import tqdm\nimport logging\nimport torch\nfrom mmn.data.datasets.utils import iou, score2d_to_moments_scores\nfrom mmn.utils.comm import is_main_process\n\n\ndef nms(moments, scores, thresh):\n scores, ranks = scores.sort(descending=True)\n moments = moments[...
[ [ "torch.zeros", "torch.round", "torch.tensor", "torch.pow" ] ]
hkaneko1985/y_randomization
[ "bccb8eaf99b57ecb63dd6fe413319e0fa91bb0f4" ]
[ "demo_y_randamization.py" ]
[ "# -*- coding: utf-8 -*- \r\n# %reset -f\r\n\"\"\"\r\n@author: Hiromasa Kaneko\r\n\"\"\"\r\n# Demonstration of y-randomization\r\n\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom sklearn import datasets\r\nfrom sklearn import model_selection\r\nfrom sklearn.cross_decomposition import PLSRegress...
[ [ "sklearn.cross_decomposition.PLSRegression", "numpy.empty", "numpy.linalg.matrix_rank", "numpy.random.permutation", "numpy.ones", "numpy.min", "sklearn.datasets.make_regression", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show...
dmachalz/molpy
[ "acc026b1c1b577c7dce4ee50f6b7ad946a2a5fdd" ]
[ "molpy/util.py" ]
[ "import numpy as np\n\ndef distance(point1, point2):\n \"\"\"\n Calculate distance between two points.\n Parameters\n ----------\n point1: array_like\n The first point\n point2 : array_like\n The second point\n\n Returns\n ----------\n float\n The distance between poi...
[ [ "numpy.linalg.norm", "numpy.asarray" ] ]
fy0cc/factor-inference-net
[ "1ade2a91f5adf8f049f818183910797db56a70b4" ]
[ "factor_gnn/layers.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .mlp import MLP\n\nNDIM_HIDDEN = 64\n\n\nclass SigmoidWrapper(nn.Module):\n def __init__(self, model):\n super(SigmoidWrapper, self).__init__()\n self.model = model\n self.m = nn.Sigmoid()\n\n def forward(self, *args, **kwargs):\n return...
[ [ "torch.cat", "torch.nn.Sigmoid" ] ]
dice-group/LearnALCLengths
[ "cb019ba234092a323f3785517d1cc6152a5ef7a4" ]
[ "Method/concept_length_predictors/models.py" ]
[ "import torch, torch.nn as nn, numpy as np\nfrom sklearn.metrics import accuracy_score, f1_score\nimport random\n\ntorch.backends.cudnn.deterministic = True\nseed = 1\ntorch.manual_seed(seed)\n\ndef RM(Ytest, max_len, probs): #Random model\n \"\"\"Random length predictor\n \"\"\"\n np.random.seed(1)\n P...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Dropout", "torch.nn.SELU", "torch.nn.LSTM", "torch.nn.GRU", "torch.nn.ModuleList", "torch.relu", "numpy.random.seed", "sklearn.metrics.accuracy_score", "torch.manual_seed", "torch.nn.ReLU", "torch.nn.Conv2d", "to...
xugangwu95/stellargraph
[ "512e60a8f572a4bb432b0397a2b452251e167d8f" ]
[ "stellargraph/layer/graph_attention.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright 2018-2019 Data61, CSIRO\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.keras.backend.stack", "tensorflow.keras.backend.transpose", "tensorflow.sparse.SparseTensor", "tensorflow.keras.backend.ones", "tensorflow.keras.backend.reshape", "tensorflow.keras.backend.int_shape", "tensorflow.keras.backend.sum", "tensorflow.keras.backend.l2_normaliz...
MDCHAMP/humpday
[ "45e2cea95ae951d991ebc6c1e98314cc8c726f25" ]
[ "humpday/comparison/eloratings.py" ]
[ "import numpy as np\nimport random\nfrom pprint import pprint\nimport traceback\nfrom humpday.objectives.classic import CLASSIC_OBJECTIVES\nfrom humpday.optimizers.alloptimizers import OPTIMIZERS\nfrom humpday.comparison.eloformulas import elo_update\n\nN_DIM_CHOICES = [1, 2, 3, 5, 8]\nN_TRIALS_CHOICES = [130, 210,...
[ [ "numpy.random.choice" ] ]
xinbinhuang/featuretools
[ "f93a90bac32aa6ea5d1ca8e808d57473856d8542", "f93a90bac32aa6ea5d1ca8e808d57473856d8542" ]
[ "featuretools/primitives/transform_primitive.py", "featuretools/demo/retail.py" ]
[ "from __future__ import division\n\nimport copy\nimport datetime\nimport functools\nimport os\nfrom builtins import str\n\nimport numpy as np\nimport pandas as pd\n\nfrom .primitive_base import PrimitiveBase\nfrom .utils import inspect_function_args\n\nfrom featuretools.variable_types import (\n Boolean,\n Da...
[ [ "numpy.logical_not", "numpy.array", "numpy.sin", "pandas.DatetimeIndex", "numpy.absolute", "pandas.DataFrame.from_dict", "numpy.sqrt", "pandas.Series", "numpy.cos", "pandas.TimedeltaIndex" ], [ "pandas.read_csv" ] ]
wangzehui20/instance-segmentation-farmland
[ "571b1a31cfa4476cdccdfd90aa7fec981eba3695" ]
[ "tools/analysis_tools/get_flops.py" ]
[ "import argparse\n\nimport torch\nfrom mmcv import Config, DictAction\n\nfrom mmdet.models import build_detector\n\ntry:\n from mmcv.cnn import get_model_complexity_info\nexcept ImportError:\n raise ImportError('Please upgrade mmcv to >0.6.2')\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(descr...
[ [ "torch.cuda.is_available" ] ]
sourav-majumder/qtlab
[ "96b2a127b1df7b45622c90229bd5ef8a4083614e", "96b2a127b1df7b45622c90229bd5ef8a4083614e" ]
[ "scripts/Qubit/Analysis/Fit/temp_Q.py", "scripts/Qubit/Analysis/Two tone/sideband_drive.py" ]
[ "import numpy as np\r\nfrom fitter import *\r\nleft = 130\r\nright = 270\r\n\r\n\r\npath =[r'D:\\data\\20190511\\154729_power_sweep_7.002MoRe_Al_50mk',\r\nr'D:\\data\\20190511\\160529_power_sweep_7.002MoRe_Al_100mk',\r\nr'D:\\data\\20190511\\162138_power_sweep_7.002MoRe_Al_200mk',\r\nr'D:\\data\\20190511\\164423_po...
[ [ "numpy.array", "numpy.zeros" ], [ "matplotlib.pyplot.xlabel", "numpy.loadtxt", "numpy.sqrt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.log10" ] ]
CVIR/CoMix
[ "593b5b3ba6e060018e4b55ab288dab71c2ee2e18" ]
[ "dataset.py" ]
[ "import torch\nimport torchvision\nfrom torch.utils.data import Dataset, DataLoader, ConcatDataset\nfrom torchvision import transforms, utils\nfrom pathlib import Path\nimport pandas as pd\nfrom torchvision import datasets\nimport imageio\nimport numpy as np\nfrom PIL import Image\nimport glob\nfrom i3d.pytorch_i3d...
[ [ "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.arange", "pandas.read_csv", "torch.empty", "numpy.array_split" ] ]
JUNEeer/Paddle
[ "0ec3a42e9740a5f5066053bb49a923d538eba24a" ]
[ "python/paddle/fluid/tests/unittests/dygraph_to_static/test_ifelse.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.random.seed", "numpy.random.random" ] ]
databyjp/asset_correlation_analysis
[ "c988f4eacf67f1da3991a72e00a59e457623424a" ]
[ "vid1_simple_plots.py" ]
[ "# ========== (c) JP Hwang 3/8/21 ==========\n\nimport logging\nimport pandas as pd\nimport numpy as np\nimport plotly.express as px\n\nlogger = logging.getLogger(__name__)\nroot_logger = logging.getLogger()\nroot_logger.setLevel(logging.INFO)\nsh = logging.StreamHandler()\nformatter = logging.Formatter('%(asctime...
[ [ "pandas.set_option", "pandas.DataFrame", "pandas.read_json", "pandas.concat", "pandas.read_csv" ] ]
STaylorT/Machine-Learning-Linear-Regression
[ "d4afaeea8396c52e0e9661f9488c036c6d67f2b7" ]
[ "multi-linear-regression.py" ]
[ "# Linear Regression Machine Learning Program\n#\n# Sources used:\n# - https://towardsdatascience.com/master-machine-learning-multiple-linear-regression-from-scratch-with-python-ac716a9b78a4\n# Sean Taylor Thomas\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n# from matplotlib import rcParams\n# rcParams['...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.zeros", "sklearn.datasets.load_diabetes", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "m...
PedroBernardino/ross
[ "d8b74aa97b0a02108e15c316b8202964b2f7a532" ]
[ "ross/disk_element.py" ]
[ "import os\nfrom pathlib import Path\n\nimport bokeh.palettes as bp\nimport matplotlib.patches as mpatches\nimport numpy as np\nimport toml\nfrom bokeh.models import ColumnDataSource, HoverTool\n\nfrom ross.element import Element\nfrom ross.utils import read_table_file\n\n__all__ = [\"DiskElement\", \"DiskElement6D...
[ [ "numpy.array", "numpy.zeros", "matplotlib.patches.Polygon", "numpy.allclose", "matplotlib.patches.Circle" ] ]
jiangwenj02/SOLO
[ "da6b1c82715c189bf33e944c6edda80590b5a867" ]
[ "mmdet/utils/contextmanagers.py" ]
[ "# coding: utf-8\nimport asyncio\nimport contextlib\nimport logging\nimport os\nimport time\nfrom typing import List\n\nimport torch\n\nlogger = logging.getLogger(__name__)\n\nDEBUG_COMPLETED_TIME = bool(os.environ.get('DEBUG_COMPLETED_TIME', False))\n\n\n@contextlib.asynccontextmanager\nasync def completed(trace_n...
[ [ "torch.cuda.Event", "torch.cuda.current_stream", "torch.cuda.is_available", "torch.cuda.stream", "torch.is_grad_enabled" ] ]