repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kevtran23/optuna
[ "4f2fa9c60d9a216ff3cfbc0f3ca12cb32ff53434" ]
[ "tests/importance_tests/fanova_tests/test_tree.py" ]
[ "import math\nfrom typing import Dict\nfrom typing import List\nfrom typing import Tuple\nfrom unittest.mock import Mock\n\nimport numpy\nimport pytest\n\nfrom optuna.importance._fanova._tree import _FanovaTree\n\n\n@pytest.fixture\ndef tree() -> _FanovaTree:\n sklearn_tree = Mock()\n sklearn_tree.n_features ...
[ [ "numpy.testing.assert_equal", "numpy.testing.assert_array_equal", "numpy.average", "numpy.array", "numpy.sum" ] ]
Ls-Dai/pysyft-federated-learning-GAN
[ "a65c10fa98b0419c275dd9d8405554f84137318c" ]
[ "train.py" ]
[ "import torch.nn.functional as func\r\n\r\ndef train_unit(config, model, device, federated_train_loader, optimizer, epoch):\r\n model.train()\r\n for batch_idx, (data, target) in enumerate(federated_train_loader):\r\n # send model to federated points\r\n model.send(data.location)\r\n data...
[ [ "torch.nn.functional.nll_loss" ] ]
timhannifan/prioritizer
[ "892efb7dcd95a1b60e0a8b433f19522e2bf88cb4" ]
[ "src/prioritizer/components/timechop/plotting.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.dates as md\nimport numpy as np\nimport sys\nsys.path.append('../')\nfrom conf import convert_str_to_relativedelta\nimport matplotlib.pyplot as plt\n\n\nFIG_SIZE = (32, 16)\n\n\ndef visualize_chops(chopper, show_as_of_times=True, show_boundaries=True, sav...
[ [ "matplotlib.dates.DateFormatter", "numpy.random.random", "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.dates.YearLocator", "matplotlib.pyplot.show", "matplotlib.dates.MonthLocator", "matplotlib.pyplot.NullLocator" ] ]
gdsfactory/gdsfactory
[ "e53b1f3415a81862d465e0443fc09fb35d14d1e0", "ee761ae0b4429fbec7035bbea5d1e5206c66bea7", "ee761ae0b4429fbec7035bbea5d1e5206c66bea7" ]
[ "gdsfactory/simulation/modes/types.py", "gdsfactory/simulation/modes/test_find_modes_dispersion.py", "gdsfactory/simulation/modes/find_neff_ng_dw_dh.py" ]
[ "import dataclasses\nfrom typing import Callable, Dict, List, Optional, Union\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom meep import mpb\nfrom pydantic import BaseModel\n\n\n@dataclasses.dataclass\nclass Mode:\n mode_number: int\n wavelength: float\n neff: float\n ng: Optional[float] =...
[ [ "matplotlib.pyplot.imshow", "numpy.abs", "matplotlib.pyplot.title", "numpy.multiply", "matplotlib.pyplot.colorbar", "numpy.real", "matplotlib.pyplot.subplot", "numpy.log10", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ], [ "n...
rihabbns/recommendation-system
[ "ba2178a1b966d12657b111e8c02d165f73b17cde" ]
[ "Code python utilisateur .py" ]
[ "import mysql.connector\nimport numpy as np\nfrom scipy import spatial\n\n\ndef SimilariteCosinus(idU1,idU2):\n return (1-spatial.distance.cosine(matriceNotes[idU1],matriceNotes[idU2]))\n\n\n\n \nconn = mysql.connector.connect(host=\"localhost\",user=\"root\",password=\"\", database=\"psrec\")\n\n\ncursor=conn.c...
[ [ "numpy.savetxt", "numpy.zeros", "scipy.spatial.distance.cosine" ] ]
keszybz/python-pytest-harvest
[ "ef11d3addeae51168ab892b7806c2b4c270e2a82" ]
[ "pytest_harvest/tests_raw/test_all_together.py" ]
[ "# META\n# {'passed': 9, 'skipped': 0, 'failed': 0}\n# END META\nfrom collections import OrderedDict\nfrom itertools import product\n\nimport pytest\n\nfrom pytest_harvest import create_results_bag_fixture, saved_fixture, get_session_synthesis_dct\n\n\n@pytest.fixture(scope='module', autouse=True)\ndef store():\n ...
[ [ "pandas.DataFrame.from_dict" ] ]
wx-b/unsup-3d-keypoints
[ "8a2e687b802d19b750aeadffa9bb6970f5956d4d", "8a2e687b802d19b750aeadffa9bb6970f5956d4d" ]
[ "utils/vis_utils.py", "environments/locomotion/gym_locomotion_envs.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport random\n\n\ndef get_cmap(n):\n \"\"\"Returns a function that maps each index in 0, 1, ..., n-1 to a distinct\n RGB color; the keyword argument name must be a standard mpl colormap name.\"\"\"\n cmap_fn = plt.cm.get_cmap('hsv', n+1)\n colors = ...
[ [ "numpy.array", "matplotlib.pyplot.cm.get_cmap" ], [ "numpy.square", "numpy.abs", "numpy.isfinite" ] ]
dkorenci/udacity_deeplearn
[ "149273733a8075381baf33fb0aa1b17a4a681dde", "149273733a8075381baf33fb0aa1b17a4a681dde" ]
[ "03 Deep Neural Networks/optimal_network/nn_optimal.py", "05 Deep Models for Texts/assignment6_lstm/batch_generator.py" ]
[ "'''\nFurther performance optimizations of previous networks by adding\nmore layers and learning rate decay.\n'''\n\nimport tensorflow as tf\nimport numpy as np\nfrom tensorflow.python.framework import dtypes\n\nfrom notmnist.dataset import loadDataset\nfrom notmnist.settings import *\n\nds = loadDataset('notMNIST_...
[ [ "tensorflow.nn.relu", "tensorflow.Graph", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.truncated_normal", "tensorflow.Variable", "tensorflow.zeros", "tensorflow.matmul", "tensorflow.placeholder", "tensorflow.train.exponential_decay",...
sijunx/bert4keras
[ "3161648d20bfe7f501297d4bb33a0bad1ffd4002" ]
[ "examples/task_iflytek_multigpu.py" ]
[ "#! -*- coding:utf-8 -*-\n# 文本分类多gpu版\n# 数据集:IFLYTEK' 长文本分类 (https://github.com/CLUEbenchmark/CLUE)\n\nimport os\n\nos.environ['TF_KERAS'] = '1' # 必须使用tf.keras\n\nimport json\nimport numpy as np\nimport tensorflow as tf\nfrom bert4keras.backend import keras, K\nfrom bert4keras.tokenizers import Tokenizer\nfrom ber...
[ [ "tensorflow.distribute.MirroredStrategy" ] ]
SalimChikh/edem-clase-git
[ "c034af54882215c111d5c5105744a4ff08f9dd9f", "c034af54882215c111d5c5105744a4ff08f9dd9f" ]
[ "regresion.py", "primera_clase_sesion2.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 13 15:32:52 2019\n\n@author: salim\n\"\"\"\n\n#a + b*X\n# intercept cuando estoy a 0 cuanto vendo \n#R^2 significa si tiene impacto o no (que percentaje de mis vientas depende de la otra variable)\n\n\n\n\n\n#load basiclibraries\nimport os...
[ [ "pandas.read_csv" ], [ "pandas.merge", "pandas.read_excel", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "matplotlib.pyplot.hist" ] ]
junsu-kim97/self_improved_retro
[ "5bb2e641a57a0623f509dd7a006896e6a105373c", "5bb2e641a57a0623f509dd7a006896e6a105373c" ]
[ "preprocessing/build_raw_template.py", "retro_star/alg/molstar.py" ]
[ "import argparse\nimport pandas as pd\nfrom tqdm import tqdm\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description=\"build prod2tpl file for training MLP\")\n parser.add_argument(\"--input\", required=True,\n type=str)\n parser.add_argument(\"--mol2tpl_save_pat...
[ [ "pandas.read_csv" ], [ "numpy.array", "numpy.argmin", "numpy.min" ] ]
J-Light/pyansys
[ "facdb69f5c83e55de2b789b629ebbcbfa507e339" ]
[ "pyansys/binary_reader.py" ]
[ "\"\"\"\nUsed v150/ansys/customize/user/ResRd.F to help build this interface\n\n\"\"\"\nimport vtk\nimport struct\nimport os\nimport numpy as np\nimport warnings\nimport logging\nimport ctypes\nfrom ctypes import c_int64\n\nimport vtkInterface\nfrom pyansys import _parsefull\nfrom pyansys import _rstHelper\nfrom py...
[ [ "numpy.split", "numpy.imag", "numpy.linspace", "numpy.asarray", "numpy.in1d", "numpy.cumsum", "numpy.all", "numpy.seterr", "numpy.zeros_like", "numpy.any", "scipy.sparse.coo_matrix", "numpy.ones_like", "numpy.unique", "numpy.empty_like", "numpy.sin", ...
kafluette/ffnnet
[ "34008aaa9f65a90724298eb92b69a1312da33e65" ]
[ "preprocess_iris_data.py" ]
[ "#!/usr/bin/env python\nimport csv\nimport numpy\nimport cPickle\n\n# load data from csv\nrawdata = [row for row in csv.reader(open('iris.data', 'rb')) if len(row) > 0]\n\n# partition into thirds\ninxs = numpy.random.permutation(len(rawdata))\nrawdata = [rawdata[i] for i in inxs]\nmaxs = []\nmins = []\nfor i in ran...
[ [ "numpy.asarray" ] ]
kruda/LightGBM
[ "ddcab83422a9d21ce6393a968449a466843d52f4" ]
[ "tests/python_package_test/test_dask.py" ]
[ "# coding: utf-8\n\"\"\"Tests for lightgbm.dask module\"\"\"\n\nimport inspect\nimport pickle\nimport random\nimport socket\nfrom itertools import groupby\nfrom os import getenv\nfrom sys import platform\n\nimport pytest\n\nimport lightgbm as lgb\n\nif not platform.startswith('linux'):\n pytest.skip('lightgbm.da...
[ [ "numpy.array", "sklearn.utils.estimator_checks.check_parameters_default_constructible", "pandas.Series", "numpy.min", "numpy.unique", "numpy.cumsum", "sklearn.datasets.make_regression", "numpy.max", "numpy.mean", "numpy.count_nonzero", "numpy.testing.assert_allclose", ...
tdivoll/betterchurn
[ "f1540cc341326ff15d38b0f70f1c79a7a8b801e3" ]
[ "frontend/turnoverapp.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport os, sys\nimport importlib.util\nimport matplotlib.pyplot as plt\nimport pickle\nimport altair as alt\n\nif len(sys.argv) > 1:\n folder = os.path.abspath(sys.argv[1])\nelse:\n folder = os.path.abspath(os.getcwd())\n \n# Get filenames f...
[ [ "numpy.array", "pandas.read_csv", "pandas.to_numeric" ] ]
ForrestPi/FaceSolution
[ "cf19b2916a8bf285e457903e8d202055b092fc73", "cf19b2916a8bf285e457903e8d202055b092fc73" ]
[ "face/demo03.py", "face/demo06.py" ]
[ "from __future__ import print_function, division\nimport os\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom dataUtil import *\n\n\n\nif __name__==\"__main__\":\n face_dataset=FaceLandmarksDataset(csv_file='./faces/face_landmarks.csv...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "torch.utils.data.DataLoader" ] ]
calvinyong/adversarial_examples_capproj
[ "972e89e105dec6dc5f61e62f378d06656698b71d" ]
[ "Scripts/adv_csv_cifar10.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\nfrom cleverhans.attacks import FastGradientMethod, DeepFool, MadryEtAl\nfrom cleverhans.utils_keras import KerasModelWrapper\n\nfrom keras.datasets import cifar10\nfrom keras.models import load_model\nfrom keras.util...
[ [ "pandas.concat", "numpy.squeeze", "numpy.linalg.norm", "pandas.DataFrame", "numpy.concatenate", "numpy.array" ] ]
msg4rajesh/TB2J
[ "2a8dbec0788abe4201fd7001b29b8dfb2aeead64" ]
[ "TB2J/manager.py" ]
[ "import os\nfrom TB2J.myTB import MyTB, merge_tbmodels_spin\nimport numpy as np\nfrom TB2J.exchange import ExchangeCL, ExchangeNCL\nfrom TB2J.exchangeCL2 import ExchangeCL2\nfrom TB2J.exchange_qspace import ExchangeCLQspace\nfrom TB2J.utils import read_basis, auto_assign_basis_name\nfrom ase.io import read\nfrom TB...
[ [ "numpy.vstack" ] ]
zurutech/ashpy
[ "16d53100c943abf4b051b27cfd025df0a6e7c8c9", "16d53100c943abf4b051b27cfd025df0a6e7c8c9" ]
[ "tests/utils/fake_datasets.py", "src/ashpy/metrics/metric.py" ]
[ "# Copyright 2020 Zuru Tech HK 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# Unless required b...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.random.normal", "tensorflow.zeros" ], [ "tensorflow.distribute.get_strategy", "tensorflow.train.CheckpointManager", "numpy.isclose" ] ]
2218084076/hotpoor_autoclick_xhs
[ "a52446ba691ac19e43410a465dc63f940c0e444d" ]
[ "demo_6_opencv/fourfaces.py" ]
[ "import cv2\nimport dlib\nimport time\nimport glob\nimport numpy as np\n\ndef x4faces(num):\n imgs, heights, widths = [], [], []\n # read imgs\n for f in glob.glob(r\"D:\\github\\1\\hotpoor_autoclick_xhs\\demo_6_opencv\\afterWork\\*.jpg\"):\n if 'Mac' in f:\n img = cv2.imread(f, -1) # 参数...
[ [ "numpy.concatenate" ] ]
NTU-SER/speech_utils
[ "84b1ec7da5bf435c09401fc33f6b81346b80a5fe", "84b1ec7da5bf435c09401fc33f6b81346b80a5fe" ]
[ "scripts/ACRNN/train_tf.py", "speech_utils/ACRNN/torch/model_utils.py" ]
[ "import sys\nimport argparse\nimport pickle\n\nfrom tensorflow.compat.v1 import ConfigProto, InteractiveSession\nimport tensorflow as tf\n\nfrom speech_utils.ACRNN.tf.model_utils import train\n\nconfig = ConfigProto(log_device_placement=True)\nconfig.gpu_options.allow_growth = True\nsession = tf.Session(config=conf...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.Session" ], [ "torch.nn.Softmax", "torch.load", "torch.utils.data.DataLoader", "pandas.DataFrame", "numpy.concatenate", "torch.no_grad", "numpy.moveaxis", "torch.device", "torch.nn.Dropout", "torch.nn.CrossEntropyL...
junzhezhang/mmclassification
[ "53c0df271fd84a6a10a315dde6875b5c82033c1f" ]
[ "mmcls/models/utils/se_layer.py" ]
[ "import mmcv\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule\nfrom mmcv.runner import BaseModule\n\n\n# class SELayer(nn.Module):\nclass SELayer(BaseModule):\n \"\"\"Squeeze-and-Excitation Module.\n\n Args:\n channels (int): The input (and output) channels of the SE layer.\n ratio (int):...
[ [ "torch.nn.AdaptiveAvgPool2d" ] ]
BluCodeGH/Amulet-Map-Editor
[ "7d1d2243fc29095b3cffe8aa4979235444ba6738" ]
[ "src/formats/anvil/anvil_world.py" ]
[ "from __future__ import annotations\n\nimport struct\nimport zlib\nfrom io import BytesIO\nfrom typing import List, Tuple, Union\nfrom collections import defaultdict\n\nimport numpy\n\nfrom api import WorldFormat\nfrom nbt import nbt\nfrom os import path\n\nfrom api.world import World\nfrom api.block import Block\n...
[ [ "numpy.unique", "numpy.frombuffer", "numpy.zeros_like", "numpy.where", "numpy.zeros" ] ]
dqshuai/NAE4PS
[ "476dee524bb40c1f89fc0a30f37c735a2c0ee082" ]
[ "lib/model/resnet_backbone.py" ]
[ "'''\nMinor modificatin from https://github.com/pytorch/vision/blob/2b73a4846773a670632b29fb2fc2ac57df7bce5d/torchvision/models/detection/backbone_utils.py#L43\n'''\nfrom collections import OrderedDict\n\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torchvision.models import resnet\nfrom torchvision....
[ [ "torch.nn.functional.adaptive_max_pool2d" ] ]
NishanthVAnand/jelly-bean-world
[ "a43c603f8b9a07dc2d0bc0b04db1b42be451023f" ]
[ "api/python/src/jbw/environments.py" ]
[ "# Copyright 2019, The Jelly Bean World Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "numpy.array" ] ]
fa1c0n-king/Malware-Classification-using-Deep-Learning
[ "f26831e669e80d64298317f175fcdc14945b7a57" ]
[ "MachineLearning/supervised_training/Random_Forest/RF_hyperopt.py" ]
[ "\nfrom hpsklearn import HyperoptEstimator, random_forest\nfrom hyperopt import tpe\n\nimport pandas as pd\n\n\ndef main():\n\n df_train = pd.read_csv('../train_dataset.csv')\n df_test = pd.read_csv('../test_dataset.csv')\n\n X_train, y_train = df_train.iloc[:, 2:].values, df_train.iloc[:, 0].values\n X...
[ [ "pandas.read_csv" ] ]
MichaelWS/vix_utils
[ "c7a73a0c4013f7eb2329cfe27eb012028fa31cdd" ]
[ "src/vix_utils/vixutil.py" ]
[ "\"\"\"\nThis module provides both the command line program and a Python interface to provide\nthe VIX futures term structure, the VIX continuous maturity\nterm structure, and the VIX cash term structure.\n\n\"\"\"\nimport argparse\nimport vix_utils.vix_futures_term_struture as v\nimport vix_utils.vix_cash_term_str...
[ [ "pandas.read_pickle", "pandas.to_datetime" ] ]
romainfd/qiskit-terra
[ "b5285ccc5cb1d17b7c73402833f2750b93652426", "b5285ccc5cb1d17b7c73402833f2750b93652426" ]
[ "qiskit/circuit/library/iqp.py", "qiskit/circuit/library/standard_gates/y.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "numpy.array_str", "numpy.array" ], [ "numpy.array" ] ]
sptuan/RL-playground
[ "1180b6ec41a83707193b396a5c68b5dabe4063a5" ]
[ "01_Q-learning/ex2/env_tk.py" ]
[ "\"\"\"\nReinforcement learning maze example.\nThis script is our maze environment, in which a bike driver tries to arrive at FINAL POINT.\nThis script is modified from https://morvanzhou.github.io/tutorials/\n\"\"\"\n\n\nimport numpy as np\nimport time\nimport sys\nfrom random import choice\n\nif sys.version_info....
[ [ "numpy.array" ] ]
natxopedreira/ofxTensorFlow2
[ "a8ef10fa3380e2d55bbd3c7cccaa363d9c7ba9ad" ]
[ "example_pix2pix/python/src/models.py" ]
[ "from .blocks import *\nfrom config import *\nfrom tensorflow import random_normal_initializer\nfrom tensorflow.keras.layers import (\n Conv2DTranspose, Concatenate, Input, Activation,\n concatenate, BatchNormalization, ZeroPadding2D, LeakyReLU\n)\nfrom tensorflow.keras.models import Model\n\n\ndef Generator(...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.concatenate", "tensorflow.keras.layers.BatchNormalization", "tensor...
Roboy/LSM_SpiNNaker_MyoArm
[ "04fa1eaf78778edea3ba3afa4c527d20c491718e", "04fa1eaf78778edea3ba3afa4c527d20c491718e" ]
[ "src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pyNN/standardmodels/cells.py", "src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spynnaker/pyNN/models/neuron/synapse_io/synapse_io_row_based.py" ]
[ "\"\"\"\nDefinition of default parameters (and hence, standard parameter names) for\nstandard cell models.\n\nPlain integrate-and-fire models:\n IF_curr_exp\n IF_curr_alpha\n IF_cond_exp\n IF_cond_alpha\n \nIntegrate-and-fire with adaptation:\n IF_cond_exp_gsfa_grr\n EIF_cond_alpha_isfa_ista\n ...
[ [ "numpy.array" ], [ "numpy.arange", "numpy.rint", "numpy.finfo", "numpy.concatenate", "numpy.round", "numpy.frombuffer", "numpy.repeat", "numpy.zeros", "numpy.where" ] ]
vnagaraju14/SFRAT
[ "a5b90055616fdf3869ac48004d357122f20fdf1d" ]
[ "shekar/core/utils.py" ]
[ "import pandas as pd\nfrom PyQt5 import QtCore\n\n\nclass PandasModel(QtCore.QAbstractTableModel): \n \"\"\"\n Abstract model to populate a QTableWidget with a Pandas dataframe\n Usage:\n df = pd.read_csv(path)\n model = PandasModel(df)\n self.tableView.setModel(model)\n \"\"\"\n def __init_...
[ [ "pandas.DataFrame" ] ]
Avinandan2604/RoManOV_Automation
[ "35e45947719f610193f6c4d06ca627f854646998" ]
[ "Resources/Chapters/Chapter 1/detect_faces_video.py" ]
[ "# USAGE\n# python detect_faces_video.py --prototxt deploy.prototxt.txt --model res10_300x300_ssd_iter_140000.caffemodel\n\n# import the necessary packages\nfrom imutils.video import VideoStream\nimport numpy as np\nimport argparse\nimport imutils\nimport time\nimport cv2\n\n# construct the argument parse and parse...
[ [ "numpy.array" ] ]
hwfan/FairMOT
[ "ccbfee2f8bc1f5a0e00b7b071454219f899ba3a3" ]
[ "src/lib/tracker/multitracker.py" ]
[ "import numpy as np\nfrom numba import jit\nfrom collections import deque\nimport itertools\nimport os\nimport os.path as osp\nimport time\nimport torch\nimport cv2\nimport torch.nn.functional as F\nimport ipdb\nfrom roi_align import RoIAlign # RoIAlign module\nfrom roi_align import CropAndResize # crop_and_re...
[ [ "numpy.partition", "torch.nn.functional.normalize", "torch.mean", "numpy.expand_dims", "numpy.asarray", "numpy.arange", "numpy.linalg.norm", "numpy.concatenate", "torch.no_grad", "torch.device", "numpy.array", "numpy.where", "numpy.empty" ] ]
infinityplusb/Traffic_Sign_Classifier
[ "f9aedc0beed329fe1413818b4f49723d4e490cf2" ]
[ "traffic_sign_classifier.py" ]
[ "import tensorflow as tf\n\nimport pickle\n\ntraining_file = \"/home/brian/Documents/Training/Udacity/Self_Driving_Car/data/train.p\"\nvalidation_file = \"/home/brian/Documents/Training/Udacity/Self_Driving_Car/data/valid.p\"\ntesting_file = \"/home/brian/Documents/Training/Udacity/Self_Driving_Car/data/tes...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot", "numpy.unique", "matplotlib.pyplot.figure" ] ]
MenasriaMohamed/melanomaDetectionApp
[ "43f65e293b751d3e6a1c60a7ffd37dc0af4bfce5" ]
[ "melanomaApp/detector/utils/Caracteristics.py" ]
[ "import cv2\nimport numpy as np\nimport imutils\nfrom .Preprocess import Preprocess\nimport math\nfrom matplotlib import pyplot as plt\n\n'''\n get ABCD, 7 points, menzies caracteristics\n'''\nclass Caracteristics:\n '''\n needed for Assymetry A\n get roundness of the contour\n '''\n @stat...
[ [ "matplotlib.pyplot.imshow", "numpy.sqrt", "numpy.power", "numpy.min", "numpy.subtract", "numpy.copy", "numpy.append", "numpy.argmin", "numpy.shape", "numpy.count_nonzero", "numpy.array", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.show" ] ]
yangyuan333/MvSMPLfitting
[ "c6d92c0e50531c7b9480c57212b3e0e99249525f" ]
[ "sdf/sdf/sdf_loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom sdf import SDF\n\nclass SDFLoss(nn.Module):\n\n def __init__(self, faces, grid_size=32, robustifier=None, debugging=False):\n super(SDFLoss, self).__init__()\n self.sdf = SDF()\n self.register_buffer('faces', torch.tensor(faces...
[ [ "torch.ones", "torch.zeros", "torch.tensor", "torch.nn.functional.grid_sample", "torch.no_grad" ] ]
kevinghst/UDA_sup
[ "c970622370d5de6b8c48b458cb8b4fe59e37effb" ]
[ "load_data.py" ]
[ "# Copyright 2019 SanghunYun, Korea University.\n# (Strongly inspired by Dong-Hyun Lee, Kakao Brain)\n# \n# This file has been modified by SanghunYun, Korea Univeristy.\n# Little modification at Tokenizing, AddSpecialTokensWithTruncation, TokenIndexing\n# and CsvDataset, load_data has been newly written.\n#\n# Lice...
[ [ "torch.utils.data.DataLoader", "pandas.read_csv", "torch.utils.data.Dataset.__init__", "torch.tensor" ] ]
jmoch1214/gcpy
[ "d0f7e9014efdc3bc430e941de6cc84113d5f16c3" ]
[ "gcpy/grid/horiz.py" ]
[ "\"\"\" Horizontal grid definitions and helper functions \"\"\"\n\nimport numpy as np\nfrom numpy import asarray\nfrom .. constants import R_EARTH\nfrom itertools import product\n\nINV_SQRT_3 = 1.0 / np.sqrt(3.0)\nASIN_INV_SQRT_3 = np.arcsin(INV_SQRT_3)\n\ndef make_grid_LL(llres):\n [dlat,dlon] = list(map(float,...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.arcsin", "numpy.asarray", "numpy.abs", "numpy.arange", "numpy.cos", "numpy.rad2deg", "numpy.sin", "numpy.round", "numpy.arctan2", "numpy.deg2rad", "numpy.vectorize", "numpy.flip", "numpy.cross", "numpy.array", ...
cmpute/d3d
[ "dbe43e5608653c5b743423541a80e388e13be771", "dbe43e5608653c5b743423541a80e388e13be771" ]
[ "d3d/tracking/tracker.py", "d3d/dataset/cadc/utils.py" ]
[ "\nimport numpy as np\n\nfrom d3d.abstraction import ObjectTarget3D, Target3DArray, TrackingTarget3D\nfrom d3d.tracking.filter import Pose_3DOF_UKF_CTRA, Box_KF\nfrom d3d.tracking.matcher import HungarianMatcher, DistanceTypes\n\nclass VanillaTracker:\n '''\n Implementation of a vanilla tracker based on Kalma...
[ [ "numpy.eye", "numpy.any" ], [ "numpy.timedelta64", "scipy.spatial.transform.Rotation.from_euler", "numpy.asanyarray", "numpy.asarray" ] ]
gusoliveira21/Text_Classification
[ "cb6878262031aea2bfca3177c2e5c8b0d153fe1b" ]
[ "code/CNN.py" ]
[ "from keras.layers import Dropout, Dense,Input,Embedding,Flatten, AveragePooling2D, Conv2D,Reshape\r\nfrom keras.models import Sequential,Model\r\nfrom sklearn.feature_extraction.text import TfidfVectorizer\r\nimport numpy as np\r\nfrom sklearn import metrics\r\nfrom keras.preprocessing.text import Tokenizer\r\nfro...
[ [ "numpy.random.seed", "numpy.asarray", "numpy.arange", "numpy.concatenate", "numpy.argmax", "numpy.array", "sklearn.metrics.classification_report", "sklearn.datasets.fetch_20newsgroups" ] ]
enjlife/bert4torch
[ "53694060fed0351649f87c79381740851a4a0b42" ]
[ "bert_torch/models.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.Dropout", "torch.load", "torch.zeros_like", "torch.nn.Linear" ] ]
guireis1/testpos
[ "efe22724d4c3512dd5336dc9788704793793122d" ]
[ "TakeBlipPosTagger/mlflowlogger.py" ]
[ "import os\nimport psutil\nimport mlflow\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\ndef save_confusion_matrix_from_tensor(confusion_matrix, labels,\n current_epoch, save_dir):\n \"\"\"Receive a confusion matrix from tensor, generate a image \n with seabor...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure" ] ]
farhanone/frcnn-from-scratch-with-keras
[ "69f5643780caabdcdbe6965e95463ce9b6fbad49" ]
[ "measure_map.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport sys\nimport pickle\nfrom optparse import OptionParser\nimport time\nfrom keras_frcnn import config\nimport keras_frcnn.resnet as nn\nfrom keras import backend as K\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras_frcnn import roi_helpers\...
[ [ "numpy.expand_dims", "numpy.max", "numpy.argmax", "sklearn.metrics.average_precision_score", "numpy.transpose", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
eucarito/UFPR
[ "060857296663002ae8891c2d0a84910ca685f1aa" ]
[ "introducao-computacao-cientifica/trab-2/trabalho-2-icc/python_scripts/graph.py" ]
[ "import plotly.graph_objects as go\nimport pandas as pd\nimport numpy as np\n\ndef plot_flops(flops_df):\n fig = go.Figure()\n fig.add_trace(go.Scatter(x=flops_df.index, y=flops_df[1], name='flops_dp - Gauss Jacobi', line=dict(color='#2A9D8F')))\n fig.add_trace(go.Scatter(x=flops_df.index, y=flops_df[2], n...
[ [ "pandas.read_csv" ] ]
marcosfelt/sysid-neural-structures-fitting
[ "80eda427251e8cce1d2a565b5cbca533252315e4", "80eda427251e8cce1d2a565b5cbca533252315e4" ]
[ "examples/cartpole_example/old/ode_pendulum_forward_eul_explicit.py", "examples/cartpole_example/cartpole_SS_ident_1step.py" ]
[ "import os\nimport argparse\nimport time\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom scipy.integrate import odeint\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nparser = argparse.ArgumentParser('ODE demo')\nparser.a...
[ [ "torch.tensordot", "torch.abs", "pandas.read_csv", "torch.empty", "torch.cat", "torch.nn.init.constant_", "torch.nn.Tanh", "matplotlib.pyplot.plot", "torch.nn.Linear", "torch.tensor", "torch.no_grad", "torch.nn.init.normal_", "torch.cuda.is_available", "nump...
charlesliucn/LanMIT
[ "537dab22335a21285699776ce66d95cb14c3db52" ]
[ "egs/word_embedding/steps/tfrnnlm/backup/skip-gram.py" ]
[ "# -*- coding:utf-8 -*-\n\nimport os\nimport sys\nimport math\nimport reader\nimport random\nimport collections\nimport numpy as np\nimport tensorflow as tf\n\nreload(sys) \nsys.setdefaultencoding(\"utf-8\")\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"5\"\nconfig = tf.ConfigProto()\nconfig.gpu_options.per_process_g...
[ [ "tensorflow.Graph", "tensorflow.train.AdagradOptimizer", "tensorflow.constant", "tensorflow.transpose", "tensorflow.zeros", "tensorflow.placeholder", "numpy.ndarray", "tensorflow.nn.sampled_softmax_loss", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", ...
aleSuglia/pytorch-lightning
[ "4610fddb19d502e534b5c5d77c3dfd6f2e5359a5", "4610fddb19d502e534b5c5d77c3dfd6f2e5359a5" ]
[ "tests/trainer/connectors/test_checkpoint_connector.py", "tests/helpers/datamodules.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.nn.init.constant_" ], [ "sklearn.datasets.make_classification", "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split", "torch.tensor", "sklearn.datasets.make_regression" ] ]
jcchr/cvat
[ "fabb9dee737d60394d81f76962a8fe74542bbe51" ]
[ "cvat/apps/engine/tests/test_rest_api.py" ]
[ "# Copyright (C) 2020 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\n\nimport io\nimport os\nimport os.path as osp\nimport random\nimport shutil\nimport tempfile\nimport xml.etree.ElementTree as ET\nimport zipfile\nfrom collections import defaultdict\nfrom enum import Enum\nfrom glob import glob\nfrom io i...
[ [ "numpy.array_equal", "numpy.clip", "numpy.ones", "numpy.round", "numpy.sin", "numpy.array", "numpy.empty" ] ]
gaonmaor/QANet
[ "6df1bcc96fc871d3da00149f37b213405a765e31" ]
[ "demo.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\nimport tensorflow as tf\nimport bottle\nimport threading\nimport json\n\nfrom prepro import convert_to_features, word_tokenize\nfrom time import sleep\n\n'''\nThis file is taken and modified from R-Net by Minsangkim142\nhttps://github.com/minsangkim142/R-net\n'''\n\napp = b...
[ [ "tensorflow.train.latest_checkpoint", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.train.Saver" ] ]
ONSBigData/bokeh_seed
[ "09fdce9574f8f156123a6e9d7c5d97bbcec2489d" ]
[ "common/sample_bokeh_chart.py" ]
[ "from bokeh.models import ColumnDataSource, HoverTool\nfrom bokeh.plotting import figure\nimport pandas as pd\nimport os\n\n\ndef get_bar_chart(part, dimension, nresults):\n field = '{}_{}'.format(part, dimension)\n dir_path = os.path.dirname(os.path.realpath(__file__))\n df = pd.read_csv(dir_path + '/bund...
[ [ "pandas.read_csv" ] ]
yuankaiz/pyGraphing
[ "4ae6d41e95843b468960fe93638fbee7fdf2022e" ]
[ "bar-line-plots.py" ]
[ "\"\"\"\nBar chart demo with pairs of bars grouped for easy comparison.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\nimport matplotlib\n\npp = PdfPages('ndlog_figs/standalone-vs-single-vs-clone-pct.pdf')\n\nn_groups = 13\n\ndedos = (98.957161,49...
[ [ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.rcParams.update", "matplotlib.pyplot.close", "matplotlib.pyplot.xticks" ] ]
anuwu/jMetalPy
[ "31731c6ceb69061b5c29b41c9894e66182eaec82" ]
[ "jmetal/core/quality_indicator.py" ]
[ "from abc import ABC, abstractmethod\n\nimport numpy as np\nfrom scipy import spatial\n\n\nclass QualityIndicator(ABC):\n\n def __init__(self, is_minimization: bool):\n self.is_minimization = is_minimization\n\n @abstractmethod\n def compute(self, solutions: np.array):\n \"\"\"\n :para...
[ [ "numpy.abs", "numpy.mean", "scipy.spatial.distance.cdist", "numpy.min" ] ]
motokimura/kits19_3d_segmentation
[ "871a24eaad388b8da427e0ab3c95f951629e36d6" ]
[ "kits19_3d_segmentation/utils/misc.py" ]
[ "import random\n\nimport numpy as np\nimport torch\n\n\ndef set_seed(seed):\n \"\"\"Set seed for randome number generator.\n Args:\n seed (int): seed for randome number generator.\n \"\"\"\n random.seed(seed)\n np.random.seed(seed)\n torch.manual_seed(seed)\n torch.cuda.manual_seed(seed)...
[ [ "torch.manual_seed", "torch.cuda.manual_seed", "numpy.random.seed" ] ]
ItsThanhTung/vedadet
[ "ad4df7fca0fa23851c424f7c51dbd2d942a0bdb7" ]
[ "tools/infer.py" ]
[ "import argparse\n\nimport cv2\nimport numpy as np\nimport torch\nimport os\nfrom vedacore.image import imread, imwrite\nfrom vedacore.misc import Config, color_val, load_weights\nfrom vedacore.parallel import collate, scatter\nfrom vedadet.datasets.pipelines import Compose\nfrom vedadet.engines import build_engine...
[ [ "torch.cuda.current_device", "numpy.full", "numpy.concatenate", "torch.cuda.is_available", "numpy.vstack" ] ]
cjdsj/RDN-for-SR-by-keras
[ "88e1839f84f443dff48b38bc8804b213d91aa04d" ]
[ "test.py" ]
[ "import cv2\nimport numpy as np\nimport tensorflow as tf\nfrom matplotlib import pyplot as plt\nfrom tensorflow.keras.models import load_model\nfrom data_processing import get_test_data, imgappend, getYimg, psnr\nfrom model import RDN, L1_loss\n\n\n''' Set parameters '''\nscale = 2\nsize = 32 # Input size\naug_num...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "numpy.reshape", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Elisa-Raspanti/NumPyNet
[ "4e8d0d415275088f485457cdcf251d28a6826b0f", "4e8d0d415275088f485457cdcf251d28a6826b0f" ]
[ "NumPyNet/activations.py", "NumPyNet/layers/convolutional_layer.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\n__author__ = ['Mattia Ceccarelli', 'Nico Curti']\n__email__ = ['mattia.ceccarelli3@studio.unibo.it', 'nico.curti2@unibo.it']\n\n\nclass Activations (object):\n\n def __...
[ [ "numpy.ones_like", "numpy.abs", "numpy.vectorize", "numpy.floor", "numpy.exp", "numpy.tanh", "numpy.where", "numpy.zeros" ], [ "numpy.expand_dims", "numpy.pad", "numpy.random.seed", "numpy.einsum", "numpy.sqrt", "numpy.ones", "numpy.lib.stride_tricks...
wiseodd/laplace-redux
[ "cd208c44149dbb093e9107cf0d6fde7c9f106027" ]
[ "baselines/vanilla/models/wrn.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n##########################################################################################\n# Wide ResNet (for WRN16-4)\n##########################################################################################\n# Taken from ht...
[ [ "torch.nn.Sequential", "torch.add", "torch.nn.functional.dropout", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
exynerve/tensorflow
[ "60f8979fcdb3ba4b0ed4c45d4ed64d471c619882" ]
[ "tensorflow/python/keras/mixed_precision/autocast_variable.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.python.framework.ops.executing_eagerly_outside_functions", "tensorflow.python.framework.ops.convert_to_tensor_v2_with_dispatch", "tensorflow.python.ops.resource_variable_ops.is_resource_variable", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.python.framework.ops...
kokizzu/CompilerGym
[ "4dd454f7a386c26308ab60be12315c28f3fa1cbc" ]
[ "tests/llvm/observation_spaces_test.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\"\"\"Integrations tests for the LLVM CompilerGym environments.\"\"\"\nimport os\nimport sys\nfrom typing import Any, Dict, List\n\nim...
[ [ "numpy.testing.assert_array_equal" ] ]
kaishengyao/cnn
[ "a034b837e88f82bd8adf2c5b0a5defb26fd52096" ]
[ "exp/lm/lm.py" ]
[ "#!/usr/bin/env python\r\n\r\nimport sys\r\nimport math\r\nimport numpy as np\r\nimport operator\r\nturn = 0\r\noperator_sys = ''\r\n\r\n'''\r\nreturn counts\r\n'''\r\ndef counts(ifile, norder):\r\n\r\n ifn = open(ifile, 'rt')\r\n gram = {}\r\n\r\n for iline in ifn:\r\n sline = iline.strip().split('...
[ [ "numpy.log" ] ]
ducminhkhoi/FAPIS
[ "c89703006a2a5250f4d1c71e0aad958d72526885" ]
[ "mmdet/models/mask_heads/fcn_mask_head_ver1.py" ]
[ "import mmcv\nimport numpy as np\nimport pycocotools.mask as mask_util\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..builder import build_loss\nfrom ..registry import HEADS\nfrom ..utils import ConvModule\nfrom mmdet.core import mask_target, force_fp32, auto_fp16\n\nimport matplotl...
[ [ "torch.nn.ConvTranspose2d", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.zeros_like", "numpy.round", "torch.nn.Upsample", "torch.nn.ReLU", "numpy.array", "numpy.zeros", "torch.nn.init.kaiming_normal_" ] ]
arturOnRails/BANN
[ "027af04349304941fb73c2ede502aca4b76f1ad1", "027af04349304941fb73c2ede502aca4b76f1ad1" ]
[ "bann_demo/pytorch/networks/p_modules/p_auto_encoder.py", "bann_demo/pytorch/networks/b_nets/auto_encoder.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\".. moduleauthor:: Artur Lissin\"\"\"\nimport math\nfrom typing import Tuple, Any, final\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as nn_fun\n\nfrom bann.b_frameworks.pytorch.interfaces.ae_interface import AutoEncoderInterface\n\nfrom bann_demo.pytorch.net...
[ [ "torch.nn.ModuleList", "torch.no_grad" ], [ "torch.nn.ModuleList" ] ]
underkoo/NL2SQL
[ "24805f4dc85a1527c4f7c39a142851152fc503c1" ]
[ "extract_vocab.py" ]
[ "import json\nimport torch\nfrom sqlnet.utils import *\nimport numpy as np\nimport datetime\n\nLOCAL_TEST=True\n\n\nif LOCAL_TEST:\n N_word=100\n B_word=6\n USE_SMALL=True\nelse:\n N_word=300\n B_word=42\n USE_SMALL=False\n\nsql_data, table_data, val_sql_data, val_table_data,\\\n test_sql_d...
[ [ "numpy.zeros", "numpy.stack" ] ]
FrankBrongers/FactorVAE
[ "a9e357ee7f38189507f5ab7389065f68a81b3ec5" ]
[ "solver.py" ]
[ "\"\"\"solver.py\"\"\"\n\nimport os\nimport numpy.random as random\nfrom tqdm import tqdm\n\nimport torch\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nfrom utils import mkdirs, save_args_outputs\nfrom ops import recon_loss, ad_loss, kl_divergence, permute_dims\nfrom model import FactorVAE, Discr...
[ [ "torch.ones", "torch.zeros", "torch.load", "torch.nn.functional.cross_entropy", "torch.tensor", "numpy.random.randint", "torch.cuda.is_available", "torch.save" ] ]
ferencberes/twittertennis
[ "d9a21655c3e5c3599fe4149904c967ed67139569", "d9a21655c3e5c3599fe4149904c967ed67139569" ]
[ "tests/test_export.py", "twittertennis/handler_utils.py" ]
[ "import os, sys, json, shutil\nimport pandas as pd\n\ndelim = os.path.sep\nfp = os.path.realpath(__file__)\nfdir = delim.join(fp.split(delim)[:-1])\ndata_dir = os.path.join(fdir, \"..\", \"data\")\n\nfrom twittertennis.handler import TennisDataHandler\n\ndef load_json(json_fp):\n with open(json_fp) as f:\n ...
[ [ "pandas.read_csv" ], [ "pandas.DataFrame" ] ]
OwenNJU/FGraDA
[ "f179c0ad5bc8f34a7e13d2832e3acccbf62b7484" ]
[ "scripts/print_parameters_name.py" ]
[ "# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or s...
[ [ "torch.load" ] ]
HenriqueBuzin/TCC
[ "e149f1bc2e50046c8810f83dae7739a8dea939ee" ]
[ "Python/venv/lib/python3.7/site-packages/zmq/tests/test_message.py" ]
[ "# -*- coding: utf8 -*-\n# Copyright (C) PyZMQ Developers\n# Distributed under the terms of the Modified BSD License.\n\n\nimport copy\nimport sys\ntry:\n from sys import getrefcount as grc\nexcept ImportError:\n grc = None\n\nimport time\nfrom pprint import pprint\nfrom unittest import TestCase\n\nimport zmq...
[ [ "numpy.random.random", "numpy.isnan", "numpy.ndarray", "numpy.frombuffer", "numpy.array", "numpy.empty" ] ]
lgeiger/jax
[ "a1cf06677d12b9b7ce60381eca6bfe38dc787824" ]
[ "jax/dtypes.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.issubdtype", "numpy.dtype", "numpy.ndim", "numpy.result_type", "numpy.array" ] ]
fishfishson/differentiable_volumetric_rendering
[ "9b923d5b7a26144e6de384aa9cd099d1ff20dd0d" ]
[ "im2mesh/local/models/decoder.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nfrom im2mesh.layers import ResnetBlockFC\n\n\nclass Decoder(nn.Module):\n ''' Decoder class.\n\n As discussed in the paper, we implement the OccupancyNetwork\n f and TextureField t in a single network. It consists of 5\n fully-connected ResNet blo...
[ [ "torch.nn.Linear", "torch.nn.functional.leaky_relu" ] ]
RobertJaro/SpringProject
[ "c1ca42650e5dfc6918b7e239fd52b02402ccb1c0" ]
[ "spring/timeseries/plot_overlap.py" ]
[ "import datetime\nimport os\n\nimport pandas as pd\nimport pytz\nfrom matplotlib import pyplot as plt, dates\nfrom pytz import UTC\n\nfull_df = pd.read_csv(\"C:\\\\Users\\\\Robert\\\\Documents\\\\Uni\\\\SOLARNET\\\\HomogenizationCampaign\\\\data_set.csv\",parse_dates=['date'])\n\ndf = full_df[full_df.type == \"halp...
[ [ "matplotlib.pyplot.legend", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.yticks", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.vlines", "matplotlib.pyplot.supt...
Tauffer-Consulting/Mask_RCNN
[ "a421160f5a337a72548b78a5064095c71791e0a1" ]
[ "mrcnn/utils.py" ]
[ "\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport logging\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport sci...
[ [ "numpy.dot", "numpy.minimum", "numpy.sqrt", "tensorflow.stack", "numpy.around", "tensorflow.cast", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.all", "numpy.any", "numpy.exp", "numpy.where", "numpy.divide", "numpy.pad", "numpy.reshape", ...
busyyang/ECGNet
[ "617bee344b22c9ad393a7b335cdd46ee5a621542" ]
[ "paper_models_codes/utils.py" ]
[ "import scipy.io as scio\nimport keras.backend as K\nimport numpy as np\n\nLEN_SAMPLING = 300\n\n\ndef get_sample_length():\n \"\"\"\n return length of record\n 2019/11/26 YANG Jie Init\n :return:\n \"\"\"\n return LEN_SAMPLING\n\n\ndef load_data(path_file):\n \"\"\"\n load data from...
[ [ "scipy.io.loadmat" ] ]
sladesha/algorithm
[ "3ade2e7fd4a7b3acb6eb4f99ef81227ba51569e4" ]
[ "TextCNN/textcnn/eval.py" ]
[ "#! /usr/bin/env python\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport data_input_helper as data_helpers\nfrom text_cnn import TextCNN\nfrom tensorflow.contrib import learn\nimport csv\n\n# Parameters\n# ==================================================\n\n# data Pa...
[ [ "tensorflow.flags.DEFINE_boolean", "tensorflow.Graph", "tensorflow.train.latest_checkpoint", "tensorflow.flags.DEFINE_string", "tensorflow.ConfigProto", "numpy.concatenate", "numpy.argmax", "tensorflow.Session", "numpy.column_stack", "tensorflow.flags.DEFINE_integer" ] ]
XavierXiao/Likelihood-Regret
[ "5517c9bac5992b116e55bb61cad8171e0d585063" ]
[ "test_inputcomplexity.py" ]
[ "import argparse\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data\nimport torchvision.datasets as dset\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\nimport os\nimport DCGAN_VAE_pixel...
[ [ "torch.randn_like", "torch.nn.CrossEntropyLoss", "numpy.log", "torch.load", "numpy.asarray", "torch.nn.functional.cross_entropy", "numpy.save", "torch.exp", "torch.no_grad", "torch.cuda.is_available", "torch.stack" ] ]
ccarcam1/blue-lake_scripting
[ "2fdb4bf7896892538547a002c33ff67559fb71e1" ]
[ "advanced/lumicks/pylake/point_scan.py" ]
[ "import json\n\nfrom .detail.mixin import PhotonCounts\nfrom .detail.mixin import ExcitationLaserPower\n\n\nclass PointScan(PhotonCounts, ExcitationLaserPower):\n \"\"\"A point scan exported from Bluelake\n\n Parameters\n ----------\n h5py_dset : h5py.Dataset\n The original HDF5 dataset containin...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel" ] ]
yasirroni/neural_prophet
[ "80d33168625a236bf58a6f6b2ce8a254315aa662" ]
[ "neuralprophet/df_utils.py" ]
[ "from dataclasses import dataclass\nfrom collections import OrderedDict\nimport pandas as pd\nimport numpy as np\nimport logging\nimport math\n\nlog = logging.getLogger(\"NP.df_utils\")\n\n\n@dataclass\nclass ShiftScale:\n shift: float = 0.0\n scale: float = 1.0\n\n\ndef copy_list(df_list):\n df_list_copy ...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.Series", "numpy.min", "numpy.unique", "numpy.issubdtype", "numpy.quantile", "pandas.DataFrame", "numpy.max", "numpy.std", "numpy.mean", "pandas.date_range", "pandas.isna", "pandas.to_numeric", "numpy.isinf" ...
yiyang7/cs224u
[ "3e360a15640f3ba5fc24f34ad45fc8284aabd26d" ]
[ "rel_ext.py" ]
[ "from collections import Counter, defaultdict, namedtuple\nimport gzip\nimport numpy as np\nimport os\nimport random\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import precision_recall_fscore_support\nfrom sklearn.model_selection ...
[ [ "sklearn.feature_extraction.DictVectorizer", "sklearn.metrics.precision_recall_fscore_support", "numpy.cumsum", "sklearn.linear_model.LogisticRegression" ] ]
TobiasSchmidtDE/GraphGallery
[ "e627e4f454e0ce3813171305a524f5190a6e6f45" ]
[ "graphgallery/attack/targeted/common/nettack.py" ]
[ "\"\"\"\nImplementation of the method proposed in the paper:\n'Adversarial Attacks on Neural Networks for Graph Data'\nby Daniel Zügner, Amir Akbarnejad and Stephan Günnemann,\npublished at SIGKDD'18, August 2018, London, UK\n\nCopyright (C) 2018\nDaniel Zügner\nTechnical University of Munich\n\"\"\"\nimport warnin...
[ [ "numpy.log", "numpy.maximum", "numpy.sqrt", "numpy.multiply", "numpy.unique", "numpy.arange", "numpy.eye", "numpy.tile", "scipy.sparse.csr_matrix", "numpy.concatenate", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum", "scipy.sparse.lil_matrix"...
FernandoGaGu/beagle
[ "b1c968ec84d560e9903a582413e6334fcf447735" ]
[ "beagle/report.py" ]
[ "import numpy as np\nfrom copy import deepcopy\nfrom collections import defaultdict\nfrom .population import Population\nfrom .base import Indicator, ReportBase\nfrom .utils.moea import hypervolume\n\n\nclass Report(ReportBase):\n \"\"\"\n Class that allows monitoring the evolution of populations over differe...
[ [ "numpy.max", "numpy.std", "numpy.array" ] ]
jojoelfe/cisTEM
[ "6d5bc5803fd726022c381e65a721a24661b48639" ]
[ "scripts/plot_ctf_main.py" ]
[ "#!/usr/bin/env python\nimport pandas as pd\nimport sqlite3\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport os\nfrom matplotlib.backends.backend_pdf import PdfPages\nimport sys\nsns.set(color_codes=True)\n\ndef main(args):\n\n db = sqlite3.connect(args.input)\n df = pd.read...
[ [ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.axvline", "matplotlib.pyplot.axhline", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "matplotlib.pyplot.xlim", "numpy.mean", "matplotlib.pyplot.xlabel", "pandas.read_sql", ...
encodingintuition/MachineLearningWorkbook
[ "fb8e985475ad930c30092a0b1a27f4b8be3c7979" ]
[ "hackathon_ht3/code/geo_sort-key_bnb-python-test.py" ]
[ "# basic py libs\nimport numpy as np\nimport pandas as pd\nimport json\n# GIS libs\nimport geopandas as gpd\nfrom shapely.geometry import Point, Polygon\n # Sample JSON the BnBKey from the Json list of Gems\n\n# INGESTION\nlongitude = -73.9233\nlatitude = 43.7717\nbnb_geo_address = [ longitude,latitude ]\n\n# Data ...
[ [ "pandas.DataFrame" ] ]
annasu1225/COMP0037-21_22
[ "e98e8d278b35ee0550e6c09b35ab08b23e60ca82" ]
[ "Lab_Week_08_-_Temporal_Difference_Learning/Code/td/manager.py" ]
[ "import matplotlib\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nclass Manager:\n def __init__(self, env_info, agent_info, true_values_file=None, experiment_name=None):\n self.experiment_name = experiment_name\n \n self.grid_h, self.grid_w = env_info[\"grid_height\"], env_info[\"gr...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.plot", "numpy.nanmean", "numpy.allclose", "matplotlib.pyplot.subplot", "numpy.load", "numpy.unravel_index", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "numpy.isnan", "matplotlib.pyplot.ion", "matplotlib.pypl...
JuliaComputing/tensorflow
[ "a2e3dcdb4f439f05592b3e4698cb25a28d85a3b7" ]
[ "tensorflow/python/kernel_tests/list_ops_test.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.ops.list_ops.tensor_list_set_item", "tensorflow.python.ops.list_ops.tensor_list_length", "tensorflow.python.eager.backprop.GradientTape", "tensorflow.python.framework.ops.device", "tensorflow.python.ops.array_ops.identity", "tensorflow.python.eager.context.device", "...
shenberg/neural_compressor
[ "995c2b10c6528af1553cfff08edb2063d38b9699" ]
[ "models/densenet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\nclass _DenseLayer(nn.Sequential):\n def __init__(self, num_input_features, growth_rate, bn_size, drop_rate):\n super(_DenseLayer, self).__init__()\n self.add_module('norm.1', nn.BatchNorm2d...
[ [ "torch.nn.functional.dropout", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
ngocminhbui/resnet_two_stream_2
[ "fac1e17725e77a61dde8ebce73e217b0f970a75d" ]
[ "resnet_architecture.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.python.training import moving_averages\n\nfrom config import Config\n\nMOVING_AVERAGE_DECAY = 0.9997\nBN_DECAY = MOVING_AVERAGE_DECAY\nBN_EPSILON = 0.001\nCONV_WEIGHT_DECAY = 0.00004\nCONV_WEIGHT_STDDEV = 0.1\nFC_WEIGHT_DE...
[ [ "tensorflow.convert_to_tensor", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.summary.scalar", "tensorflow.python.ops.control_flow_ops.cond", "tensorflow.add_n", "tensorflow.nn.conv2d", "tensorflow.python.training.moving_averages.assign_m...
rainbow979/transport_challenge
[ "a40c5bcbfc93a69bb210a52e31905c69ebbe8dea" ]
[ "transport_challenge/transport_controller.py" ]
[ "from json import loads\nfrom csv import DictReader\nfrom typing import List, Dict, Tuple, Optional, Union\nimport numpy as np\nfrom tdw.py_impact import ObjectInfo, AudioMaterial\nfrom tdw.librarian import ModelLibrarian\nfrom tdw.tdw_utils import TDWUtils\nfrom magnebot import Magnebot, Arm, ActionStatus, ArmJoin...
[ [ "numpy.linalg.norm", "numpy.rad2deg", "numpy.arctan2", "numpy.copy", "numpy.ndindex", "numpy.array" ] ]
marnikitta/sgp
[ "4d0d99d477ddb864107d13d63ebd23ade5f3090b" ]
[ "sgp/trees/__init__.py" ]
[ "import numpy as np\nnp.seterr(divide='ignore', invalid='ignore')\n" ]
[ [ "numpy.seterr" ] ]
alexcpatel/2D23D
[ "01d5e9c8342700af009ba4ea593c5e443b5989d4" ]
[ "scripts/driver.py" ]
[ "import argparse\nimport os\nimport shutil\nimport open3d as o3d\nimport time \nimport csv\nimport numpy as np\n\nimport points\nimport icp\nimport triangulation\nimport verify\n\n# CSV_FIELDNAMES = [\"num_points\", \"num_two_percent_dist\", \"num_two_percent_dist_percent\", \n# \"num_five_percent...
[ [ "numpy.median", "numpy.mean" ] ]
shenmishajing/mmdetection
[ "1a90fa80a761fe15e69111a625d82874ed783f7b" ]
[ "mmdet/models/dense_heads/anchor_head.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nfrom mmcv.runner import force_fp32\n\nfrom mmdet.core import (anchor_inside_flags, build_anchor_generator,\n build_assigner, build_bbox_coder, build_sampler,\n images_to_levels, multi...
[ [ "torch.cat", "torch.nn.Conv2d", "torch.zeros_like", "torch.arange", "torch.onnx.is_in_onnx_export" ] ]
kvnandula04/graph-plotter-notion
[ "bb083ff150bbaaf49ec8317cf83484c076b373bd" ]
[ "NotionScript.py" ]
[ "from notion.client import NotionClient\nfrom datetime import datetime\nfrom matplotlib import pyplot as plt\nimport matplotlib.dates as mdates\n\n# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in session on Notion.so\nclient = NotionClient(token_v2=\"Replace this with token v2\")\n\n#...
[ [ "matplotlib.pyplot.gca", "matplotlib.dates.DateFormatter", "matplotlib.dates.DayLocator", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
dajimmy1120/AvatarGAN
[ "be264914223490ee9c23e59ad5a414da1aef4824" ]
[ "models/encoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Encoder(nn.Module):\n def __init__(self):\n super(Encoder, self).__init__()\n\n self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3,\n stride=2, padding=1, bias=False) # ...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_" ] ]
mshr-h/nucleo-f746zg-microtvm-example
[ "284005b60a10e7560fbb6d10e6311996f3774269" ]
[ "run_onnx_on_tvm.py" ]
[ "import tvm\nfrom tvm import relay\nimport numpy as np\nimport onnx\nfrom tvm.contrib import graph_executor\n\nmodel_path = \"add.onnx\"\n\nonnx_model = onnx.load(model_path)\n\ninput1_name = \"Input1\"\ninput2_name = \"Input2\"\nshape_dict = {input1_name: [1], input2_name: [1]}\nmod, params = relay.frontend.from_o...
[ [ "numpy.array" ] ]
Ocsa/tytus
[ "3ccb7c7616c26264a827bca1e9084b58e11ddd0f" ]
[ "parser/team08/Tytus_SQLPARSER_G8/Instrucciones/Sql_update/UpdateTable.py" ]
[ "from Instrucciones.Excepcion import Excepcion\nfrom Instrucciones.TablaSimbolos.Instruccion import Instruccion\nfrom Instrucciones.Sql_select.SelectLista import Alias\nfrom storageManager.jsonMode import *\nfrom Instrucciones.Sql_create.Tipo_Constraint import Tipo_Dato_Constraint\nfrom Instrucciones.TablaSimbolos....
[ [ "numpy.array" ] ]
vestri/peakutils
[ "e0cf4618b84ae068fb824dc0b49899cff11f52c9" ]
[ "peakutils/peak.py" ]
[ "'''Peak detection algorithms.'''\n\nimport numpy as np\nfrom scipy import optimize\nfrom scipy.integrate import simps\n\neps = np.finfo(float).eps\n\ndef indexes(y, thres=0.3, min_dist=1):\n '''Peak detection routine.\n\n Finds the peaks in *y* by taking its first order difference. By using\n *thres* and ...
[ [ "numpy.hstack", "numpy.sqrt", "numpy.min", "numpy.arange", "numpy.issubdtype", "numpy.finfo", "numpy.ones", "scipy.optimize.curve_fit", "numpy.max", "numpy.diff", "scipy.integrate.simps", "numpy.argsort", "numpy.array", "numpy.where", "numpy.sum" ] ]
gaohao95/boxtree
[ "eb98de195d013d0fb44a51f54440e410c6a5f28e" ]
[ "boxtree/tree_build.py" ]
[ "from __future__ import division, absolute_import\n\n__copyright__ = \"Copyright (C) 2012 Andreas Kloeckner\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software withou...
[ [ "numpy.empty_like", "numpy.cumsum", "numpy.dtype", "numpy.finfo", "numpy.max", "numpy.append", "numpy.diff", "numpy.iinfo", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
johann-petrak/keras-wrapper
[ "0203134c2e7b2d8468fb55531d61df305993af09", "0203134c2e7b2d8468fb55531d61df305993af09" ]
[ "python/kerasTrain.py", "python/lfkerastrain.py" ]
[ "from __future__ import print_function\nimport sys\nimport keras\nimport importlib\nimport os\nimport inspect\nimport numpy as np\n# import h5py just to check if it is installed\nimport h5py\n\n# This gets invoked by the EngineKerasWrapper which is just an instance of EnginePythonNetworksbase which\n# passes the fo...
[ [ "numpy.loadtxt" ], [ "numpy.eye" ] ]
goffinet/PyExfil
[ "8729442b6822f7587475dae7e8bd0f927c7df45c" ]
[ "pyexfil/Stega/binoffset/binoffset.py" ]
[ "#!/usr/bin/python\nimport sys\nimport zlib\nimport hashlib\nimport binascii\n\nimport numpy as np\nfrom PIL import Image\n\n\n# Globals\nBUFF_CHAR = 5\nPIXEL_MAX = 255\nMODES = ['baseimage', 'encode', 'decode']\n\n\ndef _str2bin(raw_data):\n return str(bin(int(binascii.hexlify(raw_data), 16)))[2:]\n\n\ndef file...
[ [ "numpy.array" ] ]
rubiotorres/CryptoSmartCandle
[ "320a5c2c0affd8019fd844be4b0115563d519175" ]
[ "project/src/util.py" ]
[ "import datetime\nimport json\n\nimport MySQLdb\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n\ndef get_pair_ids(df_path):\n df_currencies = pd.read_csv(df_path)\n list_ids = list(df_currencies[df_currencies['Currency Pair'].str.contains('^BTC_')]['Id'])\n return list_ids, df_currencies\n\n...
[ [ "pandas.read_csv" ] ]
qslia/fast-reid
[ "4508251d7439c6c20e8e2d9573c6123b1f388cc5" ]
[ "fastreid/modeling/backbones/resnest.py" ]
[ "# encoding: utf-8\n# based on:\n# https://github.com/zhanghang1989/ResNeSt/blob/master/resnest/torch/models/resnest.py\n\"\"\"ResNeSt models\"\"\"\n\nimport logging\nimport math\n\nimport torch\nfrom torch import nn\n\nfrom fastreid.layers import SplAtConv2d, get_norm, DropBlock2D\nfrom fastreid.utils.checkpoint i...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.init.zeros_", "torch.device", "torch.nn.ReLU" ] ]