repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
reo11/aes-for-japanese-learner | [
"a2a400cf651b6ce967db8c1e1b72d08bfc44d280"
] | [
"predict_with_lstm.py"
] | [
"from src.lstm import LSTM\nfrom src.attention import Attention\nfrom src.regressor import AttnRegressor\nfrom src.make_data import DataGenerator\nfrom src.optimize import OptimizedRounder\nimport pandas as pd\nimport numpy as np\nimport warnings\nimport os\nimport argparse\nimport joblib\nimport pickle\nimport tor... | [
[
"pandas.read_csv",
"torch.Tensor",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"pandas.DataFrame",
"torch.cuda.is_available"
]
] |
eerkela/CurveFit | [
"4c25a196860cc62900618ea01dd59b903edbfc8d"
] | [
"curvefit/test/text_test.py"
] | [
"from functools import partial\nimport unittest\n\nimport numpy as np\nfrom matplotlib.figure import Figure\nfrom matplotlib.text import Text\n\nfrom curvefit.callback import add_callback\nfrom curvefit.color import DynamicColor, to_rgba\nfrom curvefit.text import DynamicText\n\n\nassert_equal_float = partial(np.te... | [
[
"matplotlib.text.Text",
"matplotlib.figure.Figure"
]
] |
architecture-building-systems/cea-toolbox | [
"bfec7ecb4b242449ab8796a1e8ce68c05c35f1d6"
] | [
"cea/tests/test_schedules.py"
] | [
"\"\"\"\nThis module contains unit tests for the schedules used by the CEA. The schedule code is tested against data in the\nfile `test_schedules.config` that can be created by running this file. Note, however, that this will overwrite the\ntest data - you should only do this if you are sure that the new data is co... | [
[
"pandas.DataFrame"
]
] |
rmqlife/SPIRAL-tensorflow | [
"54fce656656a0a7468e57077a26676f8add2f44a"
] | [
"test_env.py"
] | [
"# from __future__ import print_functions\nfrom colorenv import ColorEnv, PaintMode\n\nimport os\nfrom os.path import join, basename\nimport numpy as np\nimport sys\n\nsys.path.append('/home/dprasad/notebooks/SPIRAL-tensorflow')\nsys.path.append('/home/dprasad/notebooks/SPIRAL-tensorflow/libs/mypaint')\nfrom lib im... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
Rahul-Venugopal/Image-augmentation | [
"0b0125d29003981709bdb8230170c851367a3995"
] | [
"test/augmenters/test_blur.py"
] | [
"from __future__ import print_function, division, absolute_import\n\nimport time\n\nimport matplotlib\nmatplotlib.use('Agg') # fix execution of tests involving matplotlib on travis\nimport numpy as np\nimport six.moves as sm\nimport cv2\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\nfrom imgaug impo... | [
[
"numpy.allclose",
"numpy.array_equal",
"matplotlib.use",
"numpy.tile",
"numpy.copy",
"numpy.zeros_like",
"numpy.float32",
"numpy.array",
"numpy.zeros"
]
] |
kyuhyoung/gym-rock-paper-scissors | [
"f527c9f0835193008f04575bca1b63a815c44c8a"
] | [
"gym_rock_paper_scissors/envs/rock_paper_scissors_env.py"
] | [
"from enum import Enum\n\nfrom copy import deepcopy\nimport numpy as np\n\nimport gym\nfrom gym.spaces import Discrete, Tuple\nfrom .one_hot_space import OneHotEncoding\n\n\nclass Action(Enum):\n ROCK = 0\n PAPER = 1\n SCISSORS = 2\n\n\nclass RockPaperScissorsEnv(gym.Env):\n '''\n Repeated gam... | [
[
"numpy.zeros"
]
] |
para2x/sciann | [
"510a632f01a1db593e9c38338561c08826adcb34",
"510a632f01a1db593e9c38338561c08826adcb34"
] | [
"tests/test_api.py",
"sciann/functionals/mlp_functional.py"
] | [
"import pytest\nimport sciann as sn\nimport json\nimport os\nimport shutil\nfrom tensorflow.keras import optimizers as tf_optimizers\nimport numpy as np \n\n\n@pytest.fixture(scope=\"module\")\ndef variable_x():\n return sn.Variable('x')\n\n\n@pytest.fixture(scope=\"module\")\ndef variable_y():\n return sn.Va... | [
[
"numpy.linspace",
"numpy.meshgrid",
"tensorflow.keras.optimizers.RMSprop",
"numpy.linalg.norm",
"tensorflow.keras.optimizers.Adam",
"numpy.tanh"
],
[
"tensorflow.python.keras.backend.function",
"tensorflow.python.keras.backend.get_graph"
]
] |
solothinker/Python-Xperiments | [
"13d4e7bf8a0ce3eec22537d71eb9e27dc1f4c4ef"
] | [
"simpleGames/TicTacToe.py"
] | [
"#tic-tac-toe\nimport numpy as np\n\ncount = 0\n\ndef selectPlayer():\n firstPlayer = input('Select between x or o:')\n if firstPlayer != \"x\" and firstPlayer != \"o\":\n print(\"Pleae select the right symbol\")\n firstPlayer = selectPlayer()\n return firstPlayer\n\ndef printTic(tic):\n f... | [
[
"numpy.zeros"
]
] |
manos-mark/opencv-course | [
"470f7572effacbfb999cbb8df802e388d59ce958"
] | [
"manos-files/Section #1 - Basics/draw.py"
] | [
"import cv2 as cv\nimport numpy as np\n\nblank = np.zeros((500, 500, 3), dtype='uint8')\ncv.imshow('Blank', blank)\n\n# img = cv.imread('Resources/Photos/cat.jpg')\n# cv.imshow('Cat', img)\n\n\"\"\" 1. Paint the image a certain colour \"\"\"\n# blank[200:300, 300:400] = 0,255,0\n# cv.imshow('Green', blank)\n\n\"\"\... | [
[
"numpy.zeros"
]
] |
yash-22/pointer_generator_translator | [
"86e4c96b6e9930cd7f35fd31d39477f916899da7"
] | [
"training_ptr_gen/decode.py"
] | [
"#Except for the pytorch part content of this file is copied from https://github.com/abisee/pointer-generator/blob/master/\n\nimport sys\nimport imp\n\nimp.reload(sys)\nsys.setdefaultencoding('utf8')\n\nimport os\nimport time\n\nimport torch\nfrom torch.autograd import Variable\n\nfrom data_util.batcher import Batc... | [
[
"torch.LongTensor",
"torch.topk",
"torch.log",
"torch.cuda.is_available",
"torch.stack"
]
] |
AbdallahHemdan/LZ77-compression-algorithm | [
"03677b8c368bd7e84ea08dab9159c686e9fb3144"
] | [
"encoding.py"
] | [
"import numpy as np\r\nimport cv2\r\n\r\ninputImg = cv2.imread('input.jpg', 0)\r\nflat = np.array(inputImg).flatten()\r\ncv2.imshow('input', inputImg)\r\n\r\n# size of the image(row, col)\r\nrow = inputImg.shape[0]\r\ncol = inputImg.shape[1]\r\nflattenSize = row * col\r\n\r\n# get sliding window and look ahead wind... | [
[
"numpy.append",
"numpy.array",
"numpy.save"
]
] |
vigsterkr/netket | [
"1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a"
] | [
"Examples/J1J2/j1j2.py"
] | [
"# Copyright 2018 The Simons Foundation, Inc. - All Rights Reserved.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless re... | [
[
"numpy.asarray",
"numpy.array",
"numpy.kron"
]
] |
hay/facetool | [
"3e296f7b177ebbcceb4b25f12f3327c3f6612f14"
] | [
"facetool/averager.py"
] | [
"# Based on the Face Averager by Satya Mallick\n# < https://github.com/spmallick/learnopencv/blob/master/FaceAverage/faceAverage.py >\n\nimport cv2\nimport logging\nimport numpy as np\nimport pdb\nfrom .faceaverage import similarityTransform, calculateDelaunayTriangles\nfrom .faceaverage import constrainPoint, warp... | [
[
"numpy.reshape",
"numpy.int",
"numpy.append",
"numpy.float32",
"numpy.array"
]
] |
prataprudra2526/SimpleHTR-TF2.0 | [
"8530bb721c9a2e43a7c72f7b1cd13dc4f07ec6e0",
"8530bb721c9a2e43a7c72f7b1cd13dc4f07ec6e0"
] | [
"src/data_loader.py",
"src/model_helper.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport random\nimport numpy as np\nimport cv2\nfrom sample_preprocessor import pre_process\n\n\nclass Sample:\n \"sample from the dataset\"\n\n def __init__(self, gt_text, file_path):\n self.gtText = gt_text\n ... | [
[
"numpy.stack"
],
[
"tensorflow.fill",
"tensorflow.nn.ctc_loss",
"tensorflow.nn.ctc_beam_search_decoder",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.expand_dims",
"tensorflow.cast",
"tensorflow.SparseTensor",
"tensorflow.GradientTape"
]
] |
18756/ITMO_FS | [
"d0465c61b15264812b3455194e8b9eea93b3f550"
] | [
"test/ensemble_test.py"
] | [
"import time\nimport unittest\nimport numpy as np\nfrom collections import defaultdict\n\nfrom sklearn.datasets import make_classification, make_regression\nfrom sklearn.metrics import f1_score\nfrom sklearn.model_selection import KFold\nfrom sklearn.svm import SVC\n\nfrom ITMO_FS.ensembles.measure_based import *\n... | [
[
"sklearn.datasets.make_classification",
"sklearn.model_selection.KFold",
"sklearn.datasets.make_regression",
"numpy.std",
"numpy.mean",
"sklearn.svm.SVC",
"sklearn.metrics.f1_score",
"numpy.array"
]
] |
glhuilli/neural_caissa | [
"f9620320795095d73e9288d44e50c6e32b37f01b"
] | [
"neural_caissa/board/state.py"
] | [
"import chess\nimport numpy as np\n\nfrom neural_caissa.ply.valuators.baseline_valuator import BaselineValuator\nfrom neural_caissa.ply.valuators.neural_valuator import NeuralValuator\n\n_BOARD_DIM = 8\n_POSITIONS = 64\n_PIECES = 'PNBRQKpnbrqk'\n_VALUATORS = {'BaselineValuator': BaselineValuator, 'NeuralValuator': ... | [
[
"numpy.zeros"
]
] |
TomekFraczek/DrivenCorticalSheet | [
"53c010a6c851fbc85eb822409e986d08722b7330"
] | [
"plotting/silly_normal_for_fun.py"
] | [
"import numpy as np\n\"\"\" not used but i'm leaving here to show what a goofy workaround\n using rng.choice\n incalc a gaussian and ***not*** feeding into choice but whatever\n\"\"\"\n\ndef normal_dist(obj, kernel,\n distance:float = 3/2,\n resolution:int = 1e6, #1mln samples\n... | [
[
"numpy.arange",
"numpy.ones",
"numpy.prod",
"numpy.zeros",
"numpy.random.default_rng"
]
] |
thisKK/-arcfaceV1-retinaface- | [
"b9cd772f4145908ab4517622b2c64d0dbcad02f5"
] | [
"faceRecognition/FaceRecognition2.py"
] | [
"import cv2\nimport numpy as np\nfrom faceDetection import RetinaFace\nimport dlib\nimport time\nimport pickle\n\n# ---------- load face landmark predictor --------------------------\nsp = dlib.shape_predictor('../facialLandmarks/shape_predictor_68_face_landmarks.dat')\n\n# ---------- load resnet model for recogni... | [
[
"numpy.array",
"numpy.argmin"
]
] |
andreas-schmidt/tapetool | [
"235316395ab791748ecb2248c9484a90f464aac1"
] | [
"tapetool/filters.py"
] | [
"from scipy.signal import butter, lfilter\n\ndef butter_bandpass(fs, data, f1=2900, f2=3100):\n w1 = f1 / 0.5 / fs\n w2 = f2 / 0.5 / fs\n b, a = butter(N=3, Wn=[w1, w2], btype='band')\n return lfilter(b, a, data, axis=0)\n\ndef thd_for_1k(fs, data):\n return butter_bandpass(fs, data, 2900, 3100)\n\nd... | [
[
"scipy.signal.lfilter",
"scipy.signal.butter"
]
] |
tmancal74/quantarhei | [
"54a40cc55cdedf86bf04a5d705227fe69461d408"
] | [
"quantarhei/core/managers.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n This class handles several important package wide tasks:\n\n 1) Usage of units across objects storing data\n 2) Basis conversion of all registered objects\n 3) Calls to proper optimized implementations of numerically heavy\n sections of the calculations\n\n\n ... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.set_printoptions",
"numpy.ones",
"numpy.zeros"
]
] |
lkrsnik/accetuation | [
"02724147f88aa034487c7922eb75e0fc321aa93f",
"02724147f88aa034487c7922eb75e0fc321aa93f"
] | [
"cnn/word_accetuation/syllabled_letters/v2_15/workbench.py",
"cnn/word_accetuation/syllabled_letters/v3_2/workbench.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n# text in Western (Windows 1252)\n\nimport pickle\nimport numpy as np\nfrom keras import optimizers\nfrom keras.models import Model\nfrom keras.layers import Dense, Dropout, Input\nfrom keras.layers.merge import concatenate\nfrom keras.layers.convol... | [
[
"numpy.random.seed"
],
[
"numpy.random.seed"
]
] |
playing-code/fairseq2 | [
"ac97b18c0aecca9eb36146492a1e95e521cb345a",
"ac97b18c0aecca9eb36146492a1e95e521cb345a"
] | [
"train_dot.py",
"train_plain_bert_dot4_con.py"
] | [
"import json\nimport pickle\nimport numpy as np\nimport random\n# from fairseq.data import Dictionary\nimport sys\nimport torch\nimport argparse\nimport os\nfrom model_dot import Plain_bert\nfrom fairseq.models.roberta import RobertaModel\nfrom utils_sample_deepwalk import NewsIterator\nfrom utils_sample_deepwalk ... | [
[
"torch.manual_seed",
"torch.nn.DataParallel",
"torch.cuda.manual_seed",
"numpy.random.seed"
],
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.empty_cache",
"torch.no_grad",
"torch.nn.DataParallel",
"numpy.array"
]
] |
livingbody/resnet-livingbody | [
"a8c04faf9cc6896f7c3aef06cddfe38ce74f00ee"
] | [
"torch2paddle.py"
] | [
"import numpy as np\nimport torch\nfrom torchvision import models\nimport ResNet_paddle.paddlevision.models\nfrom torchsummary import summary\nfrom torchvision.models import resnet50\nimport paddle\nfrom collections import OrderedDict\n\n\n# 查看pytorch权重文件信息\ndef model_summary():\n model = resnet50()\n checkpo... | [
[
"torch.tensor",
"numpy.random.randn",
"numpy.abs",
"torch.load"
]
] |
clatterrr/NumericalComputationProjectsCollection | [
"95caf3121dc71a91b8e73c1ccc5909f4ab2551ea"
] | [
"FiniteElement/Easy01_Elastic/codes2d/example2d.py"
] | [
"import numpy as np\nimport scipy.io as scio\nimport math\n\"\"\"\n参考论文:Matlab-Implementation of the Finite Element Method in Elasticity\n\n本地参考代码:D:\\FluidSim\\FluidSim\\FEMNEW\\2002-AJ_CC_FS_KR-Matlab_Implementation_FEM_Elasticity\\Software2\\fem_lame2d\n\n完成状态:主体部分完成,未后处理\n\n\"\"\"\ncoordinates = scio.loadmat('c... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.det",
"numpy.linalg.inv",
"scipy.io.loadmat",
"numpy.cos",
"numpy.sin",
"numpy.linalg.det",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
Tobi-Alonso/finn | [
"ea73d873e66414590f196dc71c398ba345301c24"
] | [
"tests/end2end/test_end2end_tfc_w1a1.py"
] | [
"# Copyright (c) 2020, Xilinx\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# * Redistributions of source code must retain the above copyright notice, this\n# list of conditions an... | [
[
"numpy.zeros",
"numpy.isclose"
]
] |
gme5078/data-profiler | [
"602cc5e4f4463f9b807000abf3893815918d0723",
"602cc5e4f4463f9b807000abf3893815918d0723"
] | [
"data_profiler/labelers/labeler_utils.py",
"data_profiler/labelers/regex_model.py"
] | [
"import scipy\nimport numpy as np\nimport os\nimport sys\n\nfrom data_profiler.labelers.classification_report_utils import classification_report\n\nimport warnings\nfrom sklearn.exceptions import UndefinedMetricWarning\nwarnings.filterwarnings(\"ignore\", category=UndefinedMetricWarning)\n\n\n# in case of data prof... | [
[
"numpy.hstack",
"numpy.zeros"
],
[
"numpy.linalg.norm",
"numpy.empty"
]
] |
jonathanhines/cucSpiritVisuals | [
"49f42e439afa12ebd16994053766cca9ce9b8cab"
] | [
"src/summary.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy.polynomial.polynomial import polyfit\n\ndef plot(year):\n filePath = \"./data/CUC\" + year + \".csv\"\n chart_title = \"CUC\" + year + \" Average Spirit Score vs Rank\"\n chart_file_name = \"./results/CUC\" + year + \"_SO... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.polynomial.polynomial.polyfit",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"ma... |
vegajustin26/dyn-masses | [
"9ff73fcec53beac59557c95fb1e47dc22947a333"
] | [
"fit_Mdyn/run_fit_emcee_simp1.py"
] | [
"import os, sys, time\nimport numpy as np\nimport copy as copy\nfrom astropy.io import fits\nfrom cube_parser import cube_parser\nfrom vis_sample import vis_sample\nfrom vis_sample.file_handling import import_data_uvfits\nfrom scipy.ndimage import convolve1d\nfrom scipy.interpolate import interp1d\nimport emcee\nfr... | [
[
"numpy.dot",
"numpy.int",
"numpy.max",
"numpy.mean",
"numpy.exp",
"numpy.where",
"scipy.ndimage.convolve1d",
"numpy.linalg.slogdet",
"numpy.empty_like",
"numpy.eye",
"numpy.arange",
"scipy.interpolate.interp1d",
"numpy.load",
"numpy.log",
"numpy.min",
... |
CheungBH/ssd.pytorch | [
"0aac2d67072f6083555f87cc479df7e6fc4cc080"
] | [
"eval.py"
] | [
"\"\"\"Adapted from:\n @longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch\n @rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn\n Licensed under The MIT License [see LICENSE for details]\n\"\"\"\n\nfrom __future__ import print_function\nimport torch\nimport torch... | [
[
"torch.set_default_tensor_type",
"numpy.minimum",
"torch.load",
"numpy.cumsum",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"torch.cuda.is_available",
"numpy.where",
"numpy.arange",
"numpy.finfo",
"numpy.argmax",
"torch.masked_select",
"numpy.zeros",
... |
epinal/pybkt | [
"b35d65bda67669ae6ffeed314a35704ede1381b5"
] | [
"bktree.py"
] | [
"\"\"\"\nBK-tree data structure to allow fast querying of \"close\" matches.\nThis code is licensed under a permissive MIT license -- see LICENSE.txt.\nGitHub https://github.com/elpinal/pybkt\n\"\"\"\n\nfrom collections import deque, Iterable\nfrom operator import itemgetter\nimport numpy as np\n\n__all__ = ['leven... | [
[
"numpy.arange",
"numpy.minimum",
"numpy.add"
]
] |
Tushar8055/License-Plate-Recognition-Based-Smart-Parking-System | [
"8cbc3e82f9ec13c27212f0eabbb6de4eb567f754"
] | [
"Preprocess.py"
] | [
"import cv2\nimport numpy as np\nimport math\n\nGAUSSIAN_SMOOTH_FILTER_SIZE = (5, 5)\nADAPTIVE_THRESH_BLOCK_SIZE = 19\nADAPTIVE_THRESH_WEIGHT = 9\n\ndef preprocess(imgOriginal):\n imgGrayscale = extractValue(imgOriginal)\n imgMaxContrastGrayscale = maximizeContrast(imgGrayscale)\n height, width = imgGraysc... | [
[
"numpy.zeros"
]
] |
reuben/tensorflow | [
"ac15ffcf093505eee71548608b28287fbfdf17c3"
] | [
"tensorflow/python/compat/compat.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.tf_export.tf_export"
]
] |
manigalati/Automated-Cardiac-Segmentation-and-Disease-Diagnosis | [
"cfa556f9cdd12586783821435fa84e73f20a72c8"
] | [
"ACDC_Diagnosis/stage_2_diagnosis.py"
] | [
"\"\"\"\nThis code does training, validation and testing of the model for automated cardiac disease diagnosis.\nBasically Implementation of second stage of the disease diagnosis model for discriminating between DCM vs. MINF\n\"\"\"\nfrom __future__ import print_function\nimport numpy as np\nimport os\nimport subpro... | [
[
"sklearn.neural_network.MLPClassifier",
"matplotlib.pyplot.imshow",
"sklearn.tree.export_graphviz",
"sklearn.metrics.confusion_matrix",
"sklearn.tree.DecisionTreeClassifier",
"pandas.read_csv",
"matplotlib.pyplot.tight_layout",
"sklearn.ensemble.RandomForestClassifier",
"sklear... |
shreshthatiwari/C103 | [
"6f94596f5164a41f89c89caab484f65bac61afdd"
] | [
"plot.py"
] | [
"import pandas as pd\n\nimport plotly.express as px\n\ndf = pd.read_csv(\"Data-visualization-master/Teacher refrence/line_chart.csv\")\n\nfig = px.line(df, x=\"Year\", y=\"Per capita income\", color=\"Country\", title='Per Capita Income')\n\nfig.show()\n"
] | [
[
"pandas.read_csv"
]
] |
SengerM/myplotlib | [
"8282226e140647342da69530aadb79b61c7c3394"
] | [
"myplotlib/wrapper_plotly.py"
] | [
"from .figure import MPLFigure\nimport numpy as np\n\nclass MPLPlotlyWrapper(MPLFigure):\n\tLINESTYLE_TRANSLATION = {\n\t\t'solid': None,\n\t\t'none': None,\n\t\t'dashed': 'dash',\n\t\t'dotted': 'dot',\n\t}\n\t\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\timport plotly.graph_objects as go # Import here so i... | [
[
"numpy.log",
"numpy.random.rand"
]
] |
fnsoxt/czsc | [
"ae908ca807251eefb1c23c1a3bfa20f36977ba4b"
] | [
"czsc/traders/ts_backtest.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nauthor: zengbin93\nemail: zeng_bin8888@163.com\ncreate_dt: 2022/2/14 17:25\ndescribe: 基于 Tushare 分钟数据的择时策略快速回测\n\"\"\"\n\nimport os\nimport inspect\nimport traceback\nimport pandas as pd\nfrom tqdm import tqdm\nfrom typing import Callable\n\nfrom .. import envs\nfrom ..data.ts_cach... | [
[
"pandas.concat",
"pandas.read_excel",
"pandas.DataFrame",
"pandas.ExcelWriter",
"pandas.read_pickle"
]
] |
krishnakumarraghu/pandas | [
"d7eb306cc1b6e3430895a7d2af0cfa1cbc8c4c06"
] | [
"pandas/core/indexes/timedeltas.py"
] | [
"\"\"\" implement the TimedeltaIndex \"\"\"\nfrom datetime import datetime\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import NaT, Timedelta, index as libindex, join as libjoin, lib\nfrom pandas.util._decorators import Appender, Substitution\n\nfrom pandas.core.dtypes.common import (\n _TD_DTYPE,... | [
[
"pandas.tseries.frequencies.to_offset",
"numpy.asarray",
"pandas.core.indexes.datetimelike.DatetimeIndexOpsMixin.astype",
"pandas.core.arrays.timedeltas._is_convertible_to_td",
"pandas.core.accessor.delegate_names",
"pandas.core.indexes.base.Index",
"pandas.core.arrays.timedeltas.Timed... |
lidiaxp/plannie | [
"b05f80a8bb5170ccec0124c97251d515892dc931"
] | [
"3D/classic/biAuxApf.py"
] | [
"# -*- coding: utf-8 -*-\nimport math\nimport random\nfrom matplotlib import pyplot as plt\nfrom helper.ambiente import Pontos\nfrom helper.utils import colidir, simulate_points, definir_angulo, dist_euclidiana, pseudo3D, distancia_rota3D\nimport numpy as np\nfrom classic.vetor2D import Vector2d\nfrom classic.minLo... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.pause"
]
] |
sohailsomani/soso-state | [
"05e92b26e06555f9041c61a6ffaefaa3050e6213"
] | [
"examples/notebooks/model.py"
] | [
"import datetime as dt\nimport math\nimport typing\nfrom dataclasses import dataclass, field\n\nimport numpy as np\nfrom soso import state\n\n\n@dataclass\nclass Bars:\n date: typing.List[dt.datetime] = field(default_factory=list)\n open: typing.List[float] = field(default_factory=list)\n high: typing.List... | [
[
"numpy.random.randint"
]
] |
leoYY/duckdb | [
"dd2f405ae3a74f317e10f0a32254ba2d5e2d8c41"
] | [
"tools/pythonpkg/tests/fast/test_multithread.py"
] | [
"import duckdb\nimport pytest\nimport threading\nimport queue as Queue\nimport pandas as pd\nimport numpy as np\nimport os\ntry:\n import pyarrow as pa\n can_run = True\nexcept:\n can_run = False\n\nclass DuckDBThreaded:\n def __init__(self,duckdb_insert_thread_count,thread_function):\n self.duck... | [
[
"pandas.DataFrame",
"numpy.random.randint"
]
] |
masataka46/cycle-GAN | [
"003a17f01cba32862ad62bbc9e09be8401ac376e"
] | [
"cycleGAN_chainer.py"
] | [
"import numpy as np\nimport os\nimport chainer\nfrom chainer import cuda, Function, gradient_check, report, training, utils, Variable\nfrom chainer import datasets, iterators, optimizers, serializers\n# from chainer import Link, Chain, ChainList\nimport chainer.functions as F\nimport chainer.links as L\n# from chai... | [
[
"numpy.random.seed",
"numpy.asarray",
"numpy.ones",
"numpy.float32",
"numpy.zeros",
"numpy.float"
]
] |
duongttr/vehicles-counting-yolov4-deepsort | [
"8e5e84d495987929e95b77610802ea206d40e5af"
] | [
"utils/YOLO.py"
] | [
"import numpy as np\nimport time\nimport cv2\nimport os\n\nclass YOLO:\n def __init__(self, labels, cfg, weight, use_gpu=False):\n \"\"\"\n Parameters:\n - labels: path to labels' file\n - cfg: path to config file\n - weight: path to weight model\n - use_gpu: enable this... | [
[
"numpy.array",
"numpy.argmax"
]
] |
matplotlib/mpl-gui | [
"5be9b47a6afb018e79c502e5c8c9211c3e04918b"
] | [
"mpl_gui/_manage_backend.py"
] | [
"import importlib\nimport sys\nimport logging\nimport types\n\nfrom matplotlib import cbook, rcsetup\nfrom matplotlib import rcParams, rcParamsDefault\nimport matplotlib.backend_bases\n\n\n_backend_mod = None\n\n_log = logging.getLogger(__name__)\n\n\ndef current_backend_module():\n \"\"\"\n Get the currently... | [
[
"matplotlib.cbook._get_running_interactive_framework",
"matplotlib.cbook._backend_module_name"
]
] |
HanSeokhyeon/Spiking_neural_network_for_MNIST | [
"2ea9477309c4758baf24d9ac18651037f6f7fab2"
] | [
"test.py"
] | [
"import numpy as np\nimport os\nimport matplotlib.pyplot as plt\nimport SNN\nimport data\n\nSAVE_PATH = os.getcwd() + '/weight_mnist'\nmnist = data.MNIST(path=[\"MNIST/t10k-images.idx3-ubyte\", \"MNIST/t10k-labels.idx1-ubyte\"])\n\nw1 = np.load(SAVE_PATH + '1.npy')\nw2 = np.load(SAVE_PATH + '2.npy')\n\nTs = 1e-3\ns... | [
[
"numpy.load",
"numpy.argmax",
"numpy.argmin"
]
] |
SamueLacombe/OpenNMT-tf | [
"92c76d895ea9b226c74c9cd4cca9d6570d994634"
] | [
"opennmt/layers/position.py"
] | [
"\"\"\"Define position encoder classes.\"\"\"\n\nimport math\nimport abc\n\nimport tensorflow as tf\n\nfrom opennmt.layers.reducer import SumReducer\n\n\nclass PositionEncoder(tf.keras.layers.Layer):\n \"\"\"Base class for position encoders.\"\"\"\n\n def __init__(self, reducer=None, **kwargs):\n \"\"\... | [
[
"tensorflow.sin",
"tensorflow.cos",
"tensorflow.range",
"tensorflow.shape",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.expand_dims",
"tensorflow.tile",
"tensorflow.nn.embedding_lookup"
]
] |
seemir/stressa | [
"7c3b178cf13f74ee010dbd44ce99188de3862ef7"
] | [
"source/ui/graphics/double_bar_chart.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nModule containing logic for the DoubleBarChart\n\n\"\"\"\n\n__author__ = 'Samir Adrik'\n__email__ = 'samir.adrik@gmail.com'\n\nfrom numpy import arange, cumsum, asarray\n\nfrom pyqtgraph import BarGraphItem, PlotWidget, SignalProxy\n\nfrom source.util import Assertor\n\nfrom .doubl... | [
[
"numpy.asarray",
"numpy.cumsum"
]
] |
pmmilani/boreas | [
"e422b44236774d98bbf96f861dcc72e9e86d7b83"
] | [
"boreas/process.py"
] | [
"#----------------------------------- processing.py -------------------------------------#\r\n\"\"\"\r\nThis file contains utility functions to process a case into useful quantities (stored \r\nin numpy arrays). These include calculating features, Pr_t, should_use, etc.\r\n\"\"\"\r\n\r\n# ------------ Import statem... | [
[
"numpy.logical_not",
"numpy.expand_dims",
"numpy.sqrt",
"numpy.arange",
"numpy.trace",
"numpy.eye",
"numpy.linalg.multi_dot",
"numpy.random.shuffle",
"numpy.ones",
"numpy.std",
"numpy.mean",
"numpy.transpose",
"numpy.zeros",
"numpy.sum",
"numpy.empty"
... |
landerlini/scikinC | [
"c408e2b63a32eecefc514193a4483b9d95b8d0fa"
] | [
"scikinC/QuantileTransformerConverter.py"
] | [
"import numpy as np \nimport sys\nfrom scikinC import BaseConverter \nfrom scipy import stats\nfrom ._tools import array2c, get_interpolation_function\n\nclass QuantileTransformerConverter (BaseConverter):\n def convert (self, model, name=None): \n lines = self.header() \n\n distr = model.output_distribution... | [
[
"scipy.stats.norm.ppf",
"numpy.spacing",
"numpy.linspace"
]
] |
opengeophysics/deeplook | [
"0b39a81fe5e7f28c341e0a83e214e259ab19028b"
] | [
"deeplook/tests/test_gradient_descent.py"
] | [
"# pylint: disable=redefined-outer-name,no-self-use,too-few-public-methods\n\"\"\"\nTest the gradient descent optimization.\n\"\"\"\nimport pytest\nimport numpy as np\nimport numpy.testing as npt\n\nfrom ..optimization.gradient_descent import Newton, apply_preconditioning\n\n\nclass Paraboloid():\n \"An N-dimens... | [
[
"numpy.identity",
"numpy.array",
"numpy.zeros_like",
"numpy.testing.assert_allclose"
]
] |
YotYot/StereoNet | [
"0fd7a6b33bbc02d24cc0bd1817fccec0e756579d"
] | [
"main.py"
] | [
"from __future__ import print_function\nimport argparse\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.autograd import Variable\... | [
[
"torch.abs",
"torch.cuda.manual_seed",
"torch.load",
"torch.manual_seed",
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.functional.smooth_l1_loss",
"torch.nn.DataParallel",
"torch.squeeze"
]
] |
w3sip/caffe-tensorflow | [
"67b4525bbff5b1d53cc64dbbf5f25c5d8e2ce667"
] | [
"kaffe/tensorflow/network.py"
] | [
"import math\nimport numpy as np\nimport tensorflow as tf\n\nBATCH_SIZE = 4 # Only used for deconvolution\nDEFAULT_PADDING = 'SAME'\n\n\ndef layer(op):\n '''Decorator for composable network layers.'''\n\n def layer_decorated(self, *args, **kwargs):\n # Automatically set a name if not provided.\n ... | [
[
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.nn.max_pool",
"tensorflow.nn.conv2d_transpose",
"tensorflow.add_n",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.conv2d",
"tensorflow.squeeze",
"numpy.load",
"tensorflow.nn.dropout",
"tensorflow.shape",
"t... |
rbiswas4/MachineLearningInAstronomy | [
"1318c1befaeb2fbd453b9c272aedf00015e9786a"
] | [
"classes/Hand_On_2/Figure_scripts/fig14_meanshift.py"
] | [
"# Author: Jake VanderPlas\n# License: BSD\n# The figure produced by this code is published in the textbook\n# \"Statistics, Data Mining, and Machine Learning in Astronomy\" (2013)\n# For more information, see http://astroML.github.com\n# To report a bug or issue, use the following forum:\n# https://grou... | [
[
"sklearn.cluster.MeanShift",
"numpy.random.seed",
"numpy.unique",
"numpy.vstack",
"matplotlib.pyplot.MultipleLocator",
"numpy.histogram2d",
"sklearn.preprocessing.scale",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
ethan4335/pytorch-YOLOv4 | [
"44f67130d83fc2949efb50afe67337735836169b"
] | [
"tool/config.py"
] | [
"import torch\nfrom tool.torch_utils import convert2cpu\n\n\ndef parse_cfg(cfgfile):\n blocks = []\n fp = open(cfgfile, 'r')\n block = None\n line = fp.readline()\n while line != '':\n line = line.rstrip() # 删除 string 字符串末尾的指定字符(默认为空格).\n if line == '' or line[0] == '#':\n li... | [
[
"torch.from_numpy"
]
] |
ChaoPang/curation | [
"a754bd51e0f63e306da5b685dac9b31a8154b579"
] | [
"tests/integration_tests/data_steward/utils/participant_summary_requests_test.py"
] | [
"\"\"\"\nIntegration Test for the deactivated_participants module\n\nEnsures that get_token function fetches the access token properly, get_deactivated_participants\n fetches all deactivated participants information, and store_participant_data properly stores all\n the fetched deactivated participant data\n\n... | [
[
"pandas.Timestamp",
"pandas.DataFrame"
]
] |
loopyme/mars | [
"52f9552855f96bf744515c4d08413f949d3512af"
] | [
"mars/tensor/stats/tests/test_stats_execute.py"
] | [
"# Copyright 1999-2021 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"scipy.stats.ks_1samp",
"scipy.stats.power_divergence",
"scipy.stats.ks_2samp",
"numpy.linspace",
"numpy.testing.assert_almost_equal",
"scipy.stats.entropy",
"scipy.stats.norm.rvs",
"scipy.stats.chisquare",
"numpy.array",
"numpy.random.RandomState",
"numpy.testing.asser... |
danielremo/bartpy | [
"f299d8be9378daf75ee1a6b1527de5cb0f0ced89",
"f299d8be9378daf75ee1a6b1527de5cb0f0ced89"
] | [
"bartpy/diagnostics/sigma.py",
"bartpy/diagnostics/features.py"
] | [
"from matplotlib import pyplot as plt\n\nfrom bartpy.sklearnmodel import SklearnModel\n\n\ndef plot_sigma_convergence(model: SklearnModel, ax=None):\n if ax is None:\n fig, ax = plt.subplots(1, 1)\n sigma_samples = [x.sigma.current_value() for x in model.model_samples]\n ax.plot(sigma_samples)\n ... | [
[
"matplotlib.pyplot.subplots"
],
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.percentile",
"numpy.max",
"numpy.random.permutation",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.... |
xfdywy/d4rl | [
"7c809b2ee575a69a14997068db06f3c1f3c8bd08"
] | [
"scripts/generation/hand_dapg_demos.py"
] | [
"import d4rl\nimport click \nimport os\nimport gym\nimport numpy as np\nimport pickle\nimport h5py\nimport collections\nfrom mjrl.utils.gym_env import GymEnv\n\nDESC = '''\nHelper script to visualize demonstrations.\\n\nUSAGE:\\n\n Visualizes demonstrations on the env\\n\n $ python utils/visualize_demos --env... | [
[
"numpy.array",
"numpy.clip"
]
] |
fbudrowski/ray | [
"4853aa96cbbea76e69c3e48802ce7408f08669ee"
] | [
"rllib/env/atari_wrappers.py"
] | [
"import numpy as np\nfrom collections import deque\nimport gym\nfrom gym import spaces\nimport cv2\ncv2.ocl.setUseOpenCL(False)\n\n\ndef is_atari(env):\n if (hasattr(env.observation_space, \"shape\")\n and env.observation_space.shape is not None\n and len(env.observation_space.shape) <= 2):... | [
[
"numpy.squeeze",
"numpy.sign",
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
beat-buesser/espresso | [
"bd6ba1f7745c90a2c3c8ff0a0d7332efeebcc808"
] | [
"espresso/speech_train.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n# Copyright (c) Yiming Wang\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\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport loggi... | [
[
"torch.autograd.profiler.record_function",
"torch.autograd.profiler.emit_nvtx",
"torch.cuda.profiler.profile",
"numpy.random.seed"
]
] |
mattaq31/recognition-forge | [
"c5a6e36d2e81a66ad8c7eb2f108b6821610a7ba9"
] | [
"Code/skipthoughts/skipthoughts_dir/training/vocab.py"
] | [
"\"\"\"\nConstructing and loading dictionaries\n\"\"\"\nimport _pickle as pkl\nimport numpy\nfrom collections import OrderedDict\n\ndef build_dictionary(text):\n \"\"\"\n Build a dictionary\n text: list of sentences (pre-tokenized)\n \"\"\"\n wordcount = OrderedDict()\n for cc in text:\n wo... | [
[
"numpy.argsort"
]
] |
songpeng326/pytorch-semantic-segmentation | [
"7469de95cdb0fbfe9b00b93a8b068c35d398c6cf"
] | [
"networks/unet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\n\nfrom torch.utils import model_zoo\nfrom torchvision import models\n\nclass UNetEnc(nn.Module):\n\n def __init__(self, in_channels, features, out_channels):\n super().__init__()\n\n self.up = nn.Se... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.ReLU"
]
] |
sourface94/hyperlib | [
"2353475a843070588a9faf62f075cb6c75082e48"
] | [
"hyperlib/manifold/poincare.py"
] | [
"import tensorflow as tf\nfrom .base import Manifold\nfrom ..utils.math import tanh, atanh_\n\n\nclass Poincare(Manifold):\n\n \"\"\"\n Implementation of the poincare manifold,. This class can be used for mathematical functions on the poincare manifold.\n \"\"\"\n\n def __init__(self,):\n super(P... | [
[
"tensorflow.clip_by_value",
"tensorflow.norm",
"tensorflow.math.sqrt",
"tensorflow.zeros",
"tensorflow.math.reduce_max",
"tensorflow.reduce_sum",
"tensorflow.maximum",
"tensorflow.cast",
"tensorflow.ones_like",
"tensorflow.divide",
"tensorflow.where",
"tensorflow.ma... |
ifryed/LinearNet | [
"f4fbdcdc98c275a6c21c9efbbc357aa9e88aed6c"
] | [
"scripts/data_pop.py"
] | [
"import os\nimport sys\n\nimport numpy as np\nfrom skimage import io\n\n\ndef main():\n images = os.listdir(sys.argv[1])\n pop_n = int(sys.argv[2]) if len(sys.argv) > 1 else 200\n\n img = io.imread(os.path.join(sys.argv[1], images[0]))\n h, w = img.shape[:2]\n crop_size = 256\n for i in range(pop_... | [
[
"numpy.random.randint"
]
] |
entraned/keras | [
"9400be98783135a1d42dd238f4e6c3aa048eceea"
] | [
"keras/utils/test_utils.py"
] | [
"\"\"\"Utilities related to Keras unit tests.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport six\n\nfrom .generic_utils import has_arg\nfrom ..engine import Model, Input\nf... | [
[
"numpy.random.random",
"numpy.random.normal",
"numpy.testing.assert_allclose",
"numpy.zeros",
"numpy.random.randint"
]
] |
xiaowei1234/statsmodels | [
"a8faaf72b7881620552acace6ca352b8bc628dcd"
] | [
"statsmodels/base/elastic_net.py"
] | [
"import numpy as np\nfrom statsmodels.base.model import Results\nimport statsmodels.base.wrapper as wrap\nfrom statsmodels.tools.decorators import cache_readonly\nfrom statsmodels.base.constraint import ConstraintProjector\n\n\"\"\"\nElastic net regularization.\n\nRoutines for fitting regression models using elasti... | [
[
"numpy.dot",
"numpy.ix_",
"numpy.abs",
"numpy.flatnonzero",
"numpy.ones",
"scipy.optimize.brent",
"numpy.isscalar",
"numpy.zeros",
"numpy.sum"
]
] |
flyingpizza/kaggel-workouts | [
"744a27736fa7878b24f2fc4dc43e956c49b21fef"
] | [
"misc/code reference.py"
] | [
"# code to create subplot\n\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nfig = plt.figure(figsize = (18, 20))\nfor index in range(len(cat_features)):\n plt.subplot(8, 5, index + 1)\n sns.countplot(data = train.dropna(), x = train.loc[:, cat_features[index]])\n plt.xticks(rotation = 90)\n p... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
nvvaulin/medical_imaging | [
"ff00fc43ac0edcfb2151478f89e6c82be40af433"
] | [
"utils/samplers.py"
] | [
"import numpy as np\nimport torch\n\n\nclass WeightedClassRandomSampler(torch.utils.data.WeightedRandomSampler):\n def __init__(self, labels, class_weights=None, label_names=None, names_weights=None):\n if class_weights is None:\n class_weights = [names_weights.get(i, None) for i in label_names... | [
[
"numpy.array"
]
] |
Guo-Xiaoqing/ThresholdNet | [
"e82da9f1266c07518c4037d0a0b3afd6290ca33d"
] | [
"lib/net/fcn.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import models\nfrom torchvision.models.vgg import VGG\n\n\nclass FCN32s(nn.Module):\n\n def __init__(self, pretrained_net, n_class):\n super().__init__()\... | [
[
"torch.nn.Sequential",
"torch.Size",
"torch.nn.ConvTranspose2d",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.BCELoss",
"torch.nn.functional.sigmoid",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
ethanabrooks/dm-haiku | [
"0c030422f0e3a331b6df5aa8f2fe92576444bd3b"
] | [
"examples/vae.py"
] | [
"# Copyright 2020 DeepMind Technologies 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.zeros",
"numpy.prod"
]
] |
GT-melee/initial-trial | [
"88799120788130805927c7139c477aee06b435e1"
] | [
"bobenv.py"
] | [
"import math\n\nimport gym\nfrom gym_minigrid.envs import EmptyEnv, MiniGridEnv, Grid, Goal\nimport numpy as np\nfrom gym_minigrid.wrappers import RGBImgPartialObsWrapper, ImgObsWrapper\n\n\nclass _BobEnv(MiniGridEnv):\n \"\"\"\n Empty grid environment, no obstacles, sparse reward\n \"\"\"\n\n def __ini... | [
[
"numpy.random.randint"
]
] |
VGrondin/CBNetV2_mask_remote | [
"b27246af5081d5395db3c3105d32226de05fcd13"
] | [
"mmdet/models/roi_heads/keypoint_roi_head.py"
] | [
"import numpy as np\nimport torch\nfrom torch.nn import functional as F\nfrom typing import Any, List, Tuple, Union\nfrom detectron2.layers import cat\n\nfrom mmdet.core import bbox2result, bbox2roi\nfrom ..builder import HEADS, build_head, build_roi_extractor\nfrom .standard_roi_head import StandardRoIHead\n\n\n_T... | [
[
"torch.ones",
"torch.zeros",
"torch.cat",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.interpolate",
"torch.arange",
"torch.nonzero",
"numpy.zeros"
]
] |
PFX-Public/pfx-app | [
"9bc6421b49356934d1df311fe399d2bc2b37f63b"
] | [
"src/pages/event_volatility.py"
] | [
"from typing import List\nfrom pathlib import Path\n\nimport streamlit as st\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nfrom .event_utils import *\n\ndef render() -> None:\n st.title(\"Event Volatility\")\n \n ccy_pairs = ['EURUSD', 'EURAUD', 'EURCAD', 'EURCHF', 'EURGBP', ... | [
[
"pandas.read_csv",
"matplotlib.pyplot.subplots"
]
] |
stephenwithav/25-gans-of-04-20 | [
"ae8c475084c95869fc3992a8c6aa5acae693377f"
] | [
"05-ACGAN/acgan.py"
] | [
"'''Trains ACGAN on MNIST using Keras\n\nThis version of ACGAN is similar to DCGAN. The difference mainly\nis that the z-vector of geneerator is conditioned by a one-hot label\nto produce specific fake images. The discriminator is trained to\ndiscriminate real from fake images and predict the corresponding\none-hot... | [
[
"matplotlib.pyplot.imshow",
"tensorflow.keras.layers.Conv2DTranspose",
"numpy.concatenate",
"numpy.random.randint",
"tensorflow.keras.layers.LeakyReLU",
"numpy.unique",
"numpy.reshape",
"numpy.arange",
"numpy.eye",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.kera... |
k-washi/Neural-Scene-Flow-Fields | [
"7a954cf817cd8272e91f3438bed8114bcef7cc0a"
] | [
"nsff_scripts/flow_utils.py"
] | [
"import numpy as np\nimport os\nimport sys\nimport glob\nimport cv2\nimport scipy.io\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\ndef read_img(img_dir, img1_name, img2_name):\n # print(os.path.join(img_dir, img1_name + '.png'))\n return cv2.imread(os.path.join(img_dir, img1_name... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.arctan2",
"numpy.max",
"numpy.concatenate",
"numpy.uint8",
"numpy.arange",
"numpy.finfo",
"numpy.size",
"numpy.load",
"numpy.repeat",
"numpy.zeros",
"numpy.logical_not",
"numpy.min",
"numpy.linalg.inv",
"numpy.isnan"... |
julijanjug/lip2dense_v2 | [
"8a1147f7da1949908b703ba13cbb4dc454d22161"
] | [
"LIP_model.py"
] | [
"import tensorflow as tf\nfrom utils.ops import *\n\n\n#------------------------network setting---------------------\n#################################################\n\n## refine net version 4. 07.17\n\ndef pose_net(image, name):\n with tf.variable_scope(name) as scope:\n is_BN = False\n pose_conv1 ... | [
[
"tensorflow.variable_scope",
"tensorflow.concat",
"tensorflow.add_n"
]
] |
mmotl/cheatsheets | [
"404a2fc6675f27dc85c0f952da7864c03058a3c7"
] | [
"scripts/fonts.py"
] | [
"# -----------------------------------------------------------------------------\n# Matplotlib cheat sheet\n# Released under the BSD License\n# -----------------------------------------------------------------------------\nimport matplotlib.pyplot as plt\nfrom matplotlib.font_manager import FontProperties\n\nfig = ... | [
[
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
]
] |
brunokiyoshi/thermo | [
"5b31d21fd087dd0fc3302f023c5f3c52d9cbee3b"
] | [
"tests/test_eos_mix_methods.py"
] | [
"# -*- coding: utf-8 -*-\n'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.\nCopyright (C) 2020, Caleb Bell <Caleb.Andrew.Bell@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software... | [
[
"numpy.zeros"
]
] |
suhasini-gesis/IWAAN | [
"343b48908198019e9be25332639cded204f8e7b4"
] | [
"visualization/tokens_listener.py"
] | [
"import copy\nimport qgrid\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom IPython.display import display, Markdown as md, clear_output, HTML\nfrom ipywidgets import Output, fixed\nfrom .wordclouder import WordClouder\nfrom .editors_listener import remove_stopwords\nfrom datetime i... | [
[
"pandas.merge",
"pandas.to_datetime",
"pandas.DateOffset",
"pandas.DatetimeIndex",
"pandas.DataFrame",
"numpy.append"
]
] |
kevin3314/gcn_ppi | [
"39b0e618bbb592f9cb8d37edf28deeb7c0987dad"
] | [
"src/datamodules/num_datamodule.py"
] | [
"from pathlib import Path\nfrom typing import Optional, Union\n\nfrom pytorch_lightning import LightningDataModule\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom src.datamodules.datasets.num_dataset import NumDataset\n\n\nclass NumDatasetModule(LightningDataModule):\n def __init__(\n self,\n ... | [
[
"torch.utils.data.DataLoader"
]
] |
catilgan/featureranking | [
"b37fdba4aa0adf678e3e415e909bbdc54a977b07"
] | [
"src/main/python/fearank/ranking/RandomForestClassifierScore.py"
] | [
"from sklearn.ensemble import RandomForestClassifier\n\nfrom fearank.ranking.Ranking import Ranking\n\n\nclass RandomForestClassifierScore(Ranking):\n \"\"\"Select features according to Mutual Info Regression.\n \"\"\"\n\n TYPE = 'random_forest_classifier'\n\n @staticmethod\n def execute(data, cols):... | [
[
"sklearn.ensemble.RandomForestClassifier"
]
] |
FahadMostafa91/Liver_disease_detection_by_Machine_learning_methods | [
"fbe80344fc690a088dc7d2b1128c930194ca2abd"
] | [
"liver_disease_detection_machine_learning.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"PCA_Liver_disease_article.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1M6PyB8Awmb-osk4ZrxMPuHzKeQQAKI0b\n\"\"\"\n\nimport pandas as pd\nimport seaborn as sns\nsns.set(rc={'figure.figsize':(8,8)})\nimpor... | [
[
"sklearn.metrics.roc_auc_score",
"matplotlib.pyplot.legend",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
"sklearn.tree.DecisionTreeClassifier",
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier",
"tensorflow.keras.models.Sequential",
"matplotlib.pypl... |
giadefa/schnetpack | [
"9dabc3b6e3b28deb2fb3743ea1857c46b055efbf"
] | [
"src/schnetpack/nn/activations.py"
] | [
"import numpy as np\nfrom torch.nn import functional\n\n\ndef shifted_softplus(x):\n r\"\"\"Compute shifted soft-plus activation function.\n\n .. math::\n y = \\ln\\left(1 + e^{-x}\\right) - \\ln(2)\n\n Args:\n x (torch.Tensor): input tensor.\n\n Returns:\n torch.Tensor: shifted soft... | [
[
"numpy.log",
"torch.nn.functional.softplus"
]
] |
GuanshuoXu/Jigsaw-Rate-Severity-of-Toxic-Comments | [
"84243994c70124d1a529bb6931f579f7d185d64c"
] | [
"jigsaw19/roberta_large3/train/train.py"
] | [
"import argparse\nimport numpy as np\nimport pandas as pd\nimport os\nfrom tqdm import tqdm\nimport torch.nn as nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom torch.utils.data.distributed import DistributedSampler\nimport torch\nimport random\nim... | [
[
"torch.mean",
"torch.distributed.init_process_group",
"numpy.random.seed",
"torch.cuda.set_device",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.utils.data.distributed.DistributedSampler",
"torch.utils.data.DataLoader",
"torch.distributed.barrier",
"torch.cuda.amp.... |
RCHG/ESMValTool | [
"c6458c72777f22b52b2dcde73749a47e407b77f0"
] | [
"esmvaltool/diag_scripts/aerosols/diagnostics_burden.py"
] | [
"\"\"\"\n\nDiagnostics to estimate aerosols burden analysis.\n\nAuthor: Ramiro Checa-Garcia (LSCE-IPSL)\n rcheca@lsce.ipsl.fr\n\nMethod:\n - It estimates global mean values and create time series\n with monthly and yearly time resolution.\n\nVariables:\n - emidust, emisoa, emiss etc to estimate em... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.use",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.close",
... |
pragneshrana/NumericalOptimization | [
"28ea55840ed95262bc39c0896acee9e54cc375c2"
] | [
"Material/CityTowerProblem/CODE/TowerPlanning.py"
] | [
"#calling libraries\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy as sp\nfrom scipy.spatial import Voronoi, voronoi_plot_2d\nimport random\nimport pandas as pd\nimport sys\nimport os \nfrom datetime import date\nimport time \n\nclass TowerPlanning():\n\n\tdef __init__(self,dim,main_cities,total... | [
[
"pandas.concat",
"scipy.spatial.Voronoi",
"scipy.spatial.voronoi_plot_2d",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"numpy.unique",
"sklearn.cluster.KMeans",
"numpy.linalg.norm",
"pandas.DataFrame",
"numpy.concatenate",
"matplotlib.pyplot.clf",
"matplotlib.py... |
AbrahamSanders/SIMIE | [
"5c3ed41307627c11df3ce2297f5f5369b4b01b79"
] | [
"generator/interact_server.py"
] | [
"from transformers import AutoModelForCausalLM, AutoTokenizer\nfrom flask import Flask, abort, send_from_directory\nfrom flask_restful import Resource, Api, reqparse\nimport argparse\nimport uuid\nimport numpy as np\nimport torch\n\nfrom interact import generate\nfrom identities import Identities\n\nparser = argpar... | [
[
"torch.device",
"torch.cuda.is_available",
"numpy.random.binomial"
]
] |
PhilippMatthes/tensorflow-playground | [
"b5fee6e5f5044dc5cbcd54529d559388a3df7813"
] | [
"Lecture/Kapitel 9 - Seite 230 - Einsatzbereit mit TensorFlow.py"
] | [
"import tensorflow as tf\n\nx = tf.Variable(3, name=\"x\")\ny = tf.Variable(4, name=\"y\")\nf = x * x * y + y + 2\n\nwith tf.Session() as sess:\n x.initializer.run()\n y.initializer.run()\n result1 = f.eval()\n\ninit = tf.global_variables_initializer()\nwith tf.Session() as sess:\n init.run()\n resul... | [
[
"tensorflow.Graph",
"tensorflow.constant",
"tensorflow.Variable",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.get_default_graph"
]
] |
vaynelau/zs3-modified | [
"da48567cb30e60dbe7827f56ec48f1a0098cd94a"
] | [
"zs3/tools.py"
] | [
"import os\nimport sys\nimport yaml\nimport random\nimport pickle\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\n\nclass MeaninglessError(BaseException):\n pass\n\n\nclass Const_Scheduler():\n def __init__(self, step_n='step1'):\n assert (step_n in ['step1', 'step2', ... | [
[
"numpy.diag",
"torch.full",
"numpy.isnan",
"torch.argmin",
"torch.from_numpy",
"numpy.genfromtxt",
"numpy.concatenate",
"torch.tensor",
"numpy.nanmean",
"torch.where",
"numpy.errstate",
"numpy.load",
"numpy.array",
"numpy.zeros"
]
] |
ricardo-ayres/eccpy | [
"39aaf51d1d18bbbc7c25ab3632f67ddbbbbd4fd5"
] | [
"eccpy/compare_raw.py"
] | [
"import ast\nimport eccpy.settings as eccpysettings\nimport eccpy.tools as tools\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pandas as pd\nimport sys\n\ndef compare_rawdata(settings_excel_file, sample_names, **kwargs):\n \"\"\" Compare raw dose-response curves between selected samples... | [
[
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close",
"numpy.linspace"
]
] |
hectornieto/wapor-et-look | [
"e05b8f24616af8fc99ac1d646c878b353cb35aef"
] | [
"pyWAPOR/ETLook/radiation.py"
] | [
"import numpy as np\nfrom pyWAPOR.ETLook import constants as c\n\ndef interception_wm2(int_mm, lh_24):\n r\"\"\"\n Computes the energy equivalent for the interception in Wm-2 if it\n is provide in mm/day\n\n .. math ::\n I = \\frac{\\lambda I^*}{86400}\n\n Parameters\n ----------\n int_m... | [
[
"numpy.minimum",
"numpy.sqrt",
"numpy.sin",
"numpy.zeros_like",
"numpy.exp",
"numpy.where"
]
] |
padix-key/fastpdb | [
"016c0211743fcbf4366fdaf6fb5579ff073c6274"
] | [
"benchmark.py"
] | [
"import time\nimport tempfile\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport numpy as np\nimport biotite.database.rcsb as rcsb\nimport biotite.structure.info as info\nimport biotite.structure.io.pdb as pdb\nimport fastpdb\n\n\nREPEATS = 1000\nPDB_ID = \"1AKI\"\nWIDTH... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.ticker.IndexLocator",
"matplotlib.rc"
]
] |
rkneusel9/SwarmOptimization | [
"5445b6f90ab49339ca0fdb71e98d44e6827c95a8"
] | [
"store/store_de_ro_prices.py"
] | [
"import numpy as np\nimport pickle\nimport matplotlib.pylab as plt\n\nd = pickle.load(open(\"de_50_40_16000_results.pkl\",\"rb\"))\nr = pickle.load(open(\"ro_50_40_16000_results.pkl\",\"rb\"))\n#g = pickle.load(open(\"ga_50_40_16000_results.pkl\",\"rb\"))\np = np.array(pickle.load(open(\"products.pkl\",\"rb\"))[-1]... | [
[
"matplotlib.pylab.tight_layout",
"matplotlib.pylab.show",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.plot",
"matplotlib.pylab.legend",
"numpy.argsort",
"matplotlib.pylab.savefig",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.close"
]
] |
tomaszmrugalski/astro | [
"c4d270a8d7830fcf799c2cbafe7f7b2070072cc9"
] | [
"tests/interplanetary_test.py"
] | [
"from astropy import units as u\nfrom perylune import interplanetary\nfrom perylune.orbit_tools import *\n\nfrom poliastro.twobody import Orbit\nfrom poliastro.bodies import Earth, Sun\nimport numpy as np\n\nfrom test_tools import *\n\ndef test_escape_velocity():\n\n # TEST CASE 1:\n # This is circular orbit,... | [
[
"numpy.abs"
]
] |
zdx198811/lab604-automation | [
"f73acdce38422d9c3a0845a553efa4eebc662086"
] | [
"core/ook_lib.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 2 15:16:16 2018\n\n@author: dongxucz\n\"\"\"\n\nimport numpy as np\nimport csv as csvlib\nfrom locale import atoi\nfrom os.path import exists\n# from torch.utils.data import Dataset\n\nclass OOK_signal:\n \"\"\"Create (randomly generate|load from file) or sav... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.sign",
"numpy.random.randint"
]
] |
astrofrog/hyperion | [
"e90d7af1df4f064a960594d812c07ff27d87fcc7"
] | [
"hyperion/model/image.py"
] | [
"import numpy as np\n\nfrom ..util.functions import FreezableClass, is_numpy_array\nfrom ..util.constants import c\n\n\nclass Image(FreezableClass):\n \"\"\"\n Class to represent an image or set of images\n\n Parameters\n ----------\n nu : ndarray\n The frequencies at which the image is define... | [
[
"numpy.array",
"numpy.isreal",
"numpy.isscalar"
]
] |
anil-slt/Rasa | [
"53685e85a3c9185f51e4f12cc055d2a65bb5314d"
] | [
"tests/nlu/classifiers/test_embedding_intent_classifier.py"
] | [
"import numpy as np\nimport pytest\nimport scipy.sparse\n\nfrom rasa.nlu.constants import (\n TEXT_ATTRIBUTE,\n SPARSE_FEATURE_NAMES,\n DENSE_FEATURE_NAMES,\n INTENT_ATTRIBUTE,\n)\nfrom rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier\nfrom rasa.nlu.training_data import ... | [
[
"numpy.zeros",
"numpy.random.rand",
"numpy.random.randint"
]
] |
taokong/ibot | [
"a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0"
] | [
"evaluation/semantic_segmentation/mmcv_custom/checkpoint.py"
] | [
"# Copyright (c) ByteDance, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nCopy-paste from mmcv library:\nhttps://github.com/open-mmlab/mmcv/\n\"\"\"\n\nimport io\nimport os\nimp... | [
[
"numpy.linspace",
"torch.load",
"torch.cat",
"numpy.arange",
"torch.distributed.barrier",
"numpy.concatenate",
"torch.nn.functional.interpolate",
"scipy.interpolate.interp2d",
"numpy.array",
"torch.save"
]
] |
narek-davtyan/bigquery-bokeh-dashboard | [
"e2f8ab7684ded7bad81ac8d7b5ffaa3eb954481f"
] | [
"dashboard/main.py"
] | [
"import pandas as pd\nimport numpy as np\n\n\n# Import multiprocessing libraries\nfrom pandarallel import pandarallel\n\n# Initialization\npandarallel.initialize()\n\n# Load data\nmin_list_of_columns_to_load = ['company', 'service', 'recommendation', 'easiness', 'rec_sc', 'eas_sc']\ndf_orig = pd.read_excel(r'CDD1.x... | [
[
"pandas.merge",
"pandas.read_excel",
"pandas.DataFrame",
"numpy.array",
"numpy.empty"
]
] |
giacomodeodato/BrainMRIDataset | [
"7f2dd315e7c970c61651e025dcafbed94caa8924"
] | [
"brainMRI/dataset.py"
] | [
"import os\nimport numpy as np\nimport h5py\nfrom skimage.io import imread\nfrom datetime import datetime\nfrom tqdm.auto import tqdm\n\nfrom .utils import preprocess_volume, preprocess_mask\n\nclass Dataset():\n \"\"\"\n TCGA-LGG dataset of brain MRIs for Lower Grade Glioma segmentation.\n\n Attributes:\n... | [
[
"numpy.unique",
"numpy.zeros_like",
"numpy.moveaxis",
"numpy.array",
"numpy.where",
"numpy.empty",
"numpy.random.default_rng"
]
] |
animucki/2mmn40 | [
"c54c0e4e9c801d63f048fbb5d9abd8fe9432cfdc"
] | [
"Simulating hydrogen/functionsHydrogenSimulation.py"
] | [
"###################################################################################\r\n################################# FUNCTIONS #######################################\r\n###################################################################################\r\nimport numpy as np\r\nimport time\r\nfrom sklearn.metr... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.round",
"numpy.concatenate",
"numpy.cross",
"numpy.where",
"numpy.sin",
"numpy.diff",
"numpy.repeat",
"numpy.zeros",
"numpy.random.choice",
"numpy.floor",
"numpy.array",
"numpy.random.seed",
"numpy.linalg.norm",
"num... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.